Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More fixes to the DataSource registration how-to giude #691

Merged
merged 4 commits into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docs/source/how-to/register.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -86,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
Expand All @@ -102,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:///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),
],
),
],
Expand Down
Loading