(
paths: NestedSequence[_FLike], paths_to_remove: set[_FLike]
)
| 1352 | |
| 1353 | |
| 1354 | def _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 | |
| 1373 | def open_mfdataset( |
no outgoing calls
no test coverage detected
searching dependent graphs…