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

Child NodePath's #112

Merged
merged 1 commit into from
Dec 28, 2024
Merged

Child NodePath's #112

merged 1 commit into from
Dec 28, 2024

Conversation

niklasmueboe
Copy link
Contributor

Add functions to get the NodePaths for the children of a Group.

Originally, the idea was to get the NodeNames. However, with the recursive option the name is ambiguous because the prefix is unknown. One consideration would be to get the relative path starting at the current Group, but currently there is no data structure for that and it may not be worth creating one for that use case. It would also be possible to just use a normal String for the relative path.

Thoughts?

Copy link

codecov bot commented Dec 25, 2024

Codecov Report

Attention: Patch coverage is 0% with 33 lines in your changes missing coverage. Please review.

Project coverage is 81.58%. Comparing base (4154697) to head (c4f2241).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
zarrs/src/group.rs 0.00% 30 Missing ⚠️
zarrs/src/node.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #112      +/-   ##
==========================================
- Coverage   81.71%   81.58%   -0.14%     
==========================================
  Files         166      166              
  Lines       23578    23611      +33     
==========================================
- Hits        19267    19263       -4     
- Misses       4311     4348      +37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@LDeakin
Copy link
Owner

LDeakin commented Dec 25, 2024

The methods introduced in this PR look good if you are happy with them.

Originally, the idea was to get the NodeNames. However, with the recursive option the name is ambiguous because the prefix is unknown. One consideration would be to get the relative path starting at the current Group, but currently there is no data structure for that and it may not be worth creating one for that use case.

Yeah, I don't think such a structure is needed especially since a relative path isn't really consumable elsewhere in this library. At least with your new APIs that can grab nodes/node paths, you could just use something like node.path().as_str().strip_prefix(group.path().as_str()) to get relative paths as strings.

@niklasmueboe
Copy link
Contributor Author

Then I think it should be good for now.

@LDeakin LDeakin marked this pull request as ready for review December 28, 2024 11:44
@LDeakin LDeakin self-requested a review as a code owner December 28, 2024 11:44
@LDeakin LDeakin merged commit 732e77b into LDeakin:main Dec 28, 2024
22 checks passed
LDeakin added a commit that referenced this pull request Dec 28, 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.

2 participants