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

Are you interested in a Python automation tool for configuration/simulation/plotting?

asked 2021-09-20 04:06:51 -0500

Adrien's avatar

updated 2022-02-10 10:22:24 -0500

I developed for my master's thesis an automation tool to configure EnergyPlus/OpenStudio models, batch run simulations, retrieve the results and plot a lot of graphs (so this can be used for parametric analysis). This is tailored for one specific usecase, with a strong focus on ventilation (also for "COVID-19" scenarios) but I tried to design it in such a way that it could be easily extended and used for other projects.

The programming language is Python (for now 3.7), the configuration is done in a file and there's a script to run various commands. The main dependencies (Python packages) are eppy, openstudio, pandas, seaborn.

I have been offered to write an academic paper about it, and if I do it I would also have to write documentation, tests and ship a proper package that can be easily installable (including providing a Docker image and the necessary stuff to help a quick start). Now my problem is that I don't really have the time to do this, and I would not do it for fun, but only if I know that it can be useful to other people.

If you are interested and think that you could consider using such a tool, please let me know.

edit retag flag offensive close merge delete


@Adrien, It looks like you may have all the components you need, but if you feel you can benefit elements of OpenStudio Analysis Framework (OSAF), its possible you may be able to run many of the elements you are using within or alongside OSAF. For example python post processing scripts, support in scaling cloud computing, and accessing the OSAF API for individual datapoints during the analysis. This paper, in particular Section 3 on methods provides more details.

David Goldwasser's avatar David Goldwasser  ( 2021-09-22 01:56:27 -0500 )edit

Thank you! I didn't know about it and will have a look.

Adrien's avatar Adrien  ( 2021-09-22 16:33:30 -0500 )edit

9 Answers

Sort by ยป oldest newest most voted

answered 2021-09-21 09:06:45 -0500

spqr's avatar

A complete working package that is easy for others to use would be great. However, even releasing some of the unpolished code could be helpful to others who may have some coding experience, but could leverage your existing workflow.

edit flag offensive delete link more

answered 2021-09-21 14:44:52 -0500

KerryHarp's avatar

Nice project, Adrien. I would be interested.

edit flag offensive delete link more

answered 2021-09-22 17:08:11 -0500

Adrien's avatar

Thank you for showing your interest. I am afraid my prototype won't be good enough to meet your expectations :-p

The source code is hosted here: Feel free to have a look, maybe try it out and let me know what doesn't work via creating new issues in gitlab.

It is still missing a lot of things, refactoring, easier configuration, comments in the code, typing annotations, performance improvements...

edit flag offensive delete link more


Quick update from my side: I was hoping to find a job (somehow related to the topic) that would allow me to continue this project during the working hours, but it didn't happen. I feel sorry but I am busy enough with other things, and I am afraid I won't do anything to improve the current status.

Feel free to fork the above repository and continue this if you like. Also thank you all, you are a great community :-)

Adrien's avatar Adrien  ( 2021-12-11 07:17:44 -0500 )edit

answered 2021-09-22 21:44:17 -0500

Trying's avatar

You have done something very interesting and would be helpful to the community. I am developing a co-simulation with EnergyPlus and a neural network developed in python. I am intending to change design measures on an IDF file and produce an ESO file from energyPlus and feed the outputs within ESO to my neural network. I keep getting issues with editing the IDF file, I know OpenStudio GUI makes it easy to add and change measures which I am trying to do with a python script. Do you have a suggestion on how I can work around the problems in editing measures on the IDF files using the opyPlus library? Also, what is the reason you are using OpenStudio in your program, what does it do that is different from the work done with eppy and energyPlus library.

Again, good work.

edit flag offensive delete link more


@Trying, the OpenStudio Workflow (OSW) file that stores which measures to run and what argument values, is just a JSON file, so it should be easy to edit that with any scripting language. If you look at the files with your OSM in the OpenStudio Application you should see an OSW similar to this.

And the OSW files can be run via Python by calling the OpenStudio CLI.

David Goldwasser's avatar David Goldwasser  ( 2021-09-23 10:57:57 -0500 )edit

I have not tried opyPlus but eppy - I assume they work similarly when it comes to model edition. See epluslib/, epluslib/ and epluslib/ in the gitlab repository for an idea of how I would do it (the comments length's is limited here, I can't write much more).

I started with OS before I knew that I would end up programming my models, and extracted from OSM to IDF the things that I want to parametrize. If I had to start again, I would do everything directly on the IDF. I will probably remove OSM support from the tool (you can convert OSM to IDF anyway).


Adrien's avatar Adrien  ( 2021-09-23 11:29:36 -0500 )edit

@David Goldwasser

How can I open the openstudio CLI or call it from python? I can't seem to find a documentation out there. And I have never worked with this CLI.

Trying's avatar Trying  ( 2021-09-24 00:08:18 -0500 )edit

@Trying, I put a sample script and link to CLI documentation in the other post.

David Goldwasser's avatar David Goldwasser  ( 2021-09-26 00:41:24 -0500 )edit

answered 2021-10-06 14:01:13 -0500

saeranv's avatar

This is very interesting. However I think to properly understand the usefulness, it would be helpful to clarify where your library exists within the current state-of-the-art tools for python-based OpenStudio/Energyplus workflows, and what gaps or omissions in the state-of-the-art your library tackles. This might already be part of your thesis, as part of your literature review section? This would help us understand, for example, your library's strenghts and weaknesses relative to eppy or Ladybug Tools.

edit flag offensive delete link more


saeranv> Thank you, those are very legitimate questions. Unfortunately there's not much in my thesis about it (that was only a side project of it, and I was a bit sloppy...). I tried to (quickly) answer questions here:

Adrien's avatar Adrien  ( 2021-10-07 11:31:16 -0500 )edit

answered 2021-09-21 04:34:16 -0500

Amr_'s avatar

I'm Interested, I'm trying to do the same thing for optimization and parametric analysis. This would be great

edit flag offensive delete link more

answered 2021-09-21 08:31:04 -0500

updated 2021-09-21 08:31:53 -0500

Sounds interesting, specially if it can be used without any strong coding experience. Rafael

edit flag offensive delete link more

answered 2021-09-21 08:49:44 -0500

EBEdwards's avatar

Something like this (in Python) has been on my "to learn" list for a while. I definitely am doing my parametric/trend analysis the hard way. Good luck, regardless of your choice on this project!

edit flag offensive delete link more

answered 2021-09-21 03:09:00 -0500

Aly's avatar

Dear Adrien, I am interested in such work. In fact, I am working on learning the Python language to do something similar to what you have done. Such work will really help me to get to the things I am looking for in a shortcut.

Best Regards Ali

edit flag offensive delete link more

Your Answer

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

Add Answer

Training Workshops


Question Tools



Asked: 2021-09-20 04:06:51 -0500

Seen: 796 times

Last updated: Oct 06 '21