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
7

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

asked 3 years ago

Adrien's avatar

updated 3 years ago

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 settings.py 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.

Preview: (hide)

Comments

@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  ( 3 years ago )

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

Adrien's avatar Adrien  ( 3 years ago )

9 Answers

Sort by » oldest newest most voted
1

answered 3 years ago

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.

Preview: (hide)
link
1

answered 3 years ago

KerryHarp's avatar

Nice project, Adrien. I would be interested.

Preview: (hide)
link
1

answered 3 years ago

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: https://gitlab.com/souliane/bstools/ 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...

Preview: (hide)
link

Comments

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  ( 3 years ago )
1

answered 3 years ago

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.

Preview: (hide)
link

Comments

@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. https://github.com/NREL/osw2osa/blob/...

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

David Goldwasser's avatar David Goldwasser  ( 3 years ago )

I have not tried opyPlus but eppy - I assume they work similarly when it comes to model edition. See epluslib/edit_idf.py, epluslib/scenario.py and epluslib/variants.py 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).

Thanks

Adrien's avatar Adrien  ( 3 years ago )

@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  ( 3 years ago )

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

David Goldwasser's avatar David Goldwasser  ( 3 years ago )
1

answered 3 years ago

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.

Preview: (hide)
link

Comments

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: https://gitlab.com/souliane/bstools/-/blob/master/questions.md

Adrien's avatar Adrien  ( 3 years ago )
0

answered 3 years ago

Amr_'s avatar

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

Preview: (hide)
link
0

answered 3 years ago

updated 3 years ago

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

Preview: (hide)
link
0

answered 3 years ago

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!

Preview: (hide)
link
0

answered 3 years ago

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

Preview: (hide)
link

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

2 followers

Stats

Asked: 3 years ago

Seen: 1,054 times

Last updated: Oct 06 '21