Skip to content

Conversation

@joseph-robertson
Copy link
Collaborator

Pull request overview

Pull Request Author

  • Model API Changes / Additions
  • Any new or modified fields have been implemented in the EnergyPlus ForwardTranslator (and ReverseTranslator as appropriate)
  • Model API methods are tested (in src/model/test)
  • EnergyPlus ForwardTranslator Tests (in src/energyplus/Test)
  • If a new object or method, added a test in NREL/OpenStudio-resources: Add Link
  • If needed, added VersionTranslation rules for the objects (src/osversion/VersionTranslator.cpp)
  • Verified that C# bindings built fine on Windows, partial classes used as needed, etc.
  • All new and existing tests passes
  • If methods have been deprecated, update rest of code to use the new methods

Labels:

  • If change to an IDD file, add the label IDDChange
  • If breaking existing API, add the label APIChange
  • If deemed ready, add label Pull Request - Ready for CI so that CI builds your PR

Review Checklist

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • Code Style, strip trailing whitespace, etc.
  • All related changes have been implemented: model changes, model tests, FT changes, FT tests, VersionTranslation, OS App
  • Labeling is ok
  • 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

@joseph-robertson joseph-robertson self-assigned this Jul 30, 2025
@joseph-robertson joseph-robertson added component - Model Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. labels Jul 30, 2025
Comment on lines 701 to 703
// get all surfaces, sort so results are repeatable
std::vector<Surface> surfaces = getObject<ModelObject>().getModelObjectSources<Surface>(Surface::iddObjectType());
std::sort(surfaces.begin(), surfaces.end(), IdfObjectNameLess());
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is there a significant performance hit by putting the sort here? If so, we can just sort from within the floorPrint and floorArea methods.

Copy link
Contributor

Choose a reason for hiding this comment

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

There could be a lot of surfaces in a model, but hard to imagine that there would that many for a single space.

Copy link
Collaborator Author

@joseph-robertson joseph-robertson Oct 9, 2025

Choose a reason for hiding this comment

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

f3b8970

Like floorPrint which already sorts surfaces, update floorArea to also sort surfaces. There should be less of a performance hit risk having the sort downstream of the parent surfaces method.

boost::optional<double> z;
std::vector<Surface> floors;
for (const Surface& surface : surfaces) {
for (const Surface& surface : this->surfaces()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I can see how floorPrint could be affected by order of surfaces, since it's doing geometry things with it, but the original issue says it's floorArea that was affected, and as I said at #5465 (comment) I don't see how that's possible.

@joseph-robertson joseph-robertson marked this pull request as ready for review October 9, 2025 17:35
@ci-commercialbuildings
Copy link
Collaborator

ci-commercialbuildings commented Oct 9, 2025

CI Results for f3b8970:

Comment on lines +1074 to +1079
// get all surfaces, sort so results are repeatable
std::vector<Surface> surfaces = this->surfaces();
std::sort(surfaces.begin(), surfaces.end(), IdfObjectNameLess());

double result = 0;
for (const Surface& surface : this->surfaces()) {
for (const Surface& surface : surfaces) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, so now this is the only change, and it's only done in Space_Impl::floorArea

I was asked

@jmarrec Are you ok with the approach described in #5466 (comment)?

My personnal opinion is that this is still unecessary, and this should be handled by the person trying to compare things.

At least the scope / impact is smaller here.

@joseph-robertson and @shorowit seem to be pretty set on doing it it seems, so I'll leave it up to you to hit the merge button if that's the case.

@jmarrec
Copy link
Collaborator

jmarrec commented Oct 22, 2025

I really need to clean up the number of open PRs, I'm going with the assumption that this is really wanted. Merging.

@jmarrec jmarrec merged commit 6592a5b into develop Oct 22, 2025
2 of 6 checks passed
@jmarrec jmarrec deleted the fix-floorarea-unsorted-surfaces branch October 22, 2025 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component - Model Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. severity - Minor Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The floorArea method for Space can return a non deterministic result based on order of Surfaces

5 participants