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

asked 2023-05-22 15:09:40 -0500

MDW's avatar

updated 2023-05-23 13:54:25 -0500

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!

edit retag flag offensive close merge delete

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  ( 2023-05-23 16:27:06 -0500 )edit

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

shorowit's avatar shorowit  ( 2023-05-24 08:54:39 -0500 )edit

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

MDW's avatar MDW  ( 2023-05-24 15:52:20 -0500 )edit