Skip to content

Cambium api additions#669

Merged
cpaulgilman merged 20 commits into
developfrom
cambium_api_additions
Oct 26, 2021
Merged

Cambium api additions#669
cpaulgilman merged 20 commits into
developfrom
cambium_api_additions

Conversation

@StephenPaul27

Copy link
Copy Markdown
Contributor

I just merged develop, fixed conflicts, and ran the test script, the results came out clean and everything seems to be working fine so let me know if there's anything you spot that needs fixing/updating.

LK/WEX/SSC branch names are all also cambium_api_additions, I'll create separate pull requests for those I guess

working version of API Form, msgbox output
Added tooltips and target for api copy
Includes changes to default files for merchant plant cases as well as the UI pages related to the cambium API itself (after passing test_script_ow.lk)
Added incrementing year option to the cambium year selection input.
all defaults have been merged without test script conflict
everything seems to check out
@StephenPaul27 StephenPaul27 requested a review from sjanzou July 27, 2021 21:40
@cpaulgilman

Copy link
Copy Markdown
Collaborator
  1. Please remove colons from UI variable labels to be consistent with rest of UI:

image

  1. The on_load() function for Cambium API Data and Cambium Tab UI forms appear to be similar. Are both required, or can that code be consolidated in one place to make it easier to maintain?

  2. The urls for the Cambium API calls are hard-coded in the UI callback LK script instead of being stored in the runtime/webapis.conf file and read with the webapi() function. See Solar Resource and Marine Wave Resource Time Series forms for examples of the webapi() function.

  3. Is the project_uuid variable to store an NREL Developer API key? If so, I think it should use the SAM API key with code similar to this code snippet from the Solar Resource UI callback. For official release versions of SAM, the curl() function should convert to the SAM's NREL Developer API key (this only works for versions of SAM built from SAM-private):

base_url = dataset[n].url;
base_url += '?api_key=<SAMAPIKEY>';
base_url += '&full_name=sam_user';
base_url += '&email=<USEREMAIL>';
  1. Is the Financial Merchant Plant form still needed? If not please remove it by deleting the .txt file in the ui folder.

@StephenPaul27

Copy link
Copy Markdown
Contributor Author

1, 3, & 5: Thanks for pointing these out, I'll fix them today.
2: The on_load was the only function I found necessary to duplicate when creating the "dummy" UI forms for the tabs because of the difference in the form name triggering the load. I can try to either consolidate or reduce what is there currently.
4: The project_uuid is specific to Cambium and just differentiates which data set we're calling to.
cambium_screenshot
So the project_uuid in the UI specifies that we're getting data from that first set of scenarios "Cambium Scenarios (Hourly and annual)"
Let me know if this should be relocated somewhere.

@cpaulgilman

Copy link
Copy Markdown
Collaborator

Thanks, Stephen. The project_uuid is fine where it is -- I just wanted to make sure we are not storing API keys in the UI callback code.

Removed Financial Merchant Plant and unused Financial Capacity Tab UI forms
Removed colons from labels
Consolidated on_load function (it was perfectly transferrable, though it seems to negligibly slow down the tab load times)
API url info moved to webapi.conf, project_uuid remains in callback code

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

Please remove the .txt file per comments and move the uuid to private.h in SAM-private as used for the so that the SAM Cambium key is "hidden" from webapis.conf. What will the final defaults used be - hourly, single value and then populated by Cambium? Great Work!

Comment thread deploy/runtime/webapis.conf
Comment thread deploy/runtime/ui/.txt Outdated
updated verbage for Cambium description to reflect how Cambium defines its data
Add title property to tooltip widget.
New sample script to download cambium data to PPA models.
@sjanzou

sjanzou commented Oct 21, 2021 via email

Copy link
Copy Markdown
Collaborator

@cpaulgilman cpaulgilman merged commit 0e5e81f into develop Oct 26, 2021
@brtietz brtietz added this to the SAM Fall 2021 Release milestone Dec 3, 2021
@cpaulgilman cpaulgilman deleted the cambium_api_additions branch December 7, 2021 23:02
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.

4 participants