Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
0

Where is MeasureStep in Python version of OpenStudio SDK?

asked 2024-03-27 20:38:12 -0600

mattkoch's avatar

updated 2024-03-28 10:35:26 -0600

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2024-03-28 11:18:22 -0600

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

Linux:

image description

Windows:

image description

edit flag offensive delete link more

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 -0600 )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 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2024-03-27 20:38:12 -0600

Seen: 107 times

Last updated: Mar 28