Skip to content

Update Cambium to 2023 and Handle Changes in API Response#1889

Merged
cpaulgilman merged 4 commits into
developfrom
sam-1786-cambium-downloads
Oct 25, 2024
Merged

Update Cambium to 2023 and Handle Changes in API Response#1889
cpaulgilman merged 4 commits into
developfrom
sam-1786-cambium-downloads

Conversation

@cpaulgilman

@cpaulgilman cpaulgilman commented Oct 24, 2024

Copy link
Copy Markdown
Collaborator

Description

Goes with https://github.com/NREL/SAM-private/pull/113

"Cambium API Parameters" inputs on the Revenue page for Merchant Plant configurations uses list boxes to display options for downloading price data from Cambium API. These options are populated by downloading metadata from the API (in a step before downloading the actual price data). The metadata API has changed over time, so old SAM files may have options that are no longer available, which causes the API to return an error when the user clicks the Download button, preventing Cambium downloads from working.

This PR modifes the Cambium download UI callback script to compare the inputs in SAM with the latest API metadata, and refreshes the SAM inputs if the metadata is different from the inputs It also displays messages notifying the user of which inputs need to be updated.

See #1786.

To test:

  1. Download the .sam file from the forum post originally reporting this issue: https://sam.nrel.gov/forum/attachment/2016?download=1
  2. Open the file, and go to the Revenue page for any of the cases with a Merchant Plant configuration.
  3. Click Download to Energy Market.

SAM should prompt you to update the metadata and then download price data without an API error.

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 cpaulgilman added bug financial Financial model UI User interface issue that applies across performance and financial models labels Oct 24, 2024
@cpaulgilman cpaulgilman added this to the SAM Fall 2024 Release milestone Oct 24, 2024
@cpaulgilman cpaulgilman self-assigned this Oct 24, 2024

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

This works great! Very clear error messages. I also tested it with the 2022->2023 cambium version, and it correctly updates to the new ISO regions (not states)

Do you want to update the url in webaips.conf in this PR or later? The 2023 API is https://scenarioviewer.nrel.gov/api/project/detail/?uuid=0f92fe57-3365-428a-8fe8-0afc326b3b43

@cpaulgilman

Copy link
Copy Markdown
Collaborator Author

Do you want to update the url in webaips.conf in this PR or later? The 2023 API is https://scenarioviewer.nrel.gov/api/project/detail/?uuid=0f92fe57-3365-428a-8fe8-0afc326b3b43

Yes. I'll do that. I was looking for that UUID -- where did you find it?

@brtietz

brtietz commented Oct 24, 2024

Copy link
Copy Markdown
Collaborator

Do you want to update the url in webaips.conf in this PR or later? The 2023 API is https://scenarioviewer.nrel.gov/api/project/detail/?uuid=0f92fe57-3365-428a-8fe8-0afc326b3b43

Yes. I'll do that. I was looking for that UUID -- where did you find it?

Luckily, the UUID in API is the same as the project field in the GUI from https://scenarioviewer.nrel.gov/

@cpaulgilman

Copy link
Copy Markdown
Collaborator Author

Do you want to update the url in webaips.conf in this PR or later? The 2023 API is https://scenarioviewer.nrel.gov/api/project/detail/?uuid=0f92fe57-3365-428a-8fe8-0afc326b3b43

Yes. I'll do that. I was looking for that UUID -- where did you find it?

Luckily, the UUID in API is the same as the project field in the GUI from https://scenarioviewer.nrel.gov/

Ah! Nice find. Thanks.

@cpaulgilman cpaulgilman changed the title Sam 1786 cambium downloads Update Cambium to 2023 and Handle Changes in API Response Oct 24, 2024
@cpaulgilman cpaulgilman merged commit e238790 into develop Oct 25, 2024
@cpaulgilman cpaulgilman deleted the sam-1786-cambium-downloads branch October 25, 2024 01:59
@cpaulgilman cpaulgilman added the added to release notes PR and/or issue has been added to release notes for a public release label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

added to release notes PR and/or issue has been added to release notes for a public release bug financial Financial model UI User interface issue that applies across performance and financial models

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Out-of-date Cambium metadata variable prevents downloads from working

2 participants