Skip to content

Commit

Permalink
feat: Add --load/--no-load
Browse files Browse the repository at this point in the history
Fixes #32
  • Loading branch information
pmav99 committed Aug 30, 2024
1 parent f089458 commit 54e30d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions inspectds/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ def inspect_dataset(
variable_attributes: bool = typer.Option(default=False, help="Whether to include the variable attributes in the output"),
global_attributes: bool = typer.Option(default=False, help="Whether to include the global attributes in the output"),
full: bool = typer.Option(default=False, help="Display full output. Overrides any other option"),
load: bool = typer.Option(default=False, help="Load the data from disk. Only use on small datasets"),
version: bool = typer.Option(False, "--version", help="Display the version", callback=version_callback, is_eager=True),
) -> int: # fmt: skip
import xarray as xr
Expand Down Expand Up @@ -227,6 +228,9 @@ def inspect_dataset(
for coord in ds.coords:
ds[coord].load()

if load:
ds = ds.load()

if full:
dimensions = coordinates = variables = variable_attributes = global_attributes = True

Expand Down

0 comments on commit 54e30d5

Please sign in to comment.