-
-
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
Break scripts to code and tests #370
Comments
So, I guess you think they should all be modules instead of scripts? Sounds right to me. I think their scriptyness dates from early days when we were trying to build in examples and testing in the files themselves rather than having standalone tests and examples. In cases (if any) where the main() actually includes some content, we should make sure to port that content to an appropriate place (a DemARK or a test, probably) before deleting it. |
I had a look at this, it seems that in almost all files in HARK, the main() only contains a warning like this, |
@JackShiqiLi my main intent is to remove all the main() as well if
All files should just have classes and functions, eg: https://github.com/econ-ark/HARK/blob/master/HARK/ConsumptionSaving/ConsPortfolioModel.py Let me know if this makes sense. |
@MridulS Yes it definitely makes sense. Previously I only looked in the HARK folder but not subfolders and thought the messages in main() were there on purpose such as telling economists who are new to Python the files do nothing themselves. Thank you for explaining. |
+1 to this issue. See #440 for related point |
This is fixed |
A lot of files in HARK are currently python scripts (with a main() function to test the classes and functions in the file) rather than a "module".
For example if you look at the documentation of https://hark.readthedocs.io/en/latest/generated/HARK.interpolation.html#module-HARK.interpolation, https://hark.readthedocs.io/en/latest/generated/HARK.estimation.html, you would see that dangling
main()
function.The text was updated successfully, but these errors were encountered: