From 9cec3ff52ab7396e85e0594c21e684ad85e9e5a2 Mon Sep 17 00:00:00 2001 From: Dan Allan Date: Tue, 12 Mar 2024 16:53:28 -0400 Subject: [PATCH 1/4] Add missing numpy import --- docs/source/how-to/register.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/how-to/register.md b/docs/source/how-to/register.md index 62411c72f..336488d65 100644 --- a/docs/source/how-to/register.md +++ b/docs/source/how-to/register.md @@ -75,6 +75,7 @@ about the files to specify particular `metadata` or `specs`. Use the Python client, as in this example. ```py +import numpy from tiled.client import from_uri from tiled.structures.core import StructureFamily from tiled.structures.data_source import Asset, DataSource, Management From 6f8b82e19f24b04310be88f21322a33f021d9932 Mon Sep 17 00:00:00 2001 From: Dan Allan Date: Tue, 12 Mar 2024 16:53:50 -0400 Subject: [PATCH 2/4] Create numpy dtype correctly --- docs/source/how-to/register.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/how-to/register.md b/docs/source/how-to/register.md index 336488d65..e4e1c01e8 100644 --- a/docs/source/how-to/register.md +++ b/docs/source/how-to/register.md @@ -87,7 +87,7 @@ from tiled.structures.array import ArrayStructure, BuiltinDtype client = from_uri("http://localhost:8000", api_key="...") structure = ArrayStructure( - dtype=BuiltinDtype.from_numpy_dtype(numpy.int32), + data_type=BuiltinDtype.from_numpy_dtype(numpy.dtype('int32')), shape=(2, 512, 512), chunks=((1, 1), (512,), (512,)), dims=("time", "x", "y"), # optional From b94776d61e6dd65e0c42a111ed922a18c7cdca99 Mon Sep 17 00:00:00 2001 From: Dan Allan Date: Tue, 12 Mar 2024 16:53:57 -0400 Subject: [PATCH 3/4] Include all required arguments for Asset. --- docs/source/how-to/register.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/how-to/register.md b/docs/source/how-to/register.md index e4e1c01e8..9e5d6cb57 100644 --- a/docs/source/how-to/register.md +++ b/docs/source/how-to/register.md @@ -103,8 +103,8 @@ client.new( structure_family=StructureFamily.array, structure=structure, assets=[ - Asset(data_uri="file:///...", num=1), - Asset(data_uri="file:///...", num=2), + Asset(data_uri="file:///...", is_directory=False, parameter="data_uri", num=1), + Asset(data_uri="file:///...", is_directory=False, parameter="data_uri", num=2), ], ), ], From 40012b9ef40749840abcb5e320814cb9d798e19a Mon Sep 17 00:00:00 2001 From: Dan Allan Date: Tue, 12 Mar 2024 18:40:07 -0400 Subject: [PATCH 4/4] Use valid paths. --- docs/source/how-to/register.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/how-to/register.md b/docs/source/how-to/register.md index 9e5d6cb57..2ca73f068 100644 --- a/docs/source/how-to/register.md +++ b/docs/source/how-to/register.md @@ -103,8 +103,8 @@ client.new( structure_family=StructureFamily.array, structure=structure, assets=[ - Asset(data_uri="file:///...", is_directory=False, parameter="data_uri", num=1), - Asset(data_uri="file:///...", is_directory=False, parameter="data_uri", num=2), + Asset(data_uri="file:///path/to/image1.tiff", is_directory=False, parameter="data_uri", num=1), + Asset(data_uri="file:///path/to/image2.tiff", is_directory=False, parameter="data_uri", num=2), ], ), ],