NREL / openstudio-load-flexibility-measures-gem

Other
1 stars 2 forks source link

add_central_ice_storage fails in OS 3.5 because NoMethodError: undefined method `minimumValueofx' for #<OpenStudio::Model::Curve:0x00005626aacc77f8> #50

Closed DavidGoldwasser closed 1 year ago

DavidGoldwasser commented 1 year ago

Here is relevant code. In addition to to minimumValueofx I expect setMinimumValueofx will also be bad. https://github.com/NREL/openstudio-load-flexibility-measures-gem/blob/develop/lib/measures/add_central_ice_storage/measure.rb#L461-L471

    # Check limits of chiller performance curves and adjust if necessary - Notify user with WARNING
    curve_output_check = false
    cap_ft = ctes_chiller.coolingCapacityFunctionOfTemperature
    min_x = cap_ft.minimumValueofx.to_f
    if min_x > chg_sp
      cap_ft.setMinimumValueofx(chg_sp)
      runner.registerWarning("VERIFY CURVE VALIDITY: The input range for the '#{cap_ft.name}' curve is too " \
                            'restrictive for use with ice charging. The provided curve has been ' \
                            "extrapolated to a lower limit of #{chg_sp.round(2)} C for the 'x' variable.")
      curve_output_check = true
    end

    eir_ft = ctes_chiller.electricInputToCoolingOutputRatioFunctionOfTemperature
    min_x = eir_ft.minimumValueofx.to_f
DavidGoldwasser commented 1 year ago

Ok, this could break a number of things. 3.4 is on left. 3.5 is on right, the class of objects that used to be a specific curve is now just a curve object, so measures expecting the specific curve classes may fail.

Screen Shot 2022-11-29 at 3 01 14 PM
tijcolem commented 1 year ago

@jmarrec @joseph-robertson Do you know if this was the result of deprecating out some old methods? I know there was some changes to the curve objects and this seems related.

joseph-robertson commented 1 year ago

See this PR. You'll just need to to_CurveBiquadratic.get.