-
Notifications
You must be signed in to change notification settings - Fork 193
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
RemoteBCL does not enforce min_compatible for measures #5230
Comments
I don't think there's any change need on the BCL server itself. import requests
r = requests.get('https://bcl.nrel.gov/api/search/?fq=uuid:a25386cd-60e4-46bc-8b11-c755f379d916&all_content_versions=1')
r.raise_for_status()
data = r.json()
for i, result in enumerate(data['result']):
m = result['measure']
assert m['name'] == 'openstudio_results'
assert m['uuid'] == 'a25386cd-60e4-46bc-8b11-c755f379d916'
print(f"{i} - openstudio_min_compatible={m['openstudio_min_compatible']}")
|
I think the best location to plug into is OpenStudio/src/utilities/bcl/RemoteBCL.cpp Line 835 in ba1b94b
It'd be faster do this, before trying to instantiate a BCLSearchResult which will parse all files, and set the min/Max compatible and then looping on all of these to ensure all files are compatible. |
Maybe I spoke too fast, I think I found the right schema, and it does have 'openstudio_max_compatible': https://github.com/NREL/new-bcl/blob/2d2e742a75086683fab954101f069e9813b3ea7d/bcl/static/assets/json/component_schema.json#L46-L53 |
Right now our RemoteBCL only gets one result, which I suppose is faster. So I thought about whether we could just change the way we query the BCL to have the filtering done on the bcl server, so we do not have to do You can filter by min_compatible when searching the BCL
But it's not helpful; it does not seem to support equality operators, just "=" Ideally you'd need to be able to do something like |
@kflemin wanted to let you know about this. We can talk about 3.9 for this. |
Issue overview
Measures with min_compatible > current CLI version should be be gotten from BCL
Current Behavior
The release of 3.8.0 broke a lot of measures, most notably the
openstudio_results
measure, because the openstudio-extension-gem's ruby methods were removed from the CLI, and replaced with equivalent C++ methods, but in a non-backward compatible way.As a result, these measures were adjusted and recently released with new versions that have "min_compatible" = 3.8.0.
RemoteBCL does not check that one bit, neither in searchComponentLibrary + getMeasure nor in measuresWithUpdates.
This is problematic because it means every user of the CLI < 3.8.0 would get the newest version which is not compatible with their current CLI.
NREL/openstudio-common-measures-gem#169 (comment)
Expected Behavior
RemoteBCL should check min_compatible/max_compatible.
I would expect that:
Steps to Reproduce
test_bcl.rb
Possible Solution
Update RemoteBCL code, and expand BCLSearchResult to include min/max compatible. Might need a server change on the BCL side itself.
Details
Environment
Some additional details about your environment for this issue (if relevant):
Context
Found because the OpenStudio Application 1.7.1 which uses OS SDK 3.7.0 has this issue since July 11.
The text was updated successfully, but these errors were encountered: