Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_json_object_array(self):
for chunks in [1, 2, 5, 10, 100]:
n = 10
z = zarr.empty(
n, dtype=object, object_codec=numcodecs.JSON(), chunks=(chunks,)
)
for j in range(n):
z[j] = {str(k): k for k in range(j)}
self.filter_warnings_verify_round_trip({"z": z})
def test_empty_string_list(self):
z = zarr.empty(1, dtype=object, object_codec=numcodecs.JSON(), chunks=(2,))
z[0] = ["", ""]
self.filter_warnings_verify_round_trip({"z": z})
def test_ragged_array_int32(self):
n = 10
z = zarr.empty(n, dtype="array:i4")
for j in range(n):
z[j] = np.arange(j)
self.filter_warnings_verify_round_trip({"z": z})
def test_square_object_array_int32(self):
n = 10
z = zarr.empty(n, dtype="array:i4")
for j in range(n):
z[j] = np.arange(n)
self.filter_warnings_verify_round_trip({"z": z})