-
-
Notifications
You must be signed in to change notification settings - Fork 199
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
Split out model execution into examples/ from HARK package code #440
Comments
Application examples that need to be fixed up:
Based on this note, I will check for each example to make sure there isn't a dependency on them. If I do find a dependency on one of these modules/examples in a different repository, I will note on that repository that its HARK dependency needs to be pegged to the last release, 0.10.2, until it can be fixed. |
There are some downstream dependencies on Also in the LifeCycleModel DemARK |
One significant source of code dependency for the This relates to #446 -- if these parameters were available as a configuration file, as they are in Dolo, there would not be the same need for a code dependency, which is complicating the repository structure and leading to code duplication. |
I see now that even the I believe this is intend for the purpose of demonstrating (and testing) the code in each model. I'll move these over to There are parameters for many specific models here: This module is imported by some DemARKs and REMARKs. Confusingingly, sometimes this module gets imported, but never used--for example the KrusellSmith DemARK imports it, but then ignores it, defining its parameters locally. (See #446 ) |
The general pattern that we should abide by for DemARKs and parameters is to import some standard parameter configurations and then explicitly set only the parameters that either
I thought that was what had been done with KrusellSmith. If we are setting the values of ALL the parameters inside the notebook, then could you go through the notebook and remove the lines that "reset" the values of parameters to the same values that they should already have obtained by the importation of a default dictionary? |
I see. I'll check in on that. |
As per this comment, the PR for this issue will remove SolvingMicroDSOPs from HARK. It will be preserved as a REMARK. |
|
Looking for dependencies on There's one in the Krussel-Smith REMARK--but this is parameters and data information only. There are some DemARKs that reference the same file: But more significantly, the Based on this comment: ...it sounds like splitting the generalizable library code from cstwMPC into HARK, and moving the paper specific work elsewhere, is a known task. I'll consider this out of scope for this ticket. In the PR for this ticket, cstwMPC will remain as is in HARK. It can be treated separately in another issue. |
Related to #415
HARK is a Python package that is imported by other packages. It is in most respects structured like a typical Python package.
One way it departs from the normal way Python packages are structured is how it uses subpackages. Its subpackages, like
cstwMPC
,BayerLuettecke
, andFashionVictim
,SolvingMicroDSOPs
, are currently crafted as reproductions of particular research results. Several have directories forFigures
anddo_all.py
scripts as if they are REMARKs. Most have long__main__
methods that do display of results (in print lines or plots) in the same file as the model is built and configured.This is not standard software architecture. There is a missing distinction here between:
I gather that Econ-Ark has some idiosyncratic needs. But from what I understand so far, these categories fit Econ-Ark's use cases. Roughly speaking, research publication uses of HARK are like applications. Pedagogical uses of HARK are like demonstrations. The core library code, HARK, is neither of these.
If this tracks, then it would make sense to following the conventions of other scientific software packages in separating core 'library' package code and other code that demonstrates it. A good example of this is
matplotlib
. That project has a top levelexamples
directory which contains its tutorials. This is adjacent to the directory that contains its library code. If implemented and seen this pattern in other scientific software repositories I've worked with. (e.g. networkx). Dolo does this as well.There are many benefits to this architecture. Perhaps the greatest is that it makes software developers make decisions about what functionality is supported as reusable code. Code that's in a library can be held to a rigorous testing standard and held to be independent of configuration parameters set in the examples.
The text was updated successfully, but these errors were encountered: