From 0d4a0f7a45d91b41c339ed361c49f27dc1565a88 Mon Sep 17 00:00:00 2001 From: Eugene M Date: Thu, 5 Sep 2024 15:03:38 -0400 Subject: [PATCH] ENH: support for datetime types --- tiled/_tests/test_zarr.py | 4 +++- tiled/server/zarr.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tiled/_tests/test_zarr.py b/tiled/_tests/test_zarr.py index d5e4db772..c3fa49256 100644 --- a/tiled/_tests/test_zarr.py +++ b/tiled/_tests/test_zarr.py @@ -32,9 +32,11 @@ "dtype_c": (numpy.arange(10) * 1j).astype("c"), "dtype_S": numpy.array([letter * 3 for letter in string.ascii_letters], dtype="S3"), "dtype_U": numpy.array([letter * 3 for letter in string.ascii_letters], dtype="U3"), + "dtype_m": numpy.array(['2007-07-13', '2006-01-13', '2010-08-13'], dtype='datetime64') - numpy.datetime64('2008-01-01'), + "dtype_M": numpy.array(['2007-07-13', '2006-01-13', '2010-08-13'], dtype='datetime64'), "random_2d": rng.random((10, 10)), } -# TODO "datetime64", bitfield "t", void "v", and object "O" (which is not supported by default) +# TODO bitfield "t", void "v", and object "O" (which is not supported by default) scalar_cases = { k: numpy.array(v[0], dtype=v.dtype) for k, v in array_cases.items() diff --git a/tiled/server/zarr.py b/tiled/server/zarr.py index d6007d976..f62fd5d9b 100644 --- a/tiled/server/zarr.py +++ b/tiled/server/zarr.py @@ -76,6 +76,7 @@ "id": "blosc", "shuffle": 1, } +ZARR_DATETIME64_PRECISION = 'ns' import numcodecs