Possible causes for "Optional is not initialized" error in an OpenStudio Results measure?

asked 1 year ago

MDW's avatar

updated 1 year ago

Hi there, I am getting the following error when attempting to run a measure to specify single DX heating and cooling

Found error in state 'os_measures' with message :/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/util/measure.rb failed with message Runner error :/ruby/2.7.0/gems/openstudio-workflow-2.3.1/lib/openstudio/workflow/util/measure.rb failed with Optional not initialized, C:/Users/AppData/Local/Temp/osmodel-1684756282-1/resources/measures/a_20230522_ashptest_1 1 1 1 1/measure.rb:34:in `get'

Not sure where to start with debugging this, and the only other post I can find online related to this error does not seem relevant to my own context. Any help would be appreciated in figuring out when this type of error arises, and what possible next steps are to resolve - thank you!

Preview: (hide)

Comments

This is a new measure you're developing? Or the NREL OpenStudio Results Measure? Could you post the 3 or 4 lines preceding line 34 (e.g. lines 30 to 34) in measure.rb? Sounds like a (common) Boost optional issue.

Denis Bourgeois's avatar Denis Bourgeois  ( 1 year ago )

Agreed. Read the section "OpenStudio Measures and the boost::optional Type" from the measure writing guide.

shorowit's avatar shorowit  ( 1 year ago )

I see - thank you, both! That documentation is helpful.

MDW's avatar MDW  ( 1 year ago )