Skip to content

Improve module ceofficient generator error reporting#802

Merged
cpaulgilman merged 2 commits into
patchfrom
sixparsolve-error-reporting
Apr 21, 2022
Merged

Improve module ceofficient generator error reporting#802
cpaulgilman merged 2 commits into
patchfrom
sixparsolve-error-reporting

Conversation

@cpaulgilman

Copy link
Copy Markdown
Collaborator

This PR replaces the generic error message for cmod_6parsolve "could not solve, check inputs" with more informative error messages based on the sanity check performed on the inputs here: https://github.com/NREL/ssc/blob/5ec04426cdfc4f83c397feb7c1ef66753ab9a70e/shared/6par_solve.h#L307.

Addresses NatLabRockies/SAM#17

To test, create a Detailed PV / No Financial case, choose the "CEC Performance Model with User Entered Specifications" option on the Module page, try different unrealistic values for the input parameters, and click Calculate and plot.

Alternatively, build SDKtool and try modifying parameter values in the attached LK script for SDKtool:
coeffgen6par_sdktool.zip

@cpaulgilman cpaulgilman added this to the 2021.12.02 Patch 2 milestone Apr 20, 2022
@cpaulgilman cpaulgilman requested a review from sjanzou April 20, 2022 15:37
@cpaulgilman cpaulgilman self-assigned this Apr 20, 2022

@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.

Looks good and much more information!

Comment thread ssc/cmod_6parsolve.cpp
"max_slope(0.015 * Voc 0.98 * Voc) > 0" };
if (err < 0)
throw general_error("could not solve, check inputs");
throw general_error("Could not solve, sanity check failed (" + std::to_string(err) + "): " + err_values[x] );

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.

Looks good, and fits into our "standard" error handling

@cpaulgilman cpaulgilman merged commit 839cfbe into patch Apr 21, 2022
@cpaulgilman cpaulgilman deleted the sixparsolve-error-reporting branch April 21, 2022 20:51
@cpaulgilman cpaulgilman restored the sixparsolve-error-reporting branch May 29, 2022 20:07
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.

2 participants