econ-ark / HARK

Heterogenous Agents Resources & toolKit
Apache License 2.0
315 stars 195 forks source link

Add more parameter types to `Parameters` #1387

Open Mv77 opened 2 months ago

Mv77 commented 2 months ago

I have been playing with the core.Parameters class and really like it. One limitation is that it restricts the class of parameters that can be time-varying. This PR adds support for a few more classes: booleans, distributions, and functions.

You can imagine passing time-varying parameters of this class if, for instance you want:

I have used this class in my ongoing work and have been very happy with it.

Mv77 commented 2 months ago

@alanlujan91 should this change be reflected in other parts of the code like, say, https://github.com/econ-ark/HARK/blob/6a73c4f32a52ff9404f731761c3b754c1f85d650/HARK/core.py#L95 ?

Mv77 commented 2 months ago

Not sure this needs a test?

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 71.69%. Comparing base (bbb07a5) to head (7417c54).

:exclamation: Current head 7417c54 differs from pull request most recent head 8fb9040. Consider uploading reports for the commit 8fb9040 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1387 +/- ## ========================================== + Coverage 71.53% 71.69% +0.15% ========================================== Files 83 84 +1 Lines 13938 13939 +1 ========================================== + Hits 9971 9993 +22 + Misses 3967 3946 -21 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

alanlujan91 commented 2 months ago

@MridulS is there a way for pre-commit to automatically upload changes?

MridulS commented 2 months ago

There is pre-commit.ci but it makes changes to the PR branch and you need to make sure the contributors are pulling in all changes before making any new changes locally. I would just strongly suggest to new contributors to use pre-commit locally :)

alanlujan91 commented 2 months ago

well, somehow my pre-commit is different than the one in github actions?? @MridulS

Mv77 commented 3 weeks ago

MAC hates me. And I hate it too. It's the same tests as in https://github.com/econ-ark/HARK/pull/1415

Will come back to this when that's merged