1

Utilizing getOpenStudioCLI() call in python

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?

jugonzal07's avatar
681
jugonzal07
asked 2024-08-30 11:40:56 -0500, updated 2024-08-30 11:47:32 -0500
edit flag offensive 0 remove flag 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 -0500) 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 -0500) edit
add a comment see more comments

1 Answer

3

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

shorowit's avatar
11.8k
shorowit
answered 2024-08-30 19:17:57 -0500
edit flag offensive 0 remove flag delete link

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 -0500) edit
add a comment see more comments