dctools.dcio.loader.FileLoader

class dctools.dcio.loader.FileLoader

Utilities for loading datasets from various file formats.

__init__()

Methods

__init__()

open_dataset_auto(file_path[, ...])

Load a dataset with Dask-safe configurations and optional adaptive chunking.

static open_dataset_auto(file_path, adaptive_chunking=False, groups=None, engine='h5netcdf', variables=None, dask_safe=True, target_chunk_mb=128, file_storage=None, reading_retries=3)

Load a dataset with Dask-safe configurations and optional adaptive chunking.

Parameters:
  • file_path (str) – Path to the file.

  • adaptive_chunking (bool) – Whether to auto-tune chunks.

  • groups (Optional[list[str]]) – NetCDF groups to load.

  • engine (Optional[str]) – Engine to use.

  • variables (Optional[list[str]]) – Variables to keep.

  • dask_safe (bool) – Whether to use Dask-safe configurations.

  • target_chunk_mb (int) – Target chunk size in MB (for adaptive mode).

  • file_storage (Any | None)

  • reading_retries (int | None)

Returns:

Loaded dataset or None if error.

Return type:

xr.Dataset | None