-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Add constructor architecture #1410
Commits on Apr 15, 2024
-
First draft of construct() method
Completely untested, will adapt construct_income_process on next commit as test example.
Configuration menu - View commit details
-
Copy full SHA for a036f24 - Browse repository at this point
Copy the full SHA a036f24View commit details -
IncShkDstn is constructed using construct
Holy crap, construct() worked on the first try! Only IncShkDstn has been tested, and none of the "error catching" features have been looked at. But hey, it works!
Configuration menu - View commit details
-
Copy full SHA for 4d3e407 - Browse repository at this point
Copy the full SHA 4d3e407View commit details -
Add missing constructor lines to ConsAggShock
Should pass these tests now, but formatting is probably still wrong.
Configuration menu - View commit details
-
Copy full SHA for 0b96804 - Browse repository at this point
Copy the full SHA 0b96804View commit details
Commits on Apr 24, 2024
-
Add make_univariate, simplify formatting
Can now collapse a DiscreteDistribution to a single dimension; PermShkDstn and TranShkDstn are made this way now. Moved bespoke constructor dictionary lines out of init. Future plan: each AgentType subclass should have default constructors dictionary in its parameter dictionary.
Configuration menu - View commit details
-
Copy full SHA for 1d56aa8 - Browse repository at this point
Copy the full SHA 1d56aa8View commit details -
Configuration menu - View commit details
-
Copy full SHA for f440295 - Browse repository at this point
Copy the full SHA f440295View commit details -
Turn lists into TimeVaryingDiscreteDistributions
One test was failing due to lack of seed.
Configuration menu - View commit details
-
Copy full SHA for 613fa5c - Browse repository at this point
Copy the full SHA 613fa5cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 35cf624 - Browse repository at this point
Copy the full SHA 35cf624View commit details -
Configuration menu - View commit details
-
Copy full SHA for 51ed70e - Browse repository at this point
Copy the full SHA 51ed70eView commit details
Commits on Apr 26, 2024
-
Add aXtraGrid and solution_terminal to constructors
All tests pass except for calc_jacobian, which needs a separate fix.
Configuration menu - View commit details
-
Copy full SHA for ad6994d - Browse repository at this point
Copy the full SHA ad6994dView commit details -
Missed this one. Jacobian test will still be failing.
Configuration menu - View commit details
-
Copy full SHA for 3c5b2c7 - Browse repository at this point
Copy the full SHA 3c5b2c7View commit details -
Fix odd behavior of calc_jacobian
All test should pass now. Added new optional input for AgentType.solve() that allows the user to decline to run the presolve routine. For most of our classes, presolve might update the terminal solution and/or run update/constructor methods, but this is fatal to what calc_jacobian wants to do.
Configuration menu - View commit details
-
Copy full SHA for fd1dd45 - Browse repository at this point
Copy the full SHA fd1dd45View commit details -
Fix indexing error in distribution tests
I think something about pytest just changed while I was working on this branch, because three tests needed to have a [0] added to them (to reference the only element in the array) in order to be correct. Nothing changed, but the result of these tests did. I'm confused.
Configuration menu - View commit details
-
Copy full SHA for ff134b6 - Browse repository at this point
Copy the full SHA ff134b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for bdc2b0f - Browse repository at this point
Copy the full SHA bdc2b0fView commit details -
Change two tests to AlmostEqual
One assertEqual test was off by 1e-16 on Python 3.9, but not 3.10. No idea why.
Configuration menu - View commit details
-
Copy full SHA for 154512d - Browse repository at this point
Copy the full SHA 154512dView commit details -
Also added retro support for using [None] rather than None for aXtraExtra.
Configuration menu - View commit details
-
Copy full SHA for 38c376b - Browse repository at this point
Copy the full SHA 38c376bView commit details
Commits on Apr 27, 2024
-
Configuration menu - View commit details
-
Copy full SHA for f1f963e - Browse repository at this point
Copy the full SHA f1f963eView commit details
Commits on May 7, 2024
-
Move general income process objects to constructors
pLvlGrid and pLvlNextFunc are now built with the constructors framework. This means that the *only* difference between the AgentType subclasses in ConsGenIncProcessModel is their default dictionary. GenInc tests pass locally, committing to see what else I broke.
Configuration menu - View commit details
-
Copy full SHA for 6c6fc97 - Browse repository at this point
Copy the full SHA 6c6fc97View commit details -
Configuration menu - View commit details
-
Copy full SHA for 246874f - Browse repository at this point
Copy the full SHA 246874fView commit details -
Because dictionaries now include constructor methods, two extra lines were needed. Also made the example problems consistently infinite horizon so that the comparison is relevant.
Configuration menu - View commit details
-
Copy full SHA for 0134f23 - Browse repository at this point
Copy the full SHA 0134f23View commit details -
Remove pLvlGrid dependence on AgentCount
This makes object used for the solution not depend on simulation parameter. Test results were slightly adjusted to account for grid change. Tests passed on the commit immediately prior to this one, hence the *very* specific commit.
Configuration menu - View commit details
-
Copy full SHA for 2a23106 - Browse repository at this point
Copy the full SHA 2a23106View commit details -
Configuration menu - View commit details
-
Copy full SHA for 35fadae - Browse repository at this point
Copy the full SHA 35fadaeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 070cd83 - Browse repository at this point
Copy the full SHA 070cd83View commit details
Commits on May 8, 2024
-
Move RiskyDstn, ShkDstn, ShareLimit to constructors
The portfolio / risky-asset model constructed inputs have been ported into the constructors framework. I didn't put the simulation-only object AdjustDstn into this form, nor did I put the one-liner ShareGrid constructor. The latter should probably be moved later-- it's not hard, I just got lazy when it's a one line method to make a uniform grid on [0,1].
Configuration menu - View commit details
-
Copy full SHA for e5a85b4 - Browse repository at this point
Copy the full SHA e5a85b4View commit details -
Fixed a spelling error in one place, so had to fix it where it was imported.
Configuration menu - View commit details
-
Copy full SHA for 9638460 - Browse repository at this point
Copy the full SHA 9638460View commit details -
Fix dictionary imports in examples
Due to presence of constructors, two examples needed a different dictionary as their base.
Configuration menu - View commit details
-
Copy full SHA for 1b03e14 - Browse repository at this point
Copy the full SHA 1b03e14View commit details -
Move PrefShkDstn to constructor format
Tests pass, committing to see which examples break.
Configuration menu - View commit details
-
Copy full SHA for 1265977 - Browse repository at this point
Copy the full SHA 1265977View commit details -
Move MedShkDstn to constructor format
Tests pass, hopefully examples will too.
Configuration menu - View commit details
-
Copy full SHA for 4ffee80 - Browse repository at this point
Copy the full SHA 4ffee80View commit details
Commits on May 9, 2024
-
Add describe_constructors method
AgentType now has a helper method called describe_constructors that prints to screen the status of constructed objects, including their names, the required primitive inputs, and whether each value exists.
Configuration menu - View commit details
-
Copy full SHA for f905c8f - Browse repository at this point
Copy the full SHA f905c8fView commit details
Commits on May 10, 2024
-
Move AggShock terminal solution to constructor
Also deleted long-unused commented out code.
Configuration menu - View commit details
-
Copy full SHA for 0c2e5ed - Browse repository at this point
Copy the full SHA 0c2e5edView commit details -
Forgot to actually delete old method
Prior commit was actually trivial, as it didn't delete the prior update_solution_terminal!
Configuration menu - View commit details
-
Copy full SHA for e74a269 - Browse repository at this point
Copy the full SHA e74a269View commit details -
Configuration menu - View commit details
-
Copy full SHA for 019e39b - Browse repository at this point
Copy the full SHA 019e39bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6fdacdc - Browse repository at this point
Copy the full SHA 6fdacdcView commit details -
Never make last second changes before committing, kids. You will never get it right and only embarrass yourself through the commit history.
Configuration menu - View commit details
-
Copy full SHA for e79d786 - Browse repository at this point
Copy the full SHA e79d786View commit details -
Configuration menu - View commit details
-
Copy full SHA for a9a9df6 - Browse repository at this point
Copy the full SHA a9a9df6View commit details -
Fix portfolio and bequest examples
Minor errors in code and dictionaries due to changes in prior commit.
Configuration menu - View commit details
-
Copy full SHA for f92b29f - Browse repository at this point
Copy the full SHA f92b29fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 22efb70 - Browse repository at this point
Copy the full SHA 22efb70View commit details
Commits on May 13, 2024
-
Move Markov terminal solution to constructor
Also had to change dictionary import in tests. Notebooks might break.
Configuration menu - View commit details
-
Copy full SHA for 243bdd7 - Browse repository at this point
Copy the full SHA 243bdd7View commit details -
Too much copy-pasta, something ended up zero that should have been one.
Configuration menu - View commit details
-
Copy full SHA for a8eadab - Browse repository at this point
Copy the full SHA a8eadabView commit details -
Add two example constructors for MrkvArray
One is an extremely basic binary state specification, the other is a "ratchet" specification in which transitions only go one direction, and only one step at a time.
Configuration menu - View commit details
-
Copy full SHA for 32f3f51 - Browse repository at this point
Copy the full SHA 32f3f51View commit details -
Fix dictionary import in one example notebook
Same issue as in earlier commit, but in an example notebook. Just imported and used correct dictionary.
Configuration menu - View commit details
-
Copy full SHA for 6df9acb - Browse repository at this point
Copy the full SHA 6df9acbView commit details -
Configuration menu - View commit details
-
Copy full SHA for fa6030a - Browse repository at this point
Copy the full SHA fa6030aView commit details
Commits on May 14, 2024
-
Added error logging functionality to construct
Construct method is now more robust, with an option to force through errors and record them in a separate dictionary. Also made other small changes/fixes.
Configuration menu - View commit details
-
Copy full SHA for b282159 - Browse repository at this point
Copy the full SHA b282159View commit details -
Add a few alternate constructors
This commit adds one missing (trivial) constructor and adds a few "counterexample" constructors that *could* be used for other parameter specifications. There are many, many more that could be written.
Configuration menu - View commit details
-
Copy full SHA for 357e412 - Browse repository at this point
Copy the full SHA 357e412View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5b9d91d - Browse repository at this point
Copy the full SHA 5b9d91dView commit details
Commits on May 21, 2024
-
Configuration menu - View commit details
-
Copy full SHA for d82714c - Browse repository at this point
Copy the full SHA d82714cView commit details