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 3 years ago

halimgur's avatar

updated 3 years ago

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?

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered 3 years ago

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.

Preview: (hide)
link

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

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

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: 3 years ago

Seen: 243 times

Last updated: Nov 30 '21