Skip to content

Improve error handling for forecast price signals object#1288

Merged
brtietz merged 2 commits into
patchfrom
ssc_1285_report_fps_errors
Mar 5, 2025
Merged

Improve error handling for forecast price signals object#1288
brtietz merged 2 commits into
patchfrom
ssc_1285_report_fps_errors

Conversation

@brtietz

@brtietz brtietz commented Feb 28, 2025

Copy link
Copy Markdown
Collaborator

Handle previously unhanded error reports from the forecast price signal object. Now throws an exec error instead of crashing.

This is not testable with the GUI, only SDK, PySAM, or gtest. I can provide PySAM code to reproduce if desired, otherwise the new tests are likely sufficient.

@brtietz brtietz added this to the 2024 Release Patch 1 milestone Feb 28, 2025
@brtietz brtietz requested review from dguittet and sjanzou February 28, 2025 18:05
@sjanzou

sjanzou commented Mar 2, 2025

Copy link
Copy Markdown
Collaborator

Handle previously unhanded error reports from the forecast price signal object. Now throws an exec error instead of crashing.

This is not testable with the GUI, only SDK, PySAM, or gtest. I can provide PySAM code to reproduce if desired, otherwise the new tests are likely sufficient.

The changes look good... Could you please provide the pysam test script? Thanks!

@brtietz

brtietz commented Mar 3, 2025

Copy link
Copy Markdown
Collaborator Author

Please download: BatteryMerchantPlantPricingTest.zip for a PySAM script that causes the error. In PySAM 6.0.1 this crashes with no output. On this branch it should produce an error about matrix dimensions.

Note that the MerchantPlant can use the inputs in this format, so I'm open to an alternative solution that brings those matrix transformations to bear (but think this error handling code is helpful regardless)

@sjanzou sjanzou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, the message is much better than the no message before ;-)
image

Should the BatteryMerchantPlantPricingTest.py (or something to trigger the message) be added to the pysam tests? Should this be tied or referenced to the pysam repo?

Comment thread test/ssc_test/cmod_battery_test.cpp Outdated
}

/// Test standalone battery compute modeule with a input lifetime generation and merchant plant prices
TEST_F(CMBattery_cmod_battery_fom, MerchantPlantLifetimeAutomatic) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was lifetime model crucial to the case being fixed here?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If so, can it be set to 2 instead of 25? For shorter tests

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. I converted the test to a single year.

@dguittet dguittet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brtietz brtietz merged commit 31d4a54 into patch Mar 5, 2025
@brtietz brtietz modified the milestones: 2024 Release Patch 1, SAM Spring 2025 Release Mar 7, 2025
@brtietz brtietz linked an issue Mar 7, 2025 that may be closed by this pull request
@brtietz brtietz deleted the ssc_1285_report_fps_errors branch April 18, 2025 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Forecast Price Series Errors are not caught

4 participants