-
Notifications
You must be signed in to change notification settings - Fork 1
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
Algae Module Tests #78
Conversation
DOX_ApGrowth, DOX_AbGrowth, and use_Balgae
updates "NaN" to np.nan, reverse condlist/choicelist, np.exp
13 passing tests
…ime_dim error and other processes issues with math.isnan and min.
Hi @kewalak and @imscw95, I should be able to take a look at this tomorrow. In the meantime, wanted to flag that I added the timestep variable in the init as part of #77 to help with performance improvement. You just need to initialize the model with argument of |
Ah thank you that solves the issue that I created for myself - setting that equal to 1 and trying to run multiple increment timesteps. |
Corrected all the syntax issues with the np.select. When I comment out the |
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.
Hi @kewalak, this looks great overall -- thanks for all the work you put into this. A lot of new variables and processes! Key things we should either address here or as part of future PRs:
- Some items on formatting / style:
- Recommend using flake8 (
flake8 \path\to\file\filename.py
on any.py
files to help identify stylistic updates to code to help increase general consistency and readability - Variable naming: tagged you in this question @aufdenkampe, but thinking we should try to more consistently name variables and processes with lower cases and underscores (see pep8). I think this could be a separate issue / MR though.
- Recommend using flake8 (
- Processes that include a time component: we need to think through how this is going to get handled if we have variable (user-defined) model timesteps. Tagged you in some of these comments @aufdenkampe -- is this a concern?
- Fix to
test_6_nsm1_timestep
: the updateable static variable provided (a10
) is not a static variable identified by the model. We either need to add it if it should be in the model, or use a different static variable. - I'd appreciate review from others on the
test_7_nsm_algae_calculations.py
since I don't feel super familiar with the process we're using to test these calculations.
@sjordan29 It looks like a lot of changes in this PR came from me making edits in the processes files for the different state variables. I used those state variable-specific processes.py files to populate the nsm1\processes.py file, but have since been updating only that main processes.py file as I've tried to run the tests that @kewalak created, and have pushed commits to this branch mid-PR as I've found the syntax fixes that allow the tests to run. I apologize if that's not good coding etiquette as I think that's made things confusing. My main point is, I think a lot of the issues you point out in the sub-state variable processes.py files are fixed in the nsm1\processes.py file. |
Thanks for pointing that out @imscw95- I'll go through and resolve all comments that appear to have been fixed! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #78 +/- ##
===========================================
+ Coverage 42.86% 80.61% +37.74%
===========================================
Files 24 27 +3
Lines 1185 1842 +657
===========================================
+ Hits 508 1485 +977
+ Misses 677 357 -320 ☔ View full report in Codecov by Sentry. |
All tests pass! Everything has either been addressed or moved to new issues. @imscw95, do you want to do any additional review or shall we merge this to main? |
Amazing. New further reviews from me. |
32 passing tests for the algae module (test_7_nsm_algae_calculations.py). File test_6_nsm_module.py has one failing test using the increment_timestep() that I have not figured out. Attached is the excel workbook I used to create the test cases. All scenario outputs from the excel book I checked against the RAS WQ outputs.
Manual Calculations for Algae.xlsx