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

Fix AVMList clone between different models #4065

Merged
merged 2 commits into from
Sep 14, 2020
Merged

Conversation

kbenne
Copy link
Contributor

@kbenne kbenne commented Sep 4, 2020

close #4033
close #4034

Pull request overview

  • Fixes #ISSUENUMBERHERE (IF THIS IS A DEFECT)
  • DESCRIBE PURPOSE OF THIS PULL REQUEST

Please read OpenStudio Pull Requests to better understand the OpenStudio Pull Request protocol.

Pull Request Author

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • 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)
  • Checked behavior in OpenStudioApplication, adjusted policies as needed (src/openstudio_lib/library/OpenStudioPolicy.xml)
  • 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

@kbenne kbenne requested a review from jmarrec September 4, 2020 15:50
@kbenne kbenne self-assigned this Sep 4, 2020
@kbenne
Copy link
Contributor Author

kbenne commented Sep 4, 2020

what do you think @jmarrec?

@@ -60,6 +60,8 @@ class MODEL_API AvailabilityManagerAssignmentList : public ModelObject {
*/
explicit AvailabilityManagerAssignmentList(const Loop& loop);

explicit AvailabilityManagerAssignmentList(const Model& model);
Copy link
Collaborator

@jmarrec jmarrec Sep 7, 2020

Choose a reason for hiding this comment

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

@kbenne Can we make it protected/private? Or at least ignore in the bindings... I don't like the fact that this becomes public, as users shouldn't have any business creating orphaned ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah. I can do that. note that even if you use AvailabilityManagerAssignmentList(const Loop& loop) the new AVM is still orphaned. The loop argument is actually only used to set the name of the AVM. This itself should probably be considered a bug.

this->setName(loop.name().get() + " AvailabilityManagerAssignmentList");

Copy link
Collaborator

@jmarrec jmarrec Sep 14, 2020

Choose a reason for hiding this comment

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

I suppose to some extent and to echo #4077 AvailabilityManagerAssignmentList doesn't really have any business having a name in the OSM since the user isn't meant to interact with it... It could be created at FT time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jmarrec you are certainly welcome to add to the list of objects in #4077 to "un-name" If it is not user facing then I think it is fair game. For those that have non uuid names, and perhaps even those that do, I would anticipate a performance advantage.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Certainly users will appreciate having nice names in the finished EnergyPlus idf. AVMlist named after the loop it belongs to etc.

@tijcolem tijcolem added the Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. label Sep 11, 2020
@tijcolem tijcolem added this to the OpenStudio SDK 3.1.0 milestone Sep 11, 2020
@kbenne kbenne merged commit ed2a80e into develop Sep 14, 2020
@kbenne kbenne deleted the 4034-AVMList-Clone branch September 14, 2020 21:03
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 - Major Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Limited functionality of clone PlantLoop Limited functionality of clone AirLoopHVAC
4 participants