First time here? Check our help page!
3

PythonPlugin examples do not work with runtime API

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?

halimgur's avatar
201
halimgur
asked 2021-11-30 18:23:04 -0500
__AmirRoth__'s avatar
4.4k
__AmirRoth__
updated 2022-02-18 17:08:14 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

3

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.

shorowit's avatar
11.8k
shorowit
answered 2021-11-30 20:30:07 -0500
edit flag offensive 0 remove flag delete 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 (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
add a comment see more comments