From db217418305813cfbce7a72911137b06e284e518 Mon Sep 17 00:00:00 2001 From: Ian Langmore Date: Mon, 6 May 2024 09:09:59 -0700 Subject: [PATCH] No public description PiperOrigin-RevId: 631081462 --- scripts/slice_dataset.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/slice_dataset.py b/scripts/slice_dataset.py index 9c7b18a..7ed2b84 100644 --- a/scripts/slice_dataset.py +++ b/scripts/slice_dataset.py @@ -75,7 +75,7 @@ None, help=( 'Comma delimited list of variables to drop. If empty, drop no' - ' variables.' + ' variables. List may include data variables or coords.' ), ) @@ -83,7 +83,7 @@ 'keep_variables', None, help=( - 'Comma delimited list of variables to keep. If empty, use' + 'Comma delimited list of data variables to keep. If empty, use' ' --drop_variables to determine which variables to keep' ), ) @@ -143,7 +143,7 @@ def main(argv: abc.Sequence[str]) -> None: ds, input_chunks = xbeam.open_zarr(INPUT_PATH.value) if DROP_VARIABLES.value: - ds = ds[[v for v in ds if v not in DROP_VARIABLES.value]] + ds = ds.drop_vars(DROP_VARIABLES.value) elif KEEP_VARIABLES.value: ds = ds[KEEP_VARIABLES.value]