-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update perturbIC.py #5
Conversation
I can't work out why I specified it this way. In any case
This will give different results to the current implementation but will be stable in the future. PCG64 is currently the default bit generator but that could change so it's used explicitly here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this PR @leoberhelman!
Overall I think you did a pretty good job restructuring and refactoring the code into functional portions that can be easily tested! Well done!
I left many comments, but please don't get scared by their amount:
- Many of them are minor corrections to docstrings or function/variable names that I think would make the code clearer
- Some are related to the python environment and CI, which have good structures but might be restructured a bit
- Some are related to the structure and performance of some functions and of the overall main function
I have not reviewed the unit-testing file (perturbIC_test.py
), because I believe some tests will need modifications after the suggested restructuring.
Therefore, I think it might be better you to address the comments first, and change the tests accordingly. Then, I can re-review everything including the tests.
I tried to leave comments and explain most of my suggestions, but feel free to comment back for further explanations, or ask me directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the changes and a few more to correct some errors. Still need to update the unit tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @leoberhelman for the amazing work restructuring this after my extensive review!
I added a few other minor suggestions. Please refer to the specific comments.
Two important points:
- I am going to open up a PR with a revision of the testing suite. That can also serve as a guideline an example for future testing suites.
As a consequence, there is no need to address the specific comment I left regarding thetest_create_default_outname
function. I will include that part in my testing-suite PR. Thetest_create_default_outname
comment should be viewed as an example of a testing approach. - With the restructuring of the repo and creation of the
original
branch, I think themain
branch should now only include the portions of the codebase we are restructuring, and potentially be in a "releasable" state (in the not-too-far future). Therefore, I would delete all the scripts that we are not using from this branch.
Namely, I would only keep theperturbIC.py
script (moving it inside theumfile_utils
folder, along with the already present_version.py
and__init__.py
files) while movind theREADME.md
at the top-level of the repo.
Note that, after this restructure, some minor modifications might be needed with the imports (from perturbIC import ...
should becomefrom umfile_utils.perturbIC
for example). Also, in thepyproject.toml
file the following lines should be added to ensurepytest
works correctly:[tool.pytest.ini_options] pythonpath = "src"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added another comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Thank you @leoberhelman for your great work on this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have another comment that I thought about when reviewing the subset function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Update perturbIC.py Can the random generator be simplified? Refactored changes to the perturbIC. Most of the code is not in smaller functions. The descriptions are still in progress. Update perturbIC.py Added more documentation and created variables for the integers
Adding the pytests
Create the necessary environments for testing for 3.10 Update environment-3.10.yml
Create the environment for Python 3.11 Update environment-3.11.yml
Minor comments Co-authored-by: Davide Marchegiani <[email protected]>
Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Random seed but need to discuss more about how to restrict parameters Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Co-authored-by: Davide Marchegiani <[email protected]> Update perturbIC.py
Condensing the environment files into one file. Update environment-dev.yml Update environment-dev.yml
Co-authored-by: Davide Marchegiani <[email protected]>
Co-authored-by: Davide Marchegiani <[email protected]>
Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Co-authored-by: Davide Marchegiani <[email protected]>
Co-authored-by: Davide Marchegiani <[email protected]>
Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Co-authored-by: Davide Marchegiani <[email protected]>
Co-authored-by: Davide Marchegiani <[email protected]>
Co-authored-by: Davide Marchegiani <[email protected]> Update src/perturbIC.py Co-authored-by: Davide Marchegiani <[email protected]>
Update to unit tests Update perturbIC.py
It was failing dues to hypothesis.errors.InvalidArgument:
Co-authored-by: Davide Marchegiani <[email protected]>
fce0537
to
c83b74e
Compare
Update perturbIC.py
c83b74e
to
e8a0be2
Compare
Thank you so much for the work on this @leoberhelman! |
This is a draft of a pull request to keep track of comments and questions I will have during refactoring and testing. Nothing yet but I am creating my unit tests.