NREL / OpenStudio

OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
https://www.openstudio.net/
Other
505 stars 192 forks source link

Static value for measure arguments/variables not being set properly in analysis JSON #2618

Closed DavidGoldwasser closed 7 years ago

DavidGoldwasser commented 7 years ago

This hit me and @henryHorsey when trying to use Baseline Perturbation, which makes use of the static value.

"default_value" is set off of what is shown in the GUI, but "static" seems to come from the measure.rb default value for a specific argument.

Screenshot below shows GUI on left and analysis JSON on the right for Window to Wall Ratio variable.

screen shot 2017-05-22 at 11 44 39 am

DavidGoldwasser commented 7 years ago

I looked into a case where the measure.rb argument doesn't have a default value of 0, and was surprised that in that case both the 'default_value' and 'static' used the measure.rb default, but 'value' still used the correct 0.4

screen shot 2017-05-22 at 12 11 42 pm

rHorsey commented 7 years ago

@kflemin - Some specifics here.

Currently, in the first measure in the second image, when Electric Equipment Power Density has it's static default field set to '0.4' the corresponding [:variable][:argument][:value] is set. (The measure default is 0.55.) I don't know that this is wrong, (i.e. I wouldn't change that,) but the [:variable][:static_value] needs to be set equal to the updated value as well. I think that [:variable][:static_value] inherits from [:variable][:argument][:default_value], which I assume is populated from measure manager, but when it's updated the change doesn't get persisted? (Best guess!)

kflemin commented 7 years ago

now setting static_value to 'value' key's value. default_value remains the measure's default_value unless it is nil, in which case the 'value' key's value will be used. https://github.com/NREL/OpenStudio-PAT/commit/151da4e393f53c7f0cfa04660a37d1230a13ce0b

rHorsey commented 7 years ago

Thank you @kflemin!

rHorsey commented 7 years ago

@DavidGoldwasser are you able to test these yet? If so, could you try this one again on PAT develop?

DavidGoldwasser commented 7 years ago

Looks good running on NREL24a with Mac 2.1.2 installer