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

add method to fetch subsubgroups using path #112

Closed
wants to merge 1 commit into from
Closed

add method to fetch subsubgroups using path #112

wants to merge 1 commit into from

Conversation

AntoineRenaud91
Copy link

"netcdf::File" and "netcdf::Group" now have two new methods called "group_from_path" and "group_mut_from_path" which make use of the new function "netcdf::groups::group_from_path" to fetch directly a deeper subgroup without walking down the subgroups tree and having to manage all group instantiations. It using the linux path format for folders e.g. "path/to/my/folder"

BEFORE:

let file = netcdf::open("my_netcdf.nc");
let group = file.group("my_group").unwrap();
let subgroup = group.group("my_subgroup").unwrap();
let subsubgroup = subgroup.group("my_subsubgroup").unwrap();

AFTER:
let file = netcdf::open("my_netcdf.nc");
let subsubgroup = file.group_from_path("my_group/my_subgroup/my_subsubgroup").unwrap();

…th in the form 'subgroup/subsubgroup/subsubsubgroup...' using '/' as separator
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.

1 participant