-
Notifications
You must be signed in to change notification settings - Fork 85
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
Improved error codes for irradproc, solar_resource_data #1219
base: develop
Are you sure you want to change the base?
Conversation
errorcodes for irrad.calc, test on pvwattsv8
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.
@mjprilliman Thanks for tackling this. I'll look over and revise the text of the messages. I think the variable name "errorCode" is misleading. Not sure if it's worth the effort to change, but something like "error_message" would make it clearer that it's a text message and not a numeric code.
@mjprilliman I'm using PVWatts to test this in the SAM UI because it is the only model that calls irradproc's getErrorCode(). When I use this weather file with invalid time zone data, SAM crashes: |
Sorry Paul, there was an extra callout to code that was in the util::format call in pvwattsv8 that I had been using for troubleshooting. That meant it was trying to format a error code as a string, a string as a integer, and so on. The most recent push should fix that, and rename the errorCode references to errorMessage. |
@mjprilliman This is working now in PVWatts, thanks for the fix. I would like to be able to use formatted strings like this to include useful data in the error messages:
But this doesn't work because |
Paul, I tested it out and something like this should work:
Not a very elegant example but it reports out this: |
@mjprilliman |
-Fixes #973
-Add output errorcodes from irrad::check(), not just codes
-Add checks for solar_resource_data, including header information such as elev, lat, lon, tz
-Tested on pvwattsv8, feedback needed before propagating across irrad and solar_resource_data instances
@cpaulgilman review needed on language of error messages
@brtietz review needed on functionality