Skip to content

Cambium update to 2022#1365

Merged
cpaulgilman merged 11 commits into
patchfrom
cambium-update-to-2022
Mar 9, 2023
Merged

Cambium update to 2022#1365
cpaulgilman merged 11 commits into
patchfrom
cambium-update-to-2022

Conversation

@cpaulgilman

@cpaulgilman cpaulgilman commented Mar 2, 2023

Copy link
Copy Markdown
Collaborator

Pull Request Template

Description

Fixes #1104 and #1098

Updates Cambium downloads to Cambium 2022 and makes it easier to update in the future.

Add escalation rate for multiple year option, and support Cambium years in any interval (Cambium 2020 was even years, Cambium 2022 is even years 2024-2030 and then every five years 2030-2050).

Adds macro and button for PPA models to download cambium pricing data: See Revenue page for Single Owner model and Time of Delivery page for others.

Updates sample script for Cambium downloads.

Fixes Merchant plant layout for Mac and Linux.

Includes Help revisions.

To test in Merchant Plant:

  • Download single year
  • Download multiple years, varying the start year
  • Set escalation rate for multiple years and verify prices in out years are correct
  • Review UI text, tooltips and Help description

To test in PPA models:

  • Try download button on Revenue page (single owner) Time of Delivery Factors page (other models)

Type of change

  • 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

* Update URL in webapis.conf.

* On UI form, read UUID from URL in webapis.conf instead of hard coding it. Future updates should only require updating the URL in webapis.conf.

* Revise tooltip descriptions to be Cambium version agnositc.

* Fix UI group box sizes so Merchant Plant Revenue page are all same size.
* Update sample script to Cambium 2020.

* Update sample script to work for all PPA models, including Host Developer.
* Create macro based on sample script and add button to Revenue or Time of Delivery input page for all PPA models.
@cpaulgilman cpaulgilman added this to the 2022.11.21 Patch 2 milestone Mar 2, 2023
@cpaulgilman cpaulgilman requested a review from brtietz March 2, 2023 23:17
@cpaulgilman cpaulgilman self-assigned this Mar 2, 2023
@cpaulgilman cpaulgilman removed the request for review from brtietz March 3, 2023 16:43
* Add optional escalation rate input and update defaults
* Support non-monotonic available years from Cambium (Cambium 2020 years were even years, Cambium 2022 varies)
* Update Help
* Update UI descriptions and tooltips
@cpaulgilman cpaulgilman requested review from brtietz and sjanzou March 4, 2023 20:14

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

Added SAM-private pull request 87 to go along with this pull request to update webapis.conf in SAM-private to prevent a hard crash.

Results with escalation seem a little weird in year 22 of the attached file with spreadsheet with corrected timestamps.... Maybe Cambium data has some weird values in 2045?
image

SAM_1365.zip

@cpaulgilman

Copy link
Copy Markdown
Collaborator Author

@sjanzou Thanks -- I fixed a mistake in applying the escalation rate to years copied from previous available cambium years.

Here is a detailed Excel spreadsheet that replicates copying previous years and escalation calculations.

cambium-test.zip

@brtietz

brtietz commented Mar 6, 2023

Copy link
Copy Markdown
Collaborator

Unfortunately, even after Steve's fix, PVWatts-Merchant Plant still crashes for me when I click on the "revenue" tab (I have cambium-update-to-2022 checked out on SAM and sam-private). The debugger has an opaque compliant about a read access violation and an lk:error_t.

@cpaulgilman

Copy link
Copy Markdown
Collaborator Author

@brtietz SAM-private worked for me. I reran cmake and did a clean build to make sure all of the files were copied over from SAM.

@brtietz

brtietz commented Mar 7, 2023

Copy link
Copy Markdown
Collaborator

@brtietz SAM-private worked for me. I reran cmake and did a clean build to make sure all of the files were copied over from SAM.

Ah, thanks. Doing a clean build fixed the crash. I'll do a deeper review tomorrow.

@sjanzou sjanzou self-requested a review March 7, 2023 07:03

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

Cashflow looks much better - thanks for updating
image

@brtietz

brtietz commented Mar 7, 2023

Copy link
Copy Markdown
Collaborator

Thanks, this is some great functionality!

My one comment is it's not clear to me why the escalation rate would only be available for multi-year downloads for the merchant plant. Since single year data repeats for the lifetime, I would (and I imagine other users would as well) really like to be able to escalate single year data at the same rate as inflation. This would also more closely match the capabilities of the PPA models. Was there a reason that feature was disabled by default?

@cpaulgilman

Copy link
Copy Markdown
Collaborator Author

@brtietz Oh, right! I guess I got caught up in the excitement of the multi-year implementation. Escalation is enabled for both single-year and multi-year downloads and Help revised accordingly as of my last commits.

@cpaulgilman cpaulgilman requested review from brtietz and removed request for brtietz March 8, 2023 22:56
@cpaulgilman cpaulgilman merged commit 7c66b53 into patch Mar 9, 2023
cpaulgilman added a commit that referenced this pull request Mar 17, 2023
* Cambium update to 2022 (#1365)

* Update to Cambium 2022

* Update URL in webapis.conf.

* On UI form, read UUID from URL in webapis.conf instead of hard coding it. Future updates should only require updating the URL in webapis.conf.

* Revise tooltip descriptions to be Cambium version agnositc.

* Fix UI group box sizes so Merchant Plant Revenue page are all same size.

* Cambium sample script

* Update sample script to Cambium 2020.

* Update sample script to work for all PPA models, including Host Developer.

* Cambium macro button for PPA models

* Create macro based on sample script and add button to Revenue or Time of Delivery input page for all PPA models.

* Help revisions for Cambium 2022

* UI adjustments for Mac/Linux

* Update multiple year downloads for Cambium 2022

* Add optional escalation rate input and update defaults
* Support non-monotonic available years from Cambium (Cambium 2020 years were even years, Cambium 2022 varies)
* Update Help
* Update UI descriptions and tooltips

* Fix application of cambium escalation for copied data

* Fix cambium progress bar text

* Allow escalation for single-year download

* Help updates for cambium single-year escalation

* Fix input number format

* WIND Toolkit downloads use wtk-download API endpoint (#1374)

* Migrate from wtk-srw-download to wtk-download

* Adds option to download subhourly wind resource data

* Fix intervals list

* Clean up WIND Toolkit download messages

* Fix string declarations and typo
cpaulgilman added a commit that referenced this pull request Mar 23, 2023
* Cambium update to 2022 (#1365)

* Update to Cambium 2022

* Update URL in webapis.conf.

* On UI form, read UUID from URL in webapis.conf instead of hard coding it. Future updates should only require updating the URL in webapis.conf.

* Revise tooltip descriptions to be Cambium version agnositc.

* Fix UI group box sizes so Merchant Plant Revenue page are all same size.

* Cambium sample script

* Update sample script to Cambium 2020.

* Update sample script to work for all PPA models, including Host Developer.

* Cambium macro button for PPA models

* Create macro based on sample script and add button to Revenue or Time of Delivery input page for all PPA models.

* Help revisions for Cambium 2022

* UI adjustments for Mac/Linux

* Update multiple year downloads for Cambium 2022

* Add optional escalation rate input and update defaults
* Support non-monotonic available years from Cambium (Cambium 2020 years were even years, Cambium 2022 varies)
* Update Help
* Update UI descriptions and tooltips

* Fix application of cambium escalation for copied data

* Fix cambium progress bar text

* Allow escalation for single-year download

* Help updates for cambium single-year escalation

* Fix input number format

* WIND Toolkit downloads use wtk-download API endpoint (#1374)

* Migrate from wtk-srw-download to wtk-download

* Adds option to download subhourly wind resource data

* Fix intervals list

* Clean up WIND Toolkit download messages

* Fix string declarations and typo

* Move geocoding URLs to webapis.conf

Update SAM CMakeLists.txt for new geotools.cpp

New URLs in webapis.conf file for geocoding, static map, and time zone APIs.

New URL in webapis.conf for calls to URDB wiki (for consistency, not related to geocoding)

Move geocoding functions from WEX to new geotools.cpp file.

Move LK `geocode()` from WEX to SAM so it can access SAM API keys.

Define variables for Bing, Google, and special NREL Geocode API keys so that they can be managed in teh same way as SAM API key.

Add new `user_email` variable so that open source versions of SAM can use NREL developer APIs that require an email parameter.

Rename `GeoCodeDeveloper()` to `GeocodeDeveloper()`;

Remove `SetApiKeys()` function, which is only required to make geocoding API keys available in WEX.
cpaulgilman added a commit that referenced this pull request Apr 14, 2023
* Cambium update to 2022 (#1365)

* Update to Cambium 2022

* Update URL in webapis.conf.

* On UI form, read UUID from URL in webapis.conf instead of hard coding it. Future updates should only require updating the URL in webapis.conf.

* Revise tooltip descriptions to be Cambium version agnositc.

* Fix UI group box sizes so Merchant Plant Revenue page are all same size.

* Cambium sample script

* Update sample script to Cambium 2020.

* Update sample script to work for all PPA models, including Host Developer.

* Cambium macro button for PPA models

* Create macro based on sample script and add button to Revenue or Time of Delivery input page for all PPA models.

* Help revisions for Cambium 2022

* UI adjustments for Mac/Linux

* Update multiple year downloads for Cambium 2022

* Add optional escalation rate input and update defaults
* Support non-monotonic available years from Cambium (Cambium 2020 years were even years, Cambium 2022 varies)
* Update Help
* Update UI descriptions and tooltips

* Fix application of cambium escalation for copied data

* Fix cambium progress bar text

* Allow escalation for single-year download

* Help updates for cambium single-year escalation

* Fix input number format

* WIND Toolkit downloads use wtk-download API endpoint (#1374)

* Migrate from wtk-srw-download to wtk-download

* Adds option to download subhourly wind resource data

* Fix intervals list

* Clean up WIND Toolkit download messages

* Fix string declarations and typo

* Move geocoding URLs to webapis.conf

Update SAM CMakeLists.txt for new geotools.cpp

New URLs in webapis.conf file for geocoding, static map, and time zone APIs.

New URL in webapis.conf for calls to URDB wiki (for consistency, not related to geocoding)

Move geocoding functions from WEX to new geotools.cpp file.

Move LK `geocode()` from WEX to SAM so it can access SAM API keys.

Define variables for Bing, Google, and special NREL Geocode API keys so that they can be managed in teh same way as SAM API key.

Add new `user_email` variable so that open source versions of SAM can use NREL developer APIs that require an email parameter.

Rename `GeoCodeDeveloper()` to `GeocodeDeveloper()`;

Remove `SetApiKeys()` function, which is only required to make geocoding API keys available in WEX.

* Replace remaning hard-coded urls with calls to SamApp::WebApi()

* Update test results for NatLabRockies/ssc#1010
@cpaulgilman cpaulgilman added the added to release notes PR and/or issue has been added to release notes for a public release label May 30, 2023
@cpaulgilman cpaulgilman deleted the cambium-update-to-2022 branch October 3, 2023 16:55
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link to 2021 Cambium Data

3 participants