-
-
Notifications
You must be signed in to change notification settings - Fork 106
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 unit tests for allocate net gen #2297
Conversation
@cmgosnell I got the urge to clean these up a bit more. Take a look! We should probably do some more complicated asserts, and maybe test the other top-level function ( |
Codecov ReportBase: 86.0% // Head: 86.0% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## dev #2297 +/- ##
=====================================
Coverage 86.0% 86.0%
=====================================
Files 74 74
Lines 9273 9273
=====================================
+ Hits 7980 7981 +1
+ Misses 1293 1292 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
I might suggest setting the threshold lower than 5% or 7%. In theory, the allocated totals should exactly match the input totals, although in practice perhaps rounding errors might create slight differences. Maybe a stricter 1% (or 0.5%?) threshold would catch situations where the allocation is off while allowing some small tolerance for rounding? Or should we test that they exactly match? |
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.
these changes definitely make this easier to read and navigate! Appreciate the fixture - that should make it easier to test different things. We have a long way to go to make this module less 🐛y but hopefully this will be a good place to build from.
annual_2021 = 22_222.0 | ||
annual_2020 = 20_202.0 |
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.
this is great! good use of the "don't make the full output dataframe" methodology
@@ -1875,10 +1876,11 @@ def test_original_gf_vs_the_allocated_by_gens_gf( | |||
f"{data_col}: {off_by_5_perc:.1%} of allocated plant/year's are off by more" | |||
" than 5%" | |||
) | |||
if off_by_5_perc > 0.07: | |||
acceptance_threshold = 0.07 |
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.
👶🏻 thing but this is now an arg so you don't need it in here
It appears that they've found a bug in our allocation but I would like to get these tests committed before fixing the bug.
Stop forcing docstrings in tests.
7048f36
to
bc1b936
Compare
While talking about @grgmiller 's PR #2235, @cmgosnell and I decided to take a crack at testing the allocation behavior.
There's a few assertions that fail due to some bugs in our "allocating stuff that is missing in various places" code - I decided that fixing those bugs is out of scope of "get the tests working again."
TODO:
xfail
test yet