handle the deprecated zarr_version kwarg and return zarr_format
(
*, zarr_version: ZarrFormat | None, zarr_format: ZarrFormat | None
)
| 1994 | |
| 1995 | |
| 1996 | def _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 | |
| 2016 | BACKEND_ENTRYPOINTS["zarr"] = ("zarr", ZarrBackendEntrypoint) |
no test coverage detected
searching dependent graphs…