MCPcopy Index your code
hub / github.com/pydata/xarray / _remove_path

Function _remove_path

xarray/backends/api.py:1354–1370  ·  view source on GitHub ↗
(
    paths: NestedSequence[_FLike], paths_to_remove: set[_FLike]
)

Source from the content-addressed store, hash-verified

1352
1353
1354def _remove_path(
1355 paths: NestedSequence[_FLike], paths_to_remove: set[_FLike]
1356) -> NestedSequence[_FLike]:
1357 # Initialize an empty list to store the result
1358 result: list[Union[_FLike, NestedSequence[_FLike]]] = []
1359
1360 for item in paths:
1361 if isinstance(item, list):
1362 # If the current item is a list, recursively call remove_elements on it
1363 nested_result = _remove_path(item, paths_to_remove)
1364 if nested_result: # Only add non-empty lists to avoid adding empty lists
1365 result.append(nested_result)
1366 elif item not in paths_to_remove:
1367 # Add the item to the result if it is not in the set of elements to remove
1368 result.append(item)
1369
1370 return result
1371
1372
1373def open_mfdataset(

Callers 1

open_mfdatasetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…