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

Utilizing getOpenStudioCLI() call in python

asked 2024-08-30 11:40:56 -0600

jugonzal07's avatar

updated 2024-08-30 11:47:32 -0600

Hi all,

I'm new to using the python package for openstudio 3.8 and am writing a very basic call to simulate my OSM file. As it stands, the important bit looks like this, where osw_path is an OpenStudio::Path to the OSW file I'm trying to run.:

cli_path = openstudio.getOpenStudioCLI()
cmd = f'"{cli_path}" run -w "{osw_path}"

However, the openstudio.getOpenStudioCLI() call is returning "." rather than an openstudio.exe file which makes me think there's something more to set up here. Perhaps there's a Python equivalent to how in Ruby you add an openstudio.rb file to the {RUBY_VERSION}\lib\ruby\site_ruby directory?

Any ideas for a best practice here rather than hard coding a path the to openstudio.exe?

A colleague found this in the code base so perhaps it's not ready yet?

edit retag flag offensive close merge delete

Comments

Do you have the location of openstudio.exe in your PATH?

ericringold's avatar ericringold  ( 2024-08-30 12:28:42 -0600 )edit

Hey @ericringold -- I did not. I tried adding it (i.e.,C:\openstudio-3.8.0\bin\openstudio.exe) just to see and I still get the same result. A WindowsPath equal to .

jugonzal07's avatar jugonzal07  ( 2024-08-30 17:29:21 -0600 )edit

1 Answer

Sort by » oldest newest most voted
3

answered 2024-08-30 19:17:57 -0600

That’s the expected behavior, see https://github.com/NREL/OpenStudio/is...

edit flag offensive delete link more

Comments

perfect, thanks so much-- I'm not sure how I missed that issue. I wanted to make sure there wasn't some setup instructions I missed and it sounds like this is expected and an existing limitation for the python bindings. There are plenty of workarounds we can employ so we'll go ahead and use one of those.

Thanks!

jugonzal07's avatar jugonzal07  ( 2024-08-30 19:32:30 -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-08-30 11:40:56 -0600

Seen: 90 times

Last updated: Aug 30