Skip to content

Add new Schedule:Year:Rules detailed schedule type - #11693

Merged
mitchute merged 93 commits into
developfrom
sch-ruleset
Aug 20, 2026
Merged

mitchute merged 93 commits into
developfrom
sch-ruleset

Conversation

@joseph-robertson

Copy link
Copy Markdown
Collaborator

Pull request overview

  • Add new Schedule:Year:Rules and Schedule:Week:Rule objects for describing detailed schedules.

Description of the purpose of this PR

Pull Request Author

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies
  • If adding/removing any output files (e.g., eplustbl.*)
    • Update ..\scripts\Epl-run.bat
    • Update ..\scripts\RunEPlus.bat
    • Update ..\src\EPLaunch\ MainModule.bas, epl-ui.frm, and epl.vbp (VersionComments)
    • Update ...github\workflows\energyplus.py

Reviewer

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

joseph-robertson and others added 30 commits May 4, 2026 10:33
@mitchute

Copy link
Copy Markdown
Collaborator

@joseph-robertson I think this one is ready. @kbenne @jmarrec anything from you, or anyone else?

Comment thread src/EnergyPlus/ScheduleManager.cc Outdated

ErrorObjectHeader eoh{routineName, CurrentModuleObject, Alphas(1)};

if (s_sched->weekRuleScheduleMap.find(Util::makeUPPER(Alphas(1))) != s_sched->weekRuleScheduleMap.end()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a buckload of calls to Util::makeUPPER in this file. They are all probably redundant/moot.

At least these with Alphas() are.

The InputProcessor already uppercases every alpha field when populating Alphas, unless the corresponding IDD field is marked \retaincase.

std::pair<std::string, bool> InputProcessor::getObjectItemValue(std::string const &field_value, json const &schema_field_obj)
{
std::pair<std::string, bool> output;
if (field_value.empty()) {
findDefault(output.first, schema_field_obj);
output.second = true;
} else {
output.first = field_value;
output.second = false;
}
if (schema_field_obj.find("retaincase") == schema_field_obj.end()) {
output.first = Util::makeUPPER(output.first);
}
return output;
}

None of the relevant fields in idd/Energy+.idd.in (Name fields for Schedule:Week:Daily, Schedule:Week:Rule, Schedule:Year, Schedule:Year:Rules, Schedule:Compact, Schedule:File, Schedule:Constant, the ExternalInterface:*Schedule objects, etc.) carry \retaincase, so Alphas(N) arrives already uppercase and the extra makeUPPER() is useless

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was motivated by #11693 (comment). Does this mean we could also remove all the Util::makeUPPER in, e.g., s_sched->weekRuleScheduleMap.insert_or_assign(Util::makeUPPER(weekRuleSched->Name), weekRuleSched->Num);?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

34630da

I left the insert_or_assign(Util::makeUPPER(...), ...);.

@jmarrec jmarrec Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Yes, it could have gone away too)

Comment on lines +1164 to +1166
if ((Alphas(4)) == "YES") {
weekRuleSched->applySunday = true;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another proof that it's already uppercase...


CurrentModuleObject = "Schedule:Week:Rule";
for (int Loop = 1; Loop <= NumWeekRuleSchedules; ++Loop) {
s_ip->getObjectItem(state,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mitchute As a side note, at some point there should be clarity / developer guidelines on when we should use getObjectItem (with ObjexxFCL arrays) versus using the epJSON directly.

Should new GetInput code use epJSON? Even if the rest of the file it's added in uses the old (legacy?) getObjectItem.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I think #11756 is related to this, but this is something we should get aligned on very soon.

@github-actions

Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 66af0ce

Regression Summary
  • ESO Small Diffs: 710
  • Table Small Diffs: 349
  • MTR Small Diffs: 525
  • Table String Diffs: 177
  • EIO: 360
  • JSON Small Diffs: 2
  • ZSZ Small Diffs: 71
  • Table Big Diffs: 34
  • ERR: 28
  • MTR Big Diffs: 3
  • EDD: 4
  • ESO Big Diffs: 10
  • SSZ Small Diffs: 13
  • JSON Big Diffs: 2

@github-actions

Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 0266dbd

Regression Summary
  • ESO Small Diffs: 710
  • Table Small Diffs: 349
  • MTR Small Diffs: 525
  • Table String Diffs: 177
  • EIO: 360
  • JSON Small Diffs: 2
  • ZSZ Small Diffs: 71
  • Table Big Diffs: 34
  • ERR: 28
  • MTR Big Diffs: 3
  • EDD: 4
  • ESO Big Diffs: 10
  • SSZ Small Diffs: 13
  • JSON Big Diffs: 2

\paragraph{Field: Name}\label{field-name-5-021}

This field should contain a unique (between Schedule:Year, \hyperref[schedulecompact]{Schedule:Compact}, and \hyperref[schedulefile]{Schedule:File}) designation for the schedule. It is referenced by various ``scheduled'' items (e.g.~\hyperref[lights-000]{Lights}, \hyperref[people]{People}, Infiltration) to define the appropriate schedule values.
This field should contain a unique (between Schedule:Year, \hyperref[schedulecompact]{Schedule:Compact}, \hyperref[scheduleyearrules]{Schedule:Year:Rules}, and \hyperref[schedulefile]{Schedule:File}) designation for the schedule. It is referenced by various ``scheduled'' items (e.g.~\hyperref[lights-000]{Lights}, \hyperref[people]{People}, Infiltration) to define the appropriate schedule values.

@mitchute mitchute Aug 20, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wording is a bit awkward on these, but that's not your problem. Maybe in the future we can implement some semi-automated, systematic approach to working though the docs for language and style cleanups.

@mitchute

Copy link
Copy Markdown
Collaborator

Last call here, too. Thanks for all the work on this @joseph-robertson.

@mitchute

Copy link
Copy Markdown
Collaborator

Alrighty. Ready on this one. Merging.

@mitchute
mitchute merged commit c98b224 into develop Aug 20, 2026
8 checks passed
@mitchute
mitchute deleted the sch-ruleset branch August 20, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IDDChange Code changes impact the IDD file (cannot be merged after IO freeze) NewFeature Includes code to add a new feature to EnergyPlus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants