MCPcopy Index your code
hub / github.com/pydata/xarray / _handle_zarr_version_or_format

Function _handle_zarr_version_or_format

xarray/backends/zarr.py:1996–2013  ·  view source on GitHub ↗

handle the deprecated zarr_version kwarg and return zarr_format

(
    *, zarr_version: ZarrFormat | None, zarr_format: ZarrFormat | None
)

Source from the content-addressed store, hash-verified

1994
1995
1996def _handle_zarr_version_or_format(
1997 *, zarr_version: ZarrFormat | None, zarr_format: ZarrFormat | None
1998) -> ZarrFormat | None:
1999 """handle the deprecated zarr_version kwarg and return zarr_format"""
2000 if (
2001 zarr_format is not None
2002 and zarr_version is not None
2003 and zarr_format != zarr_version
2004 ):
2005 raise ValueError(
2006 f"zarr_format {zarr_format} does not match zarr_version {zarr_version}, please only set one"
2007 )
2008 if zarr_version is not None:
2009 emit_user_level_warning(
2010 "zarr_version is deprecated, use zarr_format", FutureWarning
2011 )
2012 return zarr_version
2013 return zarr_format
2014
2015
2016BACKEND_ENTRYPOINTS["zarr"] = ("zarr", ZarrBackendEntrypoint)

Callers 1

_get_open_paramsFunction · 0.85

Calls 1

emit_user_level_warningFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…