Skip to content

Improve test coverage for ConvexWeilerAtherton polygon clipping algorithm#11554

Open
joseph-robertson wants to merge 7 commits intodevelopfrom
convex-weiler-atherton
Open

Improve test coverage for ConvexWeilerAtherton polygon clipping algorithm#11554
joseph-robertson wants to merge 7 commits intodevelopfrom
convex-weiler-atherton

Conversation

@joseph-robertson
Copy link
Copy Markdown
Collaborator

@joseph-robertson joseph-robertson commented Apr 29, 2026

Pull request overview

  • Fixes Add test file for ConvexWeilerAtherton polygon clipping algorithm #5558
  • Instead of adding a new test file, an existing unit test (using ConvexWeilerAtherton) is updated to include calling InitSolarCalculations.
  • Additionally:
    • Clean up some duplicate Output:Variable,*,Zone Mean Radiant Temperature,hourly; lines in a handful of test files
    • Minor IO ref docs fix for Surface Outside Face Sunlit Fraction output variable units

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 joseph-robertson self-assigned this Apr 29, 2026
@joseph-robertson joseph-robertson added the Defect Includes code to repair a defect in EnergyPlus label Apr 29, 2026
Comment on lines +203 to +208
ShadowCalculation,
PolygonClipping, !- Shading Calculation Method
Periodic, !- Shading Calculation Update Frequency Method
1, !- Shading Calculation Update Frequency
, !- Maximum Figures in Shadow Overlap Calculations
ConvexWeilerAtherton; !- Polygon Clipping Algorithm
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.

This is the new stuff.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new EnergyPlus regression/simulation test IDF that exercises the ConvexWeilerAtherton polygon clipping path in ShadowCalculation, addressing the existing coverage gap noted in #5558.

Changes:

  • Added a new shading-focused IDF test case configured to use PolygonClipping + ConvexWeilerAtherton.
  • Registered the new IDF in the testfiles CMake simulation test list.
  • Fixed/cleaned up a documentation line for the “Surface Outside Face Sunlit Fraction” output variable units.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
testfiles/SolarShadingTest_ConvexWeilerAtherton.idf New test IDF to run shading with ConvexWeilerAtherton polygon clipping algorithm.
testfiles/CMakeLists.txt Adds the new IDF to the simulation test suite.
doc/input-output-reference/src/overview/group-thermal-zone-description-geometry.tex Adjusts the units text for the “Sunlit Fraction” output variable entry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

! Design Days: PHOENIX_AZ_USA Annual Heating 99.6%, MaxDB=2.9°C (Winter design day has solar)
! PHOENIX_AZ_USA Annual Cooling (DB=>MWB) .4%, MaxDB=43.4°C MWB=21.1°C
!
! Run Period (Weather File): 1/1 through 12/31, PHOENIX_AZ_USA TMY2
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

The header comment says the run period uses a TMY2 weather file, but this test is wired up in CMake to use a TMY3 EPW. Please update the comment to match the actual EPW being used (or change the EPW if TMY2 is required).

Suggested change
! Run Period (Weather File): 1/1 through 12/31, PHOENIX_AZ_USA TMY2
! Run Period (Weather File): 1/1 through 12/31, PHOENIX_AZ_USA TMY3

Copilot uses AI. Check for mistakes.
Comment on lines +112 to +125
RunPeriod,
Run Period 1, !- Name
1, !- Begin Month
1, !- Begin Day of Month
, !- Begin Year
12, !- End Month
31, !- End Day of Month
, !- End Year
Tuesday, !- Day of Week for Start Day
Yes, !- Use Weather File Holidays and Special Days
Yes, !- Use Weather File Daylight Saving Period
No, !- Apply Weekend Holiday Rule
Yes, !- Use Weather File Rain Indicators
Yes; !- Use Weather File Snow Indicators
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

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

This test runs the full weather-file run period (1/1–12/31) in addition to the design days. Since this is primarily intended to exercise the ConvexWeilerAtherton clipping path, consider shortening the RunPeriod (or switching to DESIGN_DAY_ONLY) to reduce CI runtime while still covering the algorithm.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 2268c71

Regression Summary
  • ESO Small Diffs: 706
  • Table Small Diffs: 392
  • MTR Small Diffs: 524
  • Table String Diffs: 177
  • EIO: 397
  • JSON Small Diffs: 2
  • ZSZ Small Diffs: 72
  • Table Big Diffs: 36
  • ERR: 14
  • MTR Big Diffs: 2
  • ESO Big Diffs: 10
  • SSZ Small Diffs: 13
  • EDD: 4
  • Audit: 9
  • JSON Big Diffs: 2

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit 2268c71

Regression Summary
  • Audit: 9

@mitchute
Copy link
Copy Markdown
Collaborator

@joseph-robertson I have restarted regressions here.

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 2268c71

Regression Summary
  • ESO Small Diffs: 706
  • Table Small Diffs: 392
  • Table String Diffs: 177
  • MTR Small Diffs: 524
  • EIO: 397
  • JSON Small Diffs: 2
  • ZSZ Small Diffs: 72
  • Table Big Diffs: 36
  • ERR: 14
  • MTR Big Diffs: 2
  • ESO Big Diffs: 10
  • SSZ Small Diffs: 13
  • EDD: 4
  • Audit: 9
  • JSON Big Diffs: 2

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on macos-14 for commit 2268c71

Regression Summary
  • Audit: 9

@github-actions
Copy link
Copy Markdown

⚠️ Regressions detected on ubuntu-24.04 for commit 2268c71

Regression Summary
  • Audit: 9

@mitchute
Copy link
Copy Markdown
Collaborator

@joseph-robertson regression results look to be back on track.

@joseph-robertson joseph-robertson changed the title Add test file for ConvexWeilerAtherton polygon clipping algorithm Improve test coverage for ConvexWeilerAtherton polygon clipping algorithm May 1, 2026
@joseph-robertson joseph-robertson marked this pull request as ready for review May 1, 2026 17:14
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

⚠️ Regressions detected on macos-14 for commit ff07da3

Regression Summary
  • Audit: 9

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

⚠️ Regressions detected on ubuntu-24.04 for commit ff07da3

Regression Summary
  • Audit: 9

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

⚠️ Regressions detected on macos-14 for commit 88e4197

Regression Summary
  • Audit: 9

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

⚠️ Regressions detected on ubuntu-24.04 for commit 88e4197

Regression Summary
  • Audit: 9

@joseph-robertson joseph-robertson requested a review from mitchute May 1, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Defect Includes code to repair a defect in EnergyPlus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add test file for ConvexWeilerAtherton polygon clipping algorithm

4 participants