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

PythonPlugin examples do not work with runtime API

asked 2021-11-30 18:23:04 -0500

halimgur's avatar

updated 2022-02-18 17:08:14 -0500

EP comes with a number of Pythonplugin examples (IDF file + python script). I can run them with EP-Launch. But when I try to run them using the API, I get an error. I run them as follows:

api = EnergyPlusAPI(True). # I also tried False or no arguments
state = api.state_manager.new_state()
api.runtime.run_energyplus(state,["-d", outputfolder,"-w",weatherfile, idffile])

The idffile argument in the above code is the example file provided with the EP package. I tried two:

  • PythonPlugin1ZoneUncontrolledCondFD.idf
  • PythonPluginAirflowNetworkOpeningControlByHumidity.idf

I have no problem running the normal example files (e.g. AbsorptionChiller.idf). But when I try the plugin examples, I get the following error in the err file:

** Severe  ** Found PythonPlugin objects in an IDF that is running in an API/Library workflow...this is invalid

This implies to me that the Python API does not work with Plugins. On the other hand, I have seen nothing in the documentation that suggests this might be case.

Am I doing something wrong?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-11-30 20:30:07 -0500

I assume that you are using a version of EnergyPlus prior to 9.6? It appears that this limitation has been addressed in EnergyPlus 9.6, see the implementation here for reference.

edit flag offensive delete link more

Comments

Correct. I was running 9-5-0. I should have specified it.

After reading your answer, I downloaded EP 9-6 on my Windows computer and I now can run PythonPlugin examples while using the runtime API. The same code segment (which did not work with EP 9-5) in my question above now works perfectly fine in EP 9-6.

It is a shame that EP 9-6 is not yet available for my Mac computer (with Apple M1 chip) but that is OK. I can wait for that.

Thank you.

halimgur's avatar halimgur  ( 2021-11-30 21:43:54 -0500 )edit

Note that EnergyPlus will run fine on that Mac, but you need to compile it yourself for the time being. See https://github.com/NREL/EnergyPlus/is... for some relevant information.

shorowit's avatar shorowit  ( 2021-12-01 13:43:37 -0500 )edit

Your Answer

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

Add Answer

Careers

Question Tools

1 follower

Stats

Asked: 2021-11-30 18:23:04 -0500

Seen: 183 times

Last updated: Nov 30 '21