Remove any hardcoded reference to "month", "day" and "hour"#381
Merged
Remove any hardcoded reference to "month", "day" and "hour"#381
Conversation
This reverts commit ceee06e.
This was referenced Jul 1, 2024
dalonsoa
approved these changes
Jul 3, 2024
Collaborator
dalonsoa
left a comment
There was a problem hiding this comment.
The changes look totally sensible so I'm happy to move on with this one and marking the test as xfail if you're sure that the test is failing because it is not correctly setup and not because the changes to the functions you have made have broken the execution pipeline.
So we don't forget, also open an issue about it, assign it to me and add it to this iteration.
alexdewar
approved these changes
Jul 3, 2024
src/muse/outputs/mca.py
Outdated
| data_sector.append(a[a["consumption"] != 0]) | ||
|
|
||
| if len(data_sector) > 0: | ||
| output = pd.concat([u for u in data_sector], sort=True).reset_index() |
Collaborator
There was a problem hiding this comment.
Does this need to be a generator expression?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #381 +/- ##
===========================================
- Coverage 71.37% 71.36% -0.01%
===========================================
Files 44 44
Lines 5928 5916 -12
Branches 1169 1162 -7
===========================================
- Hits 4231 4222 -9
+ Misses 1374 1371 -3
Partials 323 323 ☔ View full report in Codecov by Sentry. |
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
After #392, there are still a couple of places in the code that referenced "month", "day" and "hour" by name, which could cause problems if the level names were changed from the default (which is possible to in the settings file). This started off as a PR to remove all of these hardcoded references, but this ended up having a few other implications, so this PR now addresses a few things.
Specific changes:
scipy_match_demandininvestments.py. This was easy to fix as it was just dropping the "month", "day" and "hour" columns needlessly, so I just removed this.sector_supplyandsector_consumptioninmca.pywhich prepare a couple of output files. I found a workaround to do a similar thing without referring to "month", "day" and "hour" by name, and in the process slightly modified the output files (for the better, I think).This second change then allowed
test_minimum_serviceto start actually testing something (see #382), but the test was failing because it was testing the wrong thing. So I fixed the test so it's now testing the right thing, although the test is still failing, presumably because the supply data that it's using is wrong (see #321, #335 and #368). So not sure what to do now. @dalonsoa If we're planning on fixing the broken supply output, are you happy for me to mark this test as xfail for now so we can merge this?Fixes #363
Fixes #382
Type of change
Please add a line in the relevant section of
CHANGELOG.md to
document the change (include PR #) - note reverse order of PR #s.
Key checklist
$ python -m pytest$ python -m sphinx -b html docs docs/buildFurther checks