HARK icon indicating copy to clipboard operation
HARK copied to clipboard

Add more parameter types to `Parameters`

Open Mv77 opened this issue 1 year ago • 7 comments

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:

  • To indicate whether an agent is retired = True | False for some meaningful change in its income process.
  • To have a time varying distribution for income shocks. Maybe this period they are normal, and the next they are lognormal.
  • To have a time varying tax function.

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

  • [x] Tests for new functionality/models or Tests to reproduce the bug-fix in code.
  • [x] Updated documentation of features that add new functionality.
  • [x] Update CHANGELOG.md with major/minor changes.

Mv77 avatar Feb 22 '24 23:02 Mv77

@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 avatar Feb 22 '24 23:02 Mv77

Not sure this needs a test?

Mv77 avatar Feb 22 '24 23:02 Mv77

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
@@            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.

codecov[bot] avatar Feb 23 '24 00:02 codecov[bot]

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

alanlujan91 avatar Feb 26 '24 15:02 alanlujan91

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 :)

MridulS avatar Feb 26 '24 15:02 MridulS

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

alanlujan91 avatar Feb 28 '24 16:02 alanlujan91

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

Mv77 avatar Apr 26 '24 14:04 Mv77

This PR was blocked by some unrelated logistical thing. Now its only conflict is the CHANGELOG.

Can this be fixed and merged now?

sbenthall avatar Jun 25 '24 23:06 sbenthall

I'll try to look at this in the morning. I thought it still had a (non-trivial) outstanding issue.

On Tue, Jun 25, 2024, 7:38 PM Sebastian Benthall @.***> wrote:

This PR was blocked by some unrelated logistical thing. Now its only conflict is the CHANGELOG.

Can this be fixed and merged now?

— Reply to this email directly, view it on GitHub https://github.com/econ-ark/HARK/pull/1387#issuecomment-2190207349, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADKRAFPECECNYOSMUO6NPCLZJH5QVAVCNFSM6AAAAABDV3AKYOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJQGIYDOMZUHE . You are receiving this because your review was requested.Message ID: @.***>

mnwhite avatar Jun 25 '24 23:06 mnwhite

GitHub is hanging on its automatic merge check. I'm trying to get this in now.

mnwhite avatar Jun 28 '24 17:06 mnwhite