-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
93 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Run tests | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: | ||
- "3.11" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
run: uv python install ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: uv sync --all-extras --dev | ||
|
||
- name: Run tests | ||
# For example, using `pytest` | ||
run: uv run pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,55 @@ | ||
# # Tutorial | ||
|
||
from ome_zarr_models.v04 import Image as OMEZarrImage | ||
# from ome_zarr_models.v04 import Image as OMEZarrImage | ||
|
||
my_image = OMEZarrImage(path="path/to/ome/zarr/directory.ome.zarr") | ||
print(my_image.multiscales) | ||
# my_image = OMEZarrImage(path="path/to/ome/zarr/directory.ome.zarr") | ||
# print(my_image.multiscales) | ||
|
||
# ## Creating | ||
# | ||
# TODO: exmaple of creating a model from a remote store | ||
# TODO: example of | ||
|
||
import gcsfs | ||
import zarr.storage | ||
import zarr | ||
|
||
bucket = "ucl-hip-ct-35a68e99feaae8932b1d44da0358940b" | ||
fs = gcsfs.GCSFileSystem(project=bucket, token="anon", access="read_only") | ||
store = zarr.storage.FSStore(url=bucket, fs=fs) | ||
group = zarr.open_group( | ||
store=store, path="S-20-28/heart/25.27um_complete-organ_bm05.ome.zarr" | ||
) | ||
print(group) | ||
exit() | ||
|
||
# ## Updating models | ||
# | ||
# All the fields in the models can be updated in place. | ||
# When you do this, any validation on the individual field | ||
# you are updating will take place. | ||
# | ||
# For example, we can [do something valid]: | ||
|
||
|
||
# but if you try and [do something invalid] it raises an error: | ||
|
||
# This means validation happens early, allowing you to catch errors | ||
# before getting too far. | ||
|
||
# ## Writing metadata | ||
# | ||
# TODO: example of writing out the metadata again | ||
|
||
# ## Accessing data | ||
# | ||
# Although these models do not handle reading or writing data, | ||
# they do expose the zarr arrays. | ||
|
||
# ## Not using validation | ||
# | ||
# If you *really* want to create models that are not validated against | ||
# the OME-zarr specifciation, you can use the ``model_construct`` method. | ||
# For example: | ||
|
||
# Put some bad code here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters