Skip to content

Move geocode#1387

Merged
cpaulgilman merged 8 commits into
developfrom
move-geocode
Apr 14, 2023
Merged

Move geocode#1387
cpaulgilman merged 8 commits into
developfrom
move-geocode

Conversation

@cpaulgilman

@cpaulgilman cpaulgilman commented Apr 11, 2023

Copy link
Copy Markdown
Collaborator

Pull Request Template

Description

Move geocoding functions from WEX to SAM to allow all URLs from code to webapis.conf file.

Add user_email to SAM/private.h so NREL Developer API calls to NSRDB and others that require an email address will work.

Motivation:

  • If web service URL changes, we can update the URL in webapis.conf without touching source code.

  • Centralized list of URLS provides transparency for users with cybersecurity questions about what web services SAM uses.

Fixes #1204

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

Tests

NSRDB download with street address (Advanced Download option on Location and Resource page)

WIND toolkit download with street address

Marine Wave resource download (Wave Resource Data Download window does not have a location option, so GeocodeDeveloper() never gets called from UI)

3D shade calculator map underlay and map lookup by location name: On the Location tab, type an address and click Lookup address.

LK geocode() function (Location without advanced option on Location and Resource page also tests this). For example outln( geocode('National Renewable Energy Laboratory, Golden CO')); should print "{ lat=39.7444 lon=-105.152 tz=-7 ok=1 }".

Note geocode() not available from SDKtool LK script editor.

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

* 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
* 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
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 cpaulgilman added this to the SAM Fall 2023 Release milestone Apr 11, 2023
@cpaulgilman cpaulgilman requested a review from sjanzou April 11, 2023 00:36
@cpaulgilman cpaulgilman self-assigned this Apr 11, 2023

@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 - any idea why the defaults changed?

@cpaulgilman

Copy link
Copy Markdown
Collaborator Author

Looks good - any idea why the defaults changed?

Defaults changed from adding time series power price escalation for Cambium updates -- I merged those changes into this branch to keep it up to date in 5300978

@cpaulgilman cpaulgilman merged commit f2d45fb into develop Apr 14, 2023
@cpaulgilman cpaulgilman deleted the move-geocode branch April 14, 2023 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants