-
Notifications
You must be signed in to change notification settings - Fork 3
Adding by_charge_key argument to calculate_itemized_cost, and some bug fixes #51
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
b9d0cb4
Adding optional by_charge_key argument to calculate_itemized_cost.py …
dalyw d7a302f
Adding tests for by_charge_key
dalyw 3254fe3
Removing unneeded type check in test_calculate_itemized_cost_pyo
dalyw c2c2244
Adding test coverage for reformatted emissions.py line, when emission…
dalyw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| datetime_local,co2_eq_kg_per_MWh | ||
| 2024-07-31 00:00:00,395.532224 | ||
| 2024-07-31 01:00:00,415.03668 | ||
| 2024-07-31 02:00:00,424.10852 | ||
| 2024-07-31 03:00:00,427.737256 | ||
| 2024-07-31 04:00:00,425.015704 | ||
| 2024-07-31 05:00:00,410.50076 | ||
| 2024-07-31 06:00:00,393.264264 | ||
| 2024-07-31 07:00:00,366.955928 | ||
| 2024-07-31 08:00:00,355.616128 | ||
| 2024-07-31 09:00:00,351.987392 | ||
| 2024-07-31 10:00:00,350.626616 | ||
| 2024-07-31 11:00:00,352.440984 | ||
| 2024-07-31 12:00:00,353.348168 | ||
| 2024-07-31 13:00:00,346.99788 | ||
| 2024-07-31 14:00:00,339.740408 | ||
| 2024-07-31 15:00:00,337.018856 | ||
| 2024-07-31 16:00:00,337.92604 | ||
| 2024-07-31 17:00:00,346.99788 | ||
| 2024-07-31 18:00:00,357.430496 | ||
| 2024-07-31 19:00:00,359.698456 | ||
| 2024-07-31 20:00:00,360.152048 | ||
| 2024-07-31 21:00:00,362.420008 | ||
| 2024-07-31 22:00:00,369.223888 | ||
| 2024-07-31 23:00:00,375.574176 | ||
| 2024-08-01 00:00:00,414.583088 | ||
| 2024-08-01 01:00:00,433.18036 | ||
| 2024-08-01 02:00:00,439.98424 | ||
| 2024-08-01 03:00:00,443.612976 | ||
| 2024-08-01 04:00:00,443.159384 | ||
| 2024-08-01 05:00:00,419.119008 | ||
| 2024-08-01 06:00:00,405.96484 | ||
| 2024-08-01 07:00:00,378.295728 | ||
| 2024-08-01 08:00:00,366.955928 | ||
| 2024-08-01 09:00:00,364.234376 | ||
| 2024-08-01 10:00:00,362.420008 | ||
| 2024-08-01 11:00:00,364.234376 | ||
| 2024-08-01 12:00:00,364.234376 | ||
| 2024-08-01 13:00:00,355.162536 | ||
| 2024-08-01 14:00:00,347.451472 | ||
| 2024-08-01 15:00:00,345.637104 | ||
| 2024-08-01 16:00:00,346.99788 | ||
| 2024-08-01 17:00:00,358.791272 | ||
| 2024-08-01 18:00:00,365.595152 | ||
| 2024-08-01 19:00:00,366.048744 | ||
| 2024-08-01 20:00:00,369.223888 | ||
| 2024-08-01 21:00:00,376.934952 | ||
| 2024-08-01 22:00:00,385.099608 | ||
| 2024-08-01 23:00:00,393.264264 | ||
| 2024-08-02 00:00:00,414.583088 |
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
What is the goal of copying this dictionary? Was there a bug that you found?
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 came up when running with pandas 3.0 from flows-mpc, which had the older billing format in tests.
It was raising a ChainedAssignmentError: https://pandas.pydata.org/docs/user_guide/copy_on_write.html#chained-assignment
Instead of making a copy, we could possibly use .loc (like the linked example) if modifying limit_charges directly instead of charge, but that would probably be more complicated.
I ended up changing the flows-mpc billing csvs to the new format so it's not actually hitting this code anymore. Think it's worth adding a test case for this "except" section?