-
Notifications
You must be signed in to change notification settings - Fork 55
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
Migrate BETTER API from V1 to V2 #3881
Conversation
…to incorporate pvwatts
…e on an analysis_property_view
…o portfolio building analyses (BETTER v2)
# BETTER_HOST = os.environ.get('BETTER_HOST', 'https://better.lbl.gov') | ||
BETTER_HOST = os.environ.get('BETTER_HOST', 'https://better-lbnl-staging.herokuapp.com') | ||
# BETTER_HOST = os.environ.get('BETTER_HOST', 'https://better-lbnl-development.herokuapp.com') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the writing of this, production and staging servers are functional and the development server is missing endpoints
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 47 doesn't seem necessary here.
|
||
|
||
def _store_better_portfolio_analysis_results(better_analysis_id, better_building_analyses, context): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better_analysis_id
can be found in better_building_analyses
_store_better_building_analysis_results( | ||
better_building_analyses, | ||
context, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_store_better_building_analysis_results
should only be run if better_portfolio_id
is None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything from this PR works as intended. Good job!
# BETTER_HOST = os.environ.get('BETTER_HOST', 'https://better.lbl.gov') | ||
BETTER_HOST = os.environ.get('BETTER_HOST', 'https://better-lbnl-staging.herokuapp.com') | ||
# BETTER_HOST = os.environ.get('BETTER_HOST', 'https://better-lbnl-development.herokuapp.com') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 47 doesn't seem necessary here.
Below are the results from various Analysis configuration tests. Note that it's important that the analysis "Run" doesn't fail if BETTER returns an error for one building in an analysis. This allows results for other buildings in the analysis to be processed. SINGLE BUILIDNGS
MULTIPLE BUILDINGS - NON PORTFOLIO
PORTFOLIOS
|
@perryr16 -- looks great ! Thx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worked as expected! The change of single vs portfolio of buildings is strange, but c'est la vie.
Good work!
…date_range' to match other analyses functionality
# Conflicts: # seed/static/seed/partials/analyses.html # seed/static/seed/partials/analysis_details.html # seed/static/seed/partials/inventory_detail_analyses_modal.html
Minor cleanup
I fixed a some minor issues, primarily that the Issues that remain to be fixed
|
Any background context you want to provide?
The API service that the SEED platform uses to generate BETTER analysis has undergone a version change from V1 to V2. The V1 endpoints have been overwritten by the V2 endpoints breaking the existing functionality. It's worth noting that this is BETTER API V2, however, all endpoints still point to the
api/v1/
URL.V2 makes changes to how Portfolio Analyses are processed (a Portfolio is a collection of Buildings). In V1 a portfolio analysis was initiated and a building_analysis was created for each building in the portfolio. In V2 instead of creating building_analyses, a portfolio analysis will generate a portfolio_building_analysis for each building in the portfolio.
What's this PR do?
This PR migrates the BETTER pipeline functionality to the BETTER V2 endpoints.
How should this be manually tested?
To test the BETTER token verification button
To test the BETTER analyses
What are the relevant tickets?
#3874
Screenshots (if appropriate)
Known issues
BETTER V2 introduces an
enable_pvwatts
analysis configuration key. This key has been hardcoded tofalse
. Integrating this key will require further design.Of the 3 active BETTER servers, production and staging are functional, while development is missing endpoints.
Within the /buildingsync.py file of SEED, there are a number of property_types that are defined as accepted BETTER (and bsync) properties, however several of them will cause a BETTER analysis to fail.