Skip to content

Conversation

@jmarrec
Copy link
Collaborator

@jmarrec jmarrec commented Mar 20, 2025

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

@jmarrec jmarrec added severity - Normal Bug component - Version Translator Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. labels Mar 20, 2025
@jmarrec jmarrec self-assigned this Mar 20, 2025
Comment on lines +4608 to +4613
TEST_F(OSVersionFixture, can_still_load_older_components) {
// see #4994 - Old materials OSC (< 0.7.4) cannot be loaded anymore
openstudio::path p = resourcesPath() / toPath("osversion/0_7_0/Brick_Fired_Clay_4_in_130_lb_ft3.osc");
osversion::VersionTranslator vt;
boost::optional<model::Component> comp_ = vt.loadComponent(p);
ASSERT_TRUE(comp_) << "Failed to load Component " << p;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fails before fix.

Comment on lines +519 to 521
if (m_isComponent && (is_component_update_needed || (lastVersion > VersionString(0, 7, 4)))) {
is_component_update_needed = true;
updateComponentData(idfFile);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Start updating component stuff only after 0.7.4

Copy link
Collaborator

@joseph-robertson joseph-robertson left a comment

Choose a reason for hiding this comment

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

I'm out of depth here. Why does the version need to be > 0.7.4 to update component data? Is this because as of 0.7.4 the idd is without OS:ComponentData:Attributes and OS:ComponentData:Tags objects? Shouldn't we be updating components starting with 0.7.4?

@jmarrec
Copy link
Collaborator Author

jmarrec commented Mar 31, 2025

Yes, there is something specific related to Components

std::string VersionTranslator::update_0_7_3_to_0_7_4(const IdfFile& idf_0_7_3, const IddFileAndFactoryWrapper& idd_0_7_4) {

updateComponentData deals with the extensible groups, removing anything you may have removed from it.

@jmarrec jmarrec merged commit 7a5dcdc into develop Mar 31, 2025
5 of 6 checks passed
@jmarrec jmarrec deleted the 4994-LoadOlderOSC branch March 31, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Old materials OSC (< 0.7.4) cannot be loaded anymore

4 participants