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

Hydrofabric refactor to support latest hydrofabric data model #665

Merged
merged 9 commits into from
Nov 1, 2023

Conversation

hellkite500
Copy link
Member

Properly handle latest stable hydrofabric representations based on the hydrfabric datamodel.

Closes #619 #649

I believe this also address some of the segmentation faults reported, and I expect this to resolve
#658
CIROH-UA/NGIAB-CloudInfra#21
Since the segfault (based on the valgrind backtrace in #658) is showing the fault happening when accessing a nexus (that was a nullptr). This PR should prevent that nexus from being null, and if it is, should should throw an approriate runtime error.

Allows #604 and #659 to be addressed by simply doing

collection.update_ids("id");

after the nexus and catchment collections are read and combined (in whatever format)

This may partially and/or indirectly address #529

Additions

  • hy_features::identifiers namespace with static representations of hydrofabric feature identity prefixes and some helper functions for determining if an identifier represents a particular concept.

Removals

Changes

  • Allow a FeatureCollection to maintain an identity map for an alternate id, e.g. both divide_id and id
  • Refactor and revert hy_features constructor delegation

Testing

  1. All existing relevant tests passing locally

Todos

  • Add some unit test coverage of Feature::get_id(const std::string& alt_id) and FeatureCollection update_ids( const std::string& alt_id )

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

@program-- program-- left a comment

Choose a reason for hiding this comment

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

Just a few small changes/clarification. Other than that, it looks good to me.

include/core/HY_Features.hpp Show resolved Hide resolved
src/core/HY_Features.cpp Outdated Show resolved Hide resolved
src/core/HY_Features.cpp Outdated Show resolved Hide resolved
src/geojson/FeatureCollection.cpp Outdated Show resolved Hide resolved
@hellkite500 hellkite500 linked an issue Nov 1, 2023 that may be closed by this pull request
@hellkite500 hellkite500 merged commit 33d76a1 into NOAA-OWP:master Nov 1, 2023
19 checks passed

destinations = network.get_destination_ids(feat_id);
if(feat_type == "cat" || feat_type == "agg")
Copy link
Contributor

Choose a reason for hiding this comment

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

I just noticed - this same change (and the one below in else if) should have been made for HY_Features_MPI as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fix in #674

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.

Catchment subset CLI arguments still uses id field after #625 Adapt codebase to new Hydrofabric format
3 participants