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

Revision history [back]

Ruby isn't harder than Python to learn. I have been using Python for years, and when I picked up Ruby (for OpenStudio), I had no trouble making the switch. They look pretty similar.

As far as your questions goes, I'd say it depends on what you're trying to achieve. Generally speaking, your life will be easier in the openstudio ecosystem if you use ruby, for a variety of reason:

  • Ruby is the de-facto official API language. All examples are in Ruby, all of the tools used behind the scene are in ruby (save for the SDK itself which is in C++)
  • Ruby therefore ships with the installer packages, whereas the Python bindings you need to compile yourself from source. This also means that if you use the python bindings, your code will be harder to share with others.
  • You cannot directly write an OpenStudio Measure (to be run in the OS Application or PAT) using python.

That being said, I am still an avid user of Python especially for visualization/post-processing, since Python has a ton of very useful modules for science / data manipulation / visualization, that ruby is lacking. Part of these I have explained in Time series visualization tools? if you're curious.

So I'd say that if you are a professional trying to use OpenStudio to model real world buildings, go Ruby. Even if you already know Python as a matter of fact.

Only if you're just using OpenStudio as one tool inside a much vaster ecosystem, for example to run a lot of parametric analysis and want to do heavy post processing etc, then perhaps Python is the better path.

Ruby isn't harder than Python to learn. I have been using Python for years, and when I picked up Ruby (for OpenStudio), I had no trouble making the switch. They look pretty similar.

As far as your questions goes, I'd say it depends on what you're trying to achieve. Generally speaking, your life will be easier in the openstudio ecosystem if you use ruby, for a variety of reason:

  • Ruby is the de-facto official API language. All examples are in Ruby, all of the tools used behind the scene are in ruby (save for the SDK itself which is in C++)
  • Ruby therefore ships with the installer packages, whereas the Python bindings you need to compile yourself from source. This also means that if you use the python bindings, your code will be harder to share with others.
  • You cannot directly write an OpenStudio Measure (to be run in the OS Application or PAT) using python.

That being said, I am still an avid user of Python especially for visualization/post-processing, since Python has a ton of very useful modules for science / data manipulation / visualization, that ruby is lacking. Part of these I have explained in Time series visualization tools? if you're curious.

So I'd say that if you are a professional trying to use OpenStudio to model real world buildings, go Ruby. Even if you already know Python as a matter of fact.

Note that there are classes (online or in-person) that deal with OpenStudio scripting, you could start by looking at the Best Directory (disclaimer: I'm the owner of EffiBEM, one of the listed companies).

Only if you're just using OpenStudio as one tool inside a much vaster ecosystem, for example to run a lot of parametric analysis and want to do heavy post processing etc, then perhaps Python is the better path.