Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RunPeriodControlSpecialDays are not Forward Translated #4064

Closed
chriswmackey opened this issue Sep 3, 2020 · 4 comments · Fixed by #4072
Closed

RunPeriodControlSpecialDays are not Forward Translated #4064

chriswmackey opened this issue Sep 3, 2020 · 4 comments · Fixed by #4072

Comments

@chriswmackey
Copy link

Issue overview

Even though ScheduleRuleset officially supports holidays now thanks to @jmarrec 's addressing of this issue it seems I'm still unable to get the RunPeriodControlSpecialDays that I add to the Model to show up in the IDF.

Current Behavior

I would expect the following code to add a holiday to the IDF:

model = OpenStudio::Model::Model.new
os_hol = OpenStudio::Model::RunPeriodControlSpecialDays.new(
    OpenStudio::MonthOfYear.new(7), 4, model )
os_hol.setDuration(1)
os_hol.setSpecialDayType('Holiday')

I can puts this Holiday object and get it from the Model with the model.getRunPeriodControlSpecialDayss method.
However, this special day never makes it into the IDF with the Forward Translating done by the OpenStudio CLI.

Expected Behavior

I'd expect the holiday to make it into the IDF.

Environment

  • Windows 10
  • OpenStudio 3.0.1
  • Using OpenStudio CLI for the IDF forward translating
  • Here is the OSW that I am using for Forward Translating in the event there's something in the OSW Schema I'm supposed to be using to make sure the holidays are translated:

https://drive.google.com/file/d/1kVARVzqDdCNTAUHYHZfV-5eA2B_aNHwy/view?usp=sharing

@chriswmackey chriswmackey added the Triage Issue needs to be assessed and labeled, further information on reported might be needed label Sep 3, 2020
@tijcolem tijcolem added component - Model severity - Minor Bug Enhancement Request and removed Triage Issue needs to be assessed and labeled, further information on reported might be needed Enhancement Request labels Sep 4, 2020
@jmarrec
Copy link
Collaborator

jmarrec commented Sep 11, 2020

@chriswmackey there is a flag, that is false by default, that will tell the FT whether it should translate the special days or not... It's been there for at least 7 years.

// temp code
m_keepRunControlSpecialDays = false;
m_ipTabularOutput = false;
m_excludeLCCObjects = false;
m_excludeSQliteOutputReport = false;
m_excludeHTMLOutputReport = false;
m_excludeVariableDictionary = false;

As I indicated in https://github.com/NREL/OpenStudio/pull/3814/files#discussion_r356545389, I think it may be time to remove the flag, or rather, to set it to true by default. The App is separated and is no longer a concern of the SDK.

You can use ForwardTranslator::setKeepRunControlSpecialDays(true) to tell the FT to translate them. Obviously that doesn't work if you're using measures.

model = OpenStudio::Model::Model.new
os_hol = OpenStudio::Model::RunPeriodControlSpecialDays.new(
    OpenStudio::MonthOfYear.new(7), 4, model )
os_hol.setDuration(1)
os_hol.setSpecialDayType('Holiday')

ft = OpenStudio::EnergyPlus::ForwardTranslator.new
w.getObjectsByType("RunPeriodControl:SpecialDays").size
=> 0
ft.setKeepRunControlSpecialDays(true)
w = ft.translateModel(model)
w.getObjectsByType("RunPeriodControl:SpecialDays").size
=> 1

@chriswmackey
Copy link
Author

Thank you for the response, @jmarrec . It would be very helpful if the flag could be set to True by default or if it could be exposed in the OSW schema since I have no means of setting it to True in our current Ladybug Tools workflows.

We transitioned from using the C# bindings in our old (legacy) plugin to using measures, Ruby bindings, and the OpenStudio CLI in out latest plugins. Generally, it's been a big improvement since we no longer have the whole plugin failing with PINVOKE errors from incorrectly-built C# bindings and it has allowed us to easily integrate into other Ruby-based projects at NREL, especially openstudio-standards.

However, it seems the one major downside of this transition is that there's no way for us to access the forward translator. So we cannot support holidays in our latest plugin even though we have support for it in our old plugin.

@jmarrec
Copy link
Collaborator

jmarrec commented Sep 14, 2020

@chriswmackey thanks for the context that is helpful to know. I did the changes already in the linked PR #4072 a few days ago, but it is still pending review

kbenne added a commit that referenced this issue Sep 14, 2020
Fix #4064 - RunPeriodControlSpecialDays are not Forward Translated
@chriswmackey
Copy link
Author

Wonderful! Thank you, @jmarrec !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants