First time here? Check out the Help page!

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 Aug 30

jugonzal07's avatar

updated Aug 30

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?

Preview: (hide)

Comments

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

ericringold's avatar ericringold  ( Aug 30 )

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  ( Aug 30 )

1 Answer

Sort by » oldest newest most voted
3

answered Aug 31

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

Preview: (hide)
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  ( Aug 31 )

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: Aug 30

Seen: 108 times

Last updated: Aug 30 '24