Skip to content
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

Fix JSON Read Issues for URDB Downloads #1862

Merged
merged 5 commits into from
Oct 4, 2024

Conversation

cpaulgilman
Copy link
Collaborator

Pull Request Template

Description

Use IsNumber() in place of IsDouble() to check numeric values from URDB JSON because tier max values are stored as integers, not doubles.

Use UTF16 instead of UTF8 to fix problem reading some URDB JSON in Windows.

Add RapidJSON error codes to error messages to help with future troubleshooting.

Fixes #1848

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • This change modifies variables in existing compute modules. Please see Checking for PySAM Incompatible API Changes.

Checklist:

If you have added a new compute module in a SSC pull request related to this one, be sure to check the Process Requirements.

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

cpaulgilman and others added 4 commits October 1, 2024 15:15
In some cases for URDB data, e.g., energy charge tier max value, JSON stores an integer for a value that SAM requires to be double. IsNumber() allows integers to be read in and then be converted to double.

Also changing this for geotools so that integer values of lat/lon are read in from JSON as valid values.
@cpaulgilman cpaulgilman added bug UI User interface issue that applies across performance and financial models labels Oct 3, 2024
@cpaulgilman cpaulgilman added this to the SAM Fall 2024 Release milestone Oct 3, 2024
@cpaulgilman cpaulgilman self-assigned this Oct 3, 2024
Copy link
Collaborator

@sjanzou sjanzou left a comment

Choose a reason for hiding this comment

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

Thanks for finding and fixing the issues!

src/urdb.cpp Show resolved Hide resolved
src/geotools.cpp Show resolved Hide resolved
@cpaulgilman cpaulgilman merged commit 0625be8 into develop Oct 4, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug UI User interface issue that applies across performance and financial models
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Georgia Power PLL-11 Rate does not download tiers properly from URDB
2 participants