-
Notifications
You must be signed in to change notification settings - Fork 3
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
[WIP] container-level validation, add docs #19
Merged
Merged
Changes from 42 commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
90507a9
feat: use pydantic-zarr for representing multiscale groups
d-v-b 7295c26
chore: update type signature of version in latest multiscale, althoug…
d-v-b 20c4a8c
feat: update to pydantic 2 / pydantic-zarr 0.5.2
d-v-b 9c72f28
feat: pointless renaming
d-v-b 00ee033
feat: big refactor: split validators into separate functions, rename …
d-v-b dd469b6
feat: use python 3.10 as baseline, refactor the test suite a bit, use…
d-v-b 87dad87
lint
d-v-b ec6649f
feat: use a tighter module-local name convention for specialized Grou…
d-v-b 4044348
begin adding docs and convenience function for multiscale creation
d-v-b 845bf4e
docs: add mkdocs.yml
d-v-b 62ab448
merge branch "use_pydantic_zarr" from origin
d-v-b 192d6e0
tighten some names and type annotations
d-v-b 7d28336
start handling deeper arrays
d-v-b 601972b
flattening and unflattening routines for GroupSpec
d-v-b ba81fa0
fix: use tuple instead of list for transforms; defer to pydantic-zarr…
d-v-b f50108b
chore: add gha
d-v-b ae5fb4a
feat: use pydantic-zarr for representing multiscale groups
d-v-b 64fbfa8
chore: update type signature of version in latest multiscale, althoug…
d-v-b 45ce1c4
feat: update to pydantic 2 / pydantic-zarr 0.5.2
d-v-b 41bdf3f
feat: pointless renaming
d-v-b 6dab0a8
feat: big refactor: split validators into separate functions, rename …
d-v-b fb777cb
feat: use python 3.10 as baseline, refactor the test suite a bit, use…
d-v-b 02e09ee
lint
d-v-b 675992f
feat: use a tighter module-local name convention for specialized Grou…
d-v-b 2825b07
begin adding docs and convenience function for multiscale creation
d-v-b c502b36
docs: add mkdocs.yml
d-v-b 94e08dd
merge branch "use_pydantic_zarr" from origin
d-v-b 5f7b90d
tighten some names and type annotations
d-v-b 5e2cbbe
start handling deeper arrays
d-v-b 5296cce
flattening and unflattening routines for GroupSpec
d-v-b 9a226ab
fix: use tuple instead of list for transforms; defer to pydantic-zarr…
d-v-b 0887e4a
chore: add gha
d-v-b 81afac6
chore: fix broken tests
d-v-b 07b2e1e
Merge branch 'use_pydantic_zarr' of https://github.com/JaneliaSciComp…
d-v-b a365bfa
remove redundant ci
d-v-b 0087042
lint
d-v-b 007438b
ci: increment the python version used for linting
d-v-b 8b871f7
chore: use typing_extensions for self import
d-v-b 475ecca
remove extra script
d-v-b bb349cc
fix: remove support for group_scale and group_translation in Group.fr…
d-v-b c2a6831
Update pyproject.toml
d-v-b 474e541
Update poetry.lock
d-v-b ce03791
add doctests, set minimum python version to 3.9
d-v-b c7d0f3a
handle numpy arrays as arguments to and transforms
d-v-b 2af58d7
dont cast to list
d-v-b 516d35d
add multiscale creation example
d-v-b c4c1cd7
add chunking to group creation example
d-v-b a63fef5
simplify array creation in example, and remove incorrect translation
d-v-b a40f2bc
chore: depluralize module names
d-v-b 7a28df7
docs: update docs
d-v-b 0214f65
docs: more docs
d-v-b 8d0e640
test: remove unnecessary transform validation logic
d-v-b cb86c5d
docs: add links, remove unused var from examples
d-v-b a3e4b4f
bump deps, using latest version of pydantic-zarr
d-v-b 2923fdd
add chunks keyword argument to from_arrays, and corresponding normali…
d-v-b f5156b8
add from __future__ imports, and use Union instead of |
d-v-b b8e55ab
add chunks to from_array tests
d-v-b e6407f7
chore: update lockfile
d-v-b d80a120
chore: add python 3.9 to ci
d-v-b 26f1fe8
docs: fix example
d-v-b d1808e2
feat: expand function signature of from_arrays to include compressor,…
d-v-b fd0c19a
feat: use tuples instead of lists
d-v-b b5e6ba9
update tests for tuples
d-v-b 88290a4
add validation example
d-v-b 472d75e
docs
d-v-b 297338d
docstring
d-v-b e7228f7
more text about
d-v-b 53fcc82
chore: bump deps
d-v-b fa3f922
test: parametrize test_coordinate_transforms_invalid_ndims
d-v-b 9e915f7
test: shorten the names of some test functions
d-v-b File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
::: pydantic_ome_ngff.v04.axis |
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 @@ | ||
::: pydantic_ome_ngff.v04.label |
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 @@ | ||
::: pydantic_ome_ngff.v04.multiscales |
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 @@ | ||
::: pydantic_ome_ngff.v04.plate |
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 @@ | ||
::: pydantic_ome_ngff.v04.transforms |
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,19 @@ | ||
# pydantic-ome-ngff | ||
|
||
[Pydantic](https://docs.pydantic.dev/latest/) models for [OME-NGFF](https://ngff.openmicroscopy.org/) | ||
|
||
# About | ||
|
||
This library aims to provide models for the the metadata objects and Zarr hierarchies described in the [OME-NGFF](https://ngff.openmicroscopy.org/) specifications. | ||
|
||
# Reading Multiscale metadata | ||
|
||
```python | ||
# example data on S3-compatible cloud storage | ||
from pydantic_ome_ngff.v04.multiscales import Group | ||
import zarr | ||
url = "https://uk1s3.embassy.ebi.ac.uk/idr/zarr/v0.4/idr0062A/6001240.zarr" | ||
zgroup = zarr.open(url) | ||
group = Group.from_zarr(zgroup) | ||
|
||
``` |
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,63 @@ | ||
site_name: pydantic-ome-ngff | ||
site_url: https://janeliascicomp.github.io/pydantic-ome-ngff/ | ||
site_author: Davis Bennett | ||
site_description: >- | ||
Pydantic models for the OME-NGFF file format. | ||
|
||
# Repository | ||
repo_name: janeliascicomp/pydantic-ome-ngff | ||
repo_url: https://github.com/janeliascicomp/pydantic-zarr | ||
|
||
# Copyright | ||
copyright: Copyright © 2016 - 2023 HHMI / Janelia | ||
|
||
theme: | ||
features: | ||
- navigation.expand | ||
name: material | ||
palette: | ||
# Palette toggle for light mode | ||
- scheme: default | ||
toggle: | ||
icon: material/brightness-7 | ||
name: Switch to dark mode | ||
|
||
# Palette toggle for dark mode | ||
- scheme: slate | ||
toggle: | ||
icon: material/brightness-4 | ||
name: Switch to light mode | ||
|
||
nav: | ||
- About: index.md | ||
- API: | ||
- v04: | ||
- api/v04/multiscales.md | ||
- api/v04/axis.md | ||
- api/v04/transforms.md | ||
|
||
plugins: | ||
- mkdocstrings: | ||
handlers: | ||
python: | ||
options: | ||
docstring_style: numpy | ||
members_order: source | ||
separate_signature: true | ||
filters: ["!^_"] | ||
docstring_options: | ||
ignore_init_summary: true | ||
merge_init_into_class: true | ||
|
||
markdown_extensions: | ||
- pymdownx.highlight: | ||
anchor_linenums: true | ||
line_spans: __span | ||
pygments_lang_class: true | ||
- pymdownx.inlinehilite | ||
- pymdownx.snippets | ||
- pymdownx.superfences | ||
- toc: | ||
baselevel: 2 | ||
toc_depth: 4 | ||
permalink: "#" |
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# SPDX-FileCopyrightText: 2023-present Davis Vann Bennett <davis.v.bennett@gmail.com> | ||
# | ||
# SPDX-License-Identifier: MIT | ||
__version__ = "0.3.0" |
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,6 @@ | ||
from pydantic_ome_ngff.latest.axes import Axis # noqa | ||
from pydantic_ome_ngff.latest.multiscales import Multiscale # noqa | ||
from pydantic_ome_ngff.latest.imageLabel import ImageLabel # noqa | ||
from pydantic_ome_ngff.latest.well import Well # noqa | ||
from pydantic_ome_ngff.latest.plate import Plate # noqa | ||
from pydantic_ome_ngff.latest.axis import Axis # noqa | ||
from pydantic_ome_ngff.latest.multiscales import MultiscaleMetadata # noqa | ||
from pydantic_ome_ngff.latest.label import ImageLabel # noqa | ||
from pydantic_ome_ngff.latest.well import WellMeta # noqa | ||
from pydantic_ome_ngff.latest.plate import PlateMeta # noqa | ||
from pydantic_ome_ngff.latest.base import version # noqa |
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
import pydantic_ome_ngff.v04.axis as axisV04 | ||
|
||
AxisType = axisV04.AxisType | ||
|
||
|
||
class Axis(axisV04.Axis): | ||
""" | ||
Axis metadata. | ||
See https://ngff.openmicroscopy.org/latest/#axes-md | ||
|
||
Note: this metadata is unchanged from version 0.4 of the spec. | ||
""" |
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 +1,7 @@ | ||
version = "0.5-dev" | ||
from __future__ import annotations | ||
from typing import TYPE_CHECKING | ||
|
||
if TYPE_CHECKING: | ||
from typing import Literal | ||
|
||
version: Literal["0.5-dev"] = "0.5-dev" |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python 3.8 and 3.9 are still not eol. I know about some of the niceties that newer versions add, but for adoption of this package it might be a tad restrictive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a good point -- I was going by the numpy schedule here, according to which python 3.9 will not be supported after april
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try testing on 3.8 and 3.9 and see what breaks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I always forget about the numpy schedule... Honestly, out of practicality and the intended user-base (bio-image community, at least that's what I think) for me it's more important what
conda-forge
currently supports. But I would be the first to admit that I'm biased there.