-
Notifications
You must be signed in to change notification settings - Fork 2
TSM tests are all passing! #58
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
TSM tests are all passing! #58
Conversation
Mismatch with QA/QC Excel sheet (which is verified with HEC-RAS)
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #58 +/- ##
==========================================
+ Coverage 38.41% 38.53% +0.11%
==========================================
Files 33 33
Lines 1161 1160 -1
==========================================
+ Hits 446 447 +1
+ Misses 715 713 -2 ☔ View full report in Codecov by Sentry. |
aufdenkampe
left a 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.
@xaviernogueira, this looks good.
Thanks for your clear explanation of the the two approaches considered to model testing (i.e. comparing to RAS-1D-WQ outputs), and your reasons for selecting the pattern that aligns with your existing pytests. That makes sense to me.
|
@xaviernogueira, with this PR, I think it's time to issue a release! Let's title it: "v0.2.0: OOP refactor; TSM fully functional" or something like that. |
|
Update: As you can see, none fail that bad. I am going to investigate where the math isn't adding up, but things are looking good. Still to do:
|
|
Debug progress: I fixed all failing tests except 1 which is "changed_wind_b". I am looking into this one, but I suspect it has something to do with the float precision, as wind_b is by default 1.5e-6 and in the That said, according to https://en.wikipedia.org/wiki/Double-precision_floating-point_format, float64 should have precision to the e-15. I am going to see if I can adjust the wind function or the test to get it to pass. |
|
Does it work when you set wind_a = .3 and wind_b = 1.5? I believe these values should be on the order of 10^-7 and 10^-6 respectively... so the parameter entry should be in the above suggested range if the code includes the divide by 1000000, or should be entered as 310^-7 and 1.510^-6. |
|
@imscw95 yes it works fine normally it just doesn't get the right answer when it wind_b changes. |
|
So I think I figured it out. In the excel there was no division factor, and I realized that you changed multiple wind variables in the "Change win_b" columns when compared to the inputs on the far left. I simply changed the test to switch wind_b with 1.0, and opposed to 1.0e-6. All tests pass |
Closes #20
Changes:
WIP - Next Steps:
Discussion of an alternative approach: @aufdenkampe we talked about solving all tests at once using an extra
xarray.Datasetdimension. While in a notebook environment, I would agree this is the best way to verify calculations, inpytestyou would need to make a fixture of the masterxarray.Dataset, alter along using hardcoded values, then read slices of that intoEnergyBudget(hotstart_dataset=dataset)which is the non-default pattern. Then in unique functions for each check, you would have your assert statements, as inpytestyou want unique functions per test for helpful feedback and to avoid early exceptions. I decided to not pursue this because: