-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Translate EMS Example Files to PythonPlugin #7915
Conversation
…or EMS err file message
…nto pyems_examples
And....assuming CI is OK with this last commit, we are done. This one was indeed a beast, but it seems to be working well. Spot checking a few zone temps reveals good agreement but then also things smoothing out like this: There are small warmup convergence diffs, and some other minor stuff, but overall it seems to be in great shape. |
Agreed, @Myoldmopar. This is ready to go. I checked the diffs on this last file (DemandManager_LargeOffice) and it's the worst offender regarding math differences. Some smoothing in places but overall it looks good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to make a commit with two things: some commented Python cleaned out, and the extra output variables added to the two EMS files cleaned out. It will not need to wait on CI for new results.
if (iCalledFrom == DataGlobals::emsCallFromBeginNewEvironment) { | ||
BeginEnvrnInitializeRuntimeLanguage(); | ||
PluginManagement::onBeginEnvironment(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a new begin environment calling point in the plugins to clear trends and reset stuff. This is a big improvement.
plugin.run(iCalledFrom); | ||
anyRan = true; | ||
bool const didOneRun = plugin.run(iCalledFrom); | ||
if (didOneRun) anyRan = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Properly return whether a plugin actually ran, not just if we tried to run plugins. This is another big improvement.
ADD_SIMULATION_TEST(IDF_FILE PythonPluginUserDefinedWindACAuto.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) | ||
ADD_SIMULATION_TEST(IDF_FILE PythonPluginWindowShadeControl.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) | ||
ADD_SIMULATION_TEST(IDF_FILE PythonPluginLrgOff_GridStorageSmoothing.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) | ||
ADD_SIMULATION_TEST(IDF_FILE PythonPluginCustomTrendVariable.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added gobs of new python plugin test cases that match the EMS cases. We are showing we can match the results of EMS which is a huge step.
@@ -2115,3 +2115,6 @@ | |||
HTML; !- Column Separator | |||
|
|||
!- =========== ALL OBJECTS IN CLASS: OUTPUT:VARIABLE =========== | |||
Output:Variable,Zone1PTHPDXCoolCoil,Cooling Coil Total Cooling Rate,timestep; | |||
Output:Variable,Zone2PTHPDXCoolCoil,Cooling Coil Total Cooling Rate,timestep; | |||
Output:Variable,Zone3PTHPDXCoolCoil,Cooling Coil Total Cooling Rate,timestep; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added a few extra outputs to a couple EMS files for debugging, they aren't hurting anything but I may take them out if I need to do more commits.
self.Shade_Status_Off_handle = self.api.exchange.get_global_handle( | ||
"Shade_Status_Off") | ||
|
||
# self.Shade_Status_Interior_Shade_On_handle = self.api.exchange.get_global_handle( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these commented pieces should be cleaned out.
Thanks @mitchute and @dareumnam, this is a major step for the python work. |
I'm not sure but the plot of Core Top: Zone Mean Air Temperature makes me think of reduced system time steps and whether python is picking up information correctly during this time. A detailed simulation may show issues? |
Pull request overview
Translate the remaining EMS example files to PythonPlugin. Some current python example files don't mirror what the original EMS file does, so this should be checked and results between the two methods compared.
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Reviewer
This will not be exhaustively relevant to every PR.