openstudiocoalition / OpenStudioApplication

The OpenStudio Application is a fully featured graphical interface to OpenStudio models including envelope, loads, schedules, and HVAC.
https://openstudiocoalition.org
Other
136 stars 25 forks source link

OpenStudio Results Measure is broken #722

Closed macumber closed 3 months ago

macumber commented 4 months ago

Issue overview

Current Behavior

When the OpenStudio Application is launched it searches for updates to the OpenStudio Results measure. NREL has just released a new version of the OpenStudio Results measure which is not backwards compatible (the minimum OS SDK version is 3.8.0). When creating a new model using the OpenStudio Application 1.7.1 or earlier, this measure will be added to the workflow by default. However, when the model is run, the OpenStudio Results measure will fail with:

SWIG director method error. NoMethodError: undefined method `getArgumentValues' for #<OpenStudio::Measure::OSRunner:0x000001c0e13ecc10>
Traceback (most recent call last):
C:/Users/macumber/AppData/Local/Temp/osmodel-8c4c-f636-1073-297d-1720838901-0/resources/measures/openstudio_results/measure.rb:241:in `run'
Found error in state 'ReportingMeasures' with message: 'Runner error: Measure 'C:/Users/macumber/AppData/Local/Temp/osmodel-8c4c-f636-1073-297d-1720838901-0/resources/measures/openstudio_results/measure.rb' reported an error with [SWIG director method error. NoMethodError: undefined method `getArgumentValues' for #<OpenStudio::Measure::OSRunner:0x000001c0e13ecc10>
Traceback (most recent call last):

Expected Behavior

The OpenStudio Results measure should not be automatically updated to a non-compatible version.

Steps to Reproduce

Using OpenStudio Application 1.7.1 or below, create and run a new model.

Possible Solution

Going forward, update OpenStudio Application to not automatically download updates to the OpenStudio Results measure.

For users on OpenStudio Application 1.7.1 or below, download the openstudio-common-measures-gem source code as a zip file. Unzip the source code and copy the directory lib/measures/openstudio_results to your "My Measures" directory (click the folder icon that says "My") in the OpenStudio Application. Delete the "OpenStudio Results" measure in your current model and replace it with the downloaded measure.

Before workaround (OpenStudio Results is a "BCL Measure"): image

After workaround (OpenStudio Results is a "My Measure"): image

Details

Environment

Some additional details about your environment for this issue (if relevant):

Context

macumber commented 4 months ago

The OpenStudio Application does filter out incompatible measures based on min_compatible tags. However, the code where we were automatically updating the results measure did not have that check

jmarrec commented 4 months ago
nixub-a commented 2 months ago

I'm having the same issue with the newest version (v3.8.0 and v1.8.0). The suggestion of copying the directory from the source code helped here as well. The BCL library keeps trying to update OpenStudioResults, but does not succeed. There are no notifications indicating that the update failed.

muh182 commented 1 month ago

@macumber @jmarrec is this issue fixed? I see students have the same issue with the new v3.8.

Screenshot 2024-09-30 at 12 26 46 PM

The above solution mentioned "For users on OpenStudio Application 1.7.1 or below, download the .." Is this a good workaround for OpenStudio Application Version: 1.8.0+2722e3e751?

macumber commented 1 month ago

I thought this issue was fixed. Can you give some more details on the problem models? Did the OSM model exist (with OpenStudio Results measure) in a previous version before you updated to 1.8.0? Does the OSM model have an openstudio_results measure in its measures directory? If so, what are the values of uid, version_id, and version_modified?

muh182 commented 1 month ago

Yes, it is an existing model with the measure in the folder. This is how the measure looks like in the measure tab:

Screenshot 2024-10-04 at 5 05 11 PM

When I delete the measure, I cannot add it back in (Note: I have several OpenStudio versions, ranging from 1.4 to 1.8 on my computer).

Here are the uid, version_id. and version_modified:

  <uid>a25386cd-60e4-46bc-8b11-c755f379d916</uid>
  <version_id>47a8b8c6-2f4b-401b-9fdf-d7e5d278f2cf</version_id>
  <version_modified>2024-04-12T22:26:12Z</version_modified

Here is the link to a sample model.

macumber commented 1 month ago

I opened the model in 1.8.0 and saw the same broken measure message. However, I was able to delete the measure from my model, save the model, then drag in the OpenStudio Results measure from the BCL. Have you tried downloading the new version of the OpenStudio Results measure from the BCL? You could try cleaning up your local BCL. The easiest thing to do is just delete it (it's at C:\Users\<uesrname>\BCL on Windows) or if you want to be selective you could just run the following Ruby code over and over until you have removed all instances of the OpenStudio Results measure from your local BCL and then download the new one again.

require 'openstudio'
measure = OpenStudio::LocalBCL.instance.getMeasure('a25386cd-60e4-46bc-8b11-c755f379d916')
OpenStudio::LocalBCL.instance.removeMeasure(measure.get) if not measure.empty?