-
-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Parameters class in solver #1389
Conversation
*Is* there ugly and repetitive code that does that for solvers? It exists
for the *simulation* code, and it's a problem that's getting fixed, but I
don't think there's any issue for solvers, AFAIK.
…On Thu, Feb 22, 2024 at 8:22 PM Mateo Velásquez-Giraldo < ***@***.***> wrote:
I think that one of the main advantages of the Parameters class that
@alanlujan91 <https://github.com/alanlujan91> has created is that, with
its __get_item__ method, we can do away with a lot of ugly and repetitive
code in HARK that determines what arguments to give to a solver in a given
period given what is time-varying and what is not.
In an ongoing project, I have created an agent class that stores its
parameters in a Parameters object. That parameter is then used by the
solver to feed time-specific parameters to the solve_one_period method.
Although I am not yet sharing the agent prototype, I wanted to share and
get comments on the solver. Currently what I am doing is forking the
solve_one_cycle method. If the agent has a Parameters object, it takes
advantage of it. If not, it uses the old and unchanged method.
- Tests for new functionality/models or Tests to reproduce the bug-fix
in code.
- Updated documentation of features that add new functionality.
- Update CHANGELOG.md with major/minor changes.
------------------------------
You can view, comment on, or merge this pull request online at:
#1389
Commit Summary
- de17841
<de17841>
Use Parameters class in solver
File Changes
(1 file <https://github.com/econ-ark/HARK/pull/1389/files>)
- *M* HARK/core.py
<https://github.com/econ-ark/HARK/pull/1389/files#diff-33a0fc9d7783cd0215156e3824a12904f2d025b32245aeeeeeb6b4f5cc509a74>
(104)
Patch Links:
- https://github.com/econ-ark/HARK/pull/1389.patch
- https://github.com/econ-ark/HARK/pull/1389.diff
—
Reply to this email directly, view it on GitHub
<#1389>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADKRAFJD5VGXED4ZVW4L4CLYU7VNHAVCNFSM6AAAAABDV57JK6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGE2TAMRRGY4DCMA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1389 +/- ##
==========================================
- Coverage 71.53% 71.45% -0.08%
==========================================
Files 83 83
Lines 13938 13955 +17
==========================================
+ Hits 9971 9972 +1
- Misses 3967 3983 +16 ☔ View full report in Codecov by Sentry. |
That's fair, I exaggerated. This is an instance where the Parameters tool that will eliminate a lot of ugly simulation code can also make solution code slightly more beautiful :)
turns into
|
This is a step in the right direction, and also sets up a "conversion path"
by maintaining backwards compatibility. Will look at promptly.
…On Mon, Feb 26, 2024 at 9:56 AM Alan Lujan ***@***.***> wrote:
@alanlujan91 <https://github.com/alanlujan91> requested your review on:
#1389 <#1389> Use Parameters class
in solver.
—
Reply to this email directly, view it on GitHub
<#1389 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADKRAFIQCGCJOIF7PWTNS7DYVSPBJAVCNFSM6AAAAABDV57JK6VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJRHEZDENZTGA4TMNY>
.
You are receiving this because your review was requested.Message ID:
***@***.***>
|
This PR was ready to be reviewed in February, and got stalled for some reason. What's the status of it? |
The codecov tests are failing, but that's only because this branch is out of date with the master branch's new setting for this. Merging. |
I think that one of the main advantages of the
Parameters
class that @alanlujan91 has created is that, with its__get_item__
method, we can do away with a lot of ugly and repetitive code in HARK that determines what arguments to give to a solver in a given period given what is time-varying and what is not.In an ongoing project, I have created an agent class that stores its parameters in a
Parameters
object. That parameter is then used by the solver to feed time-specific parameters to thesolve_one_period
method.Although I am not yet sharing the agent prototype, I wanted to share and get comments on the solver. Currently what I am doing is forking the
solve_one_cycle
method. If the agent has aParameters
object, it takes advantage of it. If not, it uses the old and unchanged method.