xarray_io

File Purpose: tools for saving/reading xarrays.

(xarray builtins fail for coords with dtype=object.)

Functions

_to_netcdf_engine_and_encoding_kws(array, ...)

return dict of values for engine and encoding, based on inputs,

_xarray_best_save_engine()

returns the best engine (as a str) to use for xarray save operation.

_xarray_coord_deserializations(serial)

return dict of coords, deserialized (result has XarrayIoSerializable objects).

_xarray_coord_serializations(array)

return serializations dict, for all array coords made of XarrayIoSerializable objects.

_xarray_encoding_from_compress_dict(array, ...)

returns encoding dict for this array (or dataset), to apply compress_dict to every var.

_xarray_engine_compression_defaults(engine)

returns dict of default compression settings, or None if this engine can't do compression.

_xarray_expand_dict_attrs(array)

return array with all dict-valued attrs expanded into separate attrs,

_xarray_io_filepaths(filename, *[, exist_ok])

return dict of strs for folder, basename (without extension), netcdf_file, text_file, notes_file.

_xarray_reset_multi_indexes(array)

return array with all MultiIndex indexes reset, and relevant info added to array.attrs.

_xarray_restore_multi_indexes(array)

return array with MultiIndex indexes restored, based on 'reset_multi_index:{d}' attrs.

_xarray_save_prep(array, *[, exist_ok, ...])

return array (prepped for saving), serializations, and to_netcdf kwargs.

_xarray_stringify_bool_attrs(array)

return array with all bool(or None)-valued attrs replaced with strings,

_xarray_unexpand_dict_attrs(array)

return array with all expanded-dict-valued attrs unexpanded back into dicts.

_xarray_unstringify_bool_attrs(array)

return array with all stringified-bool(or None)-valued attrs replaced with bools (or None).

xarray_load(filename, *[, ...])

load the array or dataset from filename.pcxarr.

xarray_mergeload(dirpath, *[, verbose, ...])

xarray_load all .pcxarr files from dirpath, then xr.merge() the results.

xarray_save(array[, filename, exist_ok, ...])

saves the array or dataset as filename.nc with a companion text file filename.txt.

Classes

XarrayIoSerializable()

object that can be serialized when saving/reading xarrays.