[WIP] SAM-EM MCY Levelized Metrics Update#130
Closed
softwareengineerprogrammer wants to merge 10 commits intouser-provided-reservoir-output-profile-2from
Closed
[WIP] SAM-EM MCY Levelized Metrics Update#130softwareengineerprogrammer wants to merge 10 commits intouser-provided-reservoir-output-profile-2from
softwareengineerprogrammer wants to merge 10 commits intouser-provided-reservoir-output-profile-2from
Conversation
…SAM+Economic+Models+do+not+calculate+carbon+revenue in SAM-EM Limitations section
…preparation to add backfilled PV/LCOE rows
|
|
||
| 1. Only Electricity end-use is supported | ||
| 2. Add-ons with electricity and heat are not currently supported. (Add-ons CAPEX, OPEX, and profit are supported.) | ||
| 3. Carbon Revenue is not currently supported, but will be in future releases. See [tracking issue](https://github.com/NatLabRockies/GEOPHIRES-X/issues/458?title=SAM+Economic+Models+do+not+calculate+carbon+revenue) for details. |
Owner
Author
There was a problem hiding this comment.
Ignore this change, it's incorrectly shown as belonging to this PR due to cherry-picking
Comment on lines
-326
to
+359
| with self.assertLogs(level='INFO') as logs: | ||
| _del_metadata( | ||
| GeophiresXClient().get_geophires_result( | ||
| GeophiresInputParameters( | ||
| from_file_path=self._get_test_file_path('../examples/example5b.txt'), | ||
| params={ | ||
| 'Reservoir Output Profile': ','.join( | ||
| [str(it) for it in [30 * v for v in [*([10] * 7), 9, 8, 7]]] | ||
| ) | ||
| }, | ||
| try: | ||
| with self.assertLogs(level='INFO') as logs: | ||
| _del_metadata( | ||
| GeophiresXClient().get_geophires_result( | ||
| GeophiresInputParameters( | ||
| from_file_path=self._get_test_file_path('../examples/example5b.txt'), | ||
| params={ | ||
| 'Reservoir Output Profile': ','.join( | ||
| [str(it) for it in [30 * v for v in [*([10] * 7), 9, 8, 7]]] | ||
| ) | ||
| }, | ||
| ) | ||
| ) | ||
| ) | ||
| ) | ||
|
|
||
| self.assertHasLogRecordWithMessage( | ||
| logs, 'Reservoir temperature extrapolation result', treat_substring_match_as_match=True | ||
| ) | ||
| self.assertHasLogRecordWithMessage( | ||
| logs, 'Reservoir temperature extrapolation result', treat_substring_match_as_match=True | ||
| ) | ||
|
|
||
| self.assertHasLogRecordWithMessage( | ||
| logs, | ||
| # TODO make this less hard-coded | ||
| '[207.73, 177.48, 147.23, 116.97, 86.72, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, ' | ||
| '80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, ' | ||
| '80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, ' | ||
| '80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, ' | ||
| '80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, ' | ||
| '80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, ' | ||
| '80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, ' | ||
| '80.0, 80.0]', | ||
| treat_substring_match_as_match=True, | ||
| ) | ||
| self.assertHasLogRecordWithMessage( | ||
| logs, | ||
| # TODO make this less hard-coded | ||
| '[207.73, 177.48, 147.23, 116.97, 86.72, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, ' | ||
| '80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, ' | ||
| '80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, ' | ||
| '80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, ' | ||
| '80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, ' | ||
| '80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, ' | ||
| '80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, 80.0, ' | ||
| '80.0, 80.0]', | ||
| treat_substring_match_as_match=True, | ||
| ) | ||
| except AssertionError as ae: | ||
| self._handle_assert_logs_failure(ae) |
Owner
Author
There was a problem hiding this comment.
Ignore this change, it's incorrectly shown as belonging to this PR due to cherry-picking
2 tasks
Comment on lines
-1140
to
-1150
|
|
||
| def _handle_assert_logs_failure(self, ae: AssertionError): | ||
| if sys.version_info[:2] == (3, 8) and self._is_github_actions(): | ||
| # FIXME - see | ||
| # https://github.com/softwareengineerprogrammer/GEOPHIRES/actions/runs/19646240874/job/56262028512#step:5:344 | ||
| _log.warning( | ||
| f'WARNING: Skipping logs assertion in GitHub Actions ' | ||
| f'for Python {sys.version_info.major}.{sys.version_info.minor}' | ||
| ) | ||
| else: | ||
| raise ae |
Owner
Author
There was a problem hiding this comment.
Ignore this change, it's incorrectly shown as belonging to this PR due to cherry-picking
Comment on lines
+127
to
138
| def _handle_assert_logs_failure(self, ae: AssertionError): | ||
| if sys.version_info[:2] == (3, 8) and self._is_github_actions(): | ||
| # FIXME - see | ||
| # https://github.com/softwareengineerprogrammer/GEOPHIRES/actions/runs/19646240874/job/56262028512#step:5:344 | ||
| print( | ||
| f'WARNING: Skipping logs assertion in GitHub Actions ' | ||
| f'for Python {sys.version_info.major}.{sys.version_info.minor}' | ||
| ) | ||
| else: | ||
| raise ae | ||
|
|
||
| @staticmethod |
Owner
Author
There was a problem hiding this comment.
Ignore this change, it's incorrectly shown as belonging to this PR due to cherry-picking
| self.assertIn(str(msg_type_error), '(you may have meant to pass percent=10)') | ||
|
|
||
| with self.assertLogs(level='INFO') as logs: | ||
| with self.assertLogs('tests.base_test_case', level='INFO') as logs: |
Owner
Author
There was a problem hiding this comment.
Ignore this change, it's incorrectly shown as belonging to this PR due to cherry-picking
23 tasks
Owner
Author
|
Rebased and moved to #132 |
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
Addresses NatLabRockies#444 (comment)
Demonstrations of backfill calculations:
https://gist.github.com/softwareengineerprogrammer/64bffe886046ccf70b2871369dcb14e9#file-sam-em-mcy-levelized-metrics_2026-01-26-2_separate-backfilled-rows-csv-L112:
https://gist.github.com/softwareengineerprogrammer/6e54cdf9cc9456790b01695027353855#file-sam-em-mcy-levelized-metrics_2026-01-26-2_native-backfilled-rows-csv-L112
TODO
Testing & Verification
Change Checklist:
Observe the following checklist items if your change includes a new version (see versioning notes and version management docs).
Before merging:
After merging:
git push origin refs/tags/vM.m.PAdditional metadata such as TODO items or link to your initial self-review (PR into your own fork created prior to submission)