0

Where is MeasureStep in Python version of OpenStudio SDK?

I was hoping to implement MeasureStep in a Python script. Much like "model = openstudio.model.Model()" or "space = openstudio.model.Space(model)", or "vector = openstudio.Vector3d(1.0,2.0,3.0)," I expected MeasureStep to be accessible as "measure_step = openstudio.MeasureStep(measure_directory)" after an "import openstudio" in my "test.py" file. Alas, I am being told by the Python interpreter there is none such. And "measure_step = openstudio.utilities.MeasureStep()" or "measure_step = openstudio.workflowJSON.MeasureStep()" or similar variations do not lead to success either. Has MeasureStep not been implemented yet in the openstudio SDK Python module? Or if it was, where can it be found? On a side note, is there an openstudio-standards for Python yet? Thanks.

mattkoch's avatar
1.1k
mattkoch
asked 2024-03-27 20:38:12 -0500
shorowit's avatar
11.8k
shorowit
updated 2024-03-28 10:35:26 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

1

What versions of OpenStudio and Python are you using? It works as expected for me.

Linux:

image description

Windows:

image description

shorowit's avatar
11.8k
shorowit
answered 2024-03-28 11:18:22 -0500
edit flag offensive 0 remove flag delete link

Comments

I am running openstudio-3.6.0, below is the python output.

>>> import openstudio
>>> test=openstudio.MeasureStep("foo")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'openstudio' has no attribute 'MeasureStep'

I have not tried it on Windows yet, but I just upgraded to openstudio-3.7.0 on Linux, and there it works as you state. Reading the release notes of openstufio-3.7.0, it seems that there has been a strong focus on enabling measures, so I suspect openstudio.MeasureStep() only just became available.

mattkoch's avatar mattkoch (2024-03-28 21:43:56 -0500) edit

Confirmed, openstudio-3.7.0 works in Windows as well:

Python 3.10.11 (tags/v3.10.11:7d4cc5a, Apr  5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import openstudio
>>> test = openstudio.MeasureStep("foo")
>>> test
<openstudio.openstudioutilitiesfiletypes.MeasureStep; proxy of <Swig Object of type 'openstudio::MeasureStep *' at 0x000001CDCAA0B750> >
mattkoch's avatar mattkoch (2024-03-28 22:02:07 -0500) edit
add a comment see more comments