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

Simplify HY_Features_MPI via subclassing #668

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hellkite500
Copy link
Member

@hellkite500 hellkite500 commented Nov 2, 2023

Maintaining the HY_Features_MPI collection class as a completely independent unit seems to have lead to significant code duplication and has been the source of some errors in previous work, e.g. layers. This PR attempts to isolate the logic specific to the MPI collection and reuse the base components as much as possible.

Changes

  • Make HY_Features_MPI a true subclass of HY_Features_MPI and remove redundant code

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code can be automatically merged (no conflicts)
  • Code follows project standards (link if applicable)
  • Passes all existing automated tests
  • Any change in functionality is tested
  • New functions are documented (with a description, list of inputs, and expected output)
  • Placeholder code is flagged / future todos are captured in comments
  • Project documentation has been updated (including the "Unreleased" section of the CHANGELOG)
  • Reviewers requested with the Reviewers tool ➡️

Target Environment support

  • Linux
  • MacOS

Copy link
Contributor

@donaldwj donaldwj left a comment

Choose a reason for hiding this comment

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

Looks good

Comment on lines 34 to 35
std::unordered_map<std::string, std::shared_ptr<HY_Catchment>> _catchments;
std::unordered_map<std::string, std::shared_ptr<HY_PointHydroNexusRemote>> _nexuses;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this class now inherits from HY_Features, shouldn't these be protected in that class and these removed? I think this shadows those variables, but there are two "instances" of _catchments in this class now IIRC, just one of them is not accessible (I could be wrong here haha)

Copy link
Contributor

Choose a reason for hiding this comment

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

I missed that, only looked at the changes but this is correct.

@PhilMiller
Copy link
Contributor

How's the test coverage on this? Automated and/or manual?

Copy link
Contributor

@donaldwj donaldwj left a comment

Choose a reason for hiding this comment

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

Please change HY_Features and HY_Features_MPI so that the child class does not shadow base class variables for nexus and catchments,

@program-- program-- changed the title Simplify mpi collection Simplify HY_Features_MPI via subclassing Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants