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

NGFF json validation #69

Merged
merged 35 commits into from
Nov 26, 2021
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
8dc1066
First version of salad for multiscales
joshmoore Apr 17, 2021
1767c28
Use @import to reference image in collection
will-moore Oct 25, 2021
e94dc27
Use '@id' to link images in collection
will-moore Oct 25, 2021
2535142
Try subclasses of Collection and ListItem
will-moore Oct 25, 2021
f96934d
Collection subclass ImageCollection must contain Images
will-moore Oct 26, 2021
5d91854
Handle optional fields and add 'omero' metadata
will-moore Oct 27, 2021
49db008
Ensure axes is list of x,y,z,c,t
will-moore Oct 27, 2021
0f57182
Add Label metadata support
will-moore Oct 27, 2021
44f8691
Testing json_schema
will-moore Nov 12, 2021
5bb9fb4
Add valid and invalid examples and test_json_schema.py to test. All p…
will-moore Nov 17, 2021
af828c1
Nest 'omero' schema inside image.schema
will-moore Nov 17, 2021
7aac64d
Add test_salad_schema.py. Fails to check for empty lists
will-moore Nov 17, 2021
a2904a3
Shacl infrastructure
joshmoore Nov 18, 2021
38ac6f2
All tests now in test_validation
joshmoore Nov 18, 2021
1344cf5
drop non-top-level @types
joshmoore Nov 18, 2021
b0d5b57
Inject @type statements with framing
joshmoore Nov 18, 2021
13af8ad
Add v0.2 example no axes. Valid with salad and json-schema
will-moore Nov 19, 2021
d81f09b
Add invalid examples of missing or single axes
will-moore Nov 19, 2021
dec24aa
Add invalid_axes_order.json
will-moore Nov 19, 2021
10516dc
shacl.ttl minCount 2 for axes
will-moore Nov 23, 2021
206a3c8
Attempt at collections validation with JSON-schema
will-moore Nov 23, 2021
93bd268
Require version 0.3
joshmoore Nov 24, 2021
06e8040
Disable salad and axes_order check
joshmoore Nov 24, 2021
f19e99c
Migrate files into 0.3
joshmoore Nov 24, 2021
c81a1cd
Mark v0.2 as invalid
joshmoore Nov 24, 2021
9c37a3e
Remove top-level salad example
joshmoore Nov 24, 2021
86a1adb
Fix tests to use subdir and run httpserver
joshmoore Nov 24, 2021
26331c0
remove collections from 0.3
joshmoore Nov 24, 2021
e871e82
skip json_schema v0.2 test
joshmoore Nov 24, 2021
e9bc4b3
add 0.3/tox.ini and GHA workflow
joshmoore Nov 24, 2021
9abb74f
Fix template expansion in workflow
joshmoore Nov 24, 2021
b65bf5a
Treat image_v0.2.json as valid. skip for jsonld
will-moore Nov 24, 2021
b8775b7
Remove unused omero.schema.json
will-moore Nov 24, 2021
d367d54
Delete unused collection.schema
will-moore Nov 24, 2021
dd312a8
Try matrix.node syntax
joshmoore Nov 26, 2021
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
21 changes: 21 additions & 0 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Validation
on:
push:
pull_request:

jobs:

validate:
name: Validation
strategy:
matrix:
ngff-version:
- '0.3'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- run: python -mpip install --upgrade wheel tox
- run: cd ${{ngff-version}} && tox
joshmoore marked this conversation as resolved.
Show resolved Hide resolved
22 changes: 22 additions & 0 deletions 0.3/examples/invalid/invalid_axes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"@id": "#my-image",
"@type": "ngff:Image",
"multiscales": [
{
"@id": "#my-pyramid",
"version": "0.3",
"name": "example",
"datasets": [
{
"@id": "#my-full-resolution",
"path": "path/to/0"
}
],
"axes": [
"z",
"y",
"ct"
]
}
]
}
20 changes: 20 additions & 0 deletions 0.3/examples/invalid/invalid_axes_count.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"@id": "#my-image",
"@type": "ngff:Image",
"multiscales": [
{
"@id": "#my-pyramid",
"version": "0.3",
"name": "example",
"datasets": [
{
"@id": "#my-full-resolution",
"path": "path/to/0"
}
],
"axes": [
"y"
]
}
]
}
22 changes: 22 additions & 0 deletions 0.3/examples/invalid/invalid_axes_order.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"@id": "#my-image",
"@type": "ngff:Image",
"multiscales": [
{
"@id": "#my-pyramid",
"version": "0.3",
"name": "example",
"datasets": [
{
"@id": "#my-full-resolution",
"path": "path/to/0"
}
],
"axes": [
"y",
"t",
"c"
]
}
]
}
36 changes: 36 additions & 0 deletions 0.3/examples/invalid/invalid_channels_color.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"datasets": [
{
"path": "path/to/0"
}
],
"axes": [
"z",
"y",
"x"
]
}
],
"omero": {
"channels": [
{
"active": true,
"coefficient": 1.0,
"color": 255,
"family": "linear",
"label": "1234",
"window": {
"end": 1765.0,
"max": 2555.0,
"min": 5.0,
"start": 0.0
}
}
]
}
}
36 changes: 36 additions & 0 deletions 0.3/examples/invalid/invalid_channels_window.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"datasets": [
{
"path": "path/to/0"
}
],
"axes": [
"z",
"y",
"x"
]
}
],
"omero": {
"channels": [
{
"active": true,
"coefficient": 1.0,
"color": "ff0000",
"family": "linear",
"label": "1234",
"window": {
"end": "100",
"max": 2555.0,
"min": 5.0,
"start": 0.0
}
}
]
}
}
22 changes: 22 additions & 0 deletions 0.3/examples/invalid/invalid_path.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"datasets": [
{
"path": "path/to/0"
},
{
"path": 0
}
],
"axes": [
"z",
"y",
"x"
]
}
]
}
14 changes: 14 additions & 0 deletions 0.3/examples/invalid/missing_axes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"datasets": [
{
"path": "path/to/0"
}
]
}
]
}
14 changes: 14 additions & 0 deletions 0.3/examples/invalid/missing_datasets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"axes": [
"z",
"y",
"x"
]
}
]
}
33 changes: 33 additions & 0 deletions 0.3/examples/invalid/missing_name.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"datasets": [
{
"path": "path/to/0"
},
{
"path": 0
}
],
"type": "gaussian",
"metadata": {
"method": "skimage.transform.pyramid_gaussian",
"version": "0.16.1",
"args": [
"true",
"false"
],
"kwargs": {
"multichannel": true
}
},
"axes": [
"z",
"y",
"x"
]
}
]
}
22 changes: 22 additions & 0 deletions 0.3/examples/invalid/missing_path.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"datasets": [
{
"foo": "path/to/0"
},
{
"path": "1"
}
],
"axes": [
"z",
"y",
"x"
]
}
]
}
18 changes: 18 additions & 0 deletions 0.3/examples/invalid/missing_version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"name": "example",
"datasets": [
{
"path": "path/to/0"
}
],
"axes": [
"z",
"y",
"x"
]
}
]
}
15 changes: 15 additions & 0 deletions 0.3/examples/invalid/no_axes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"datasets": [
{
"path": "path/to/0"
}
],
"axes": []
}
]
}
15 changes: 15 additions & 0 deletions 0.3/examples/invalid/no_datasets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"datasets": [],
"axes": [
"z",
"y",
"x"
]
}
]
}
4 changes: 4 additions & 0 deletions 0.3/examples/invalid/no_multiscales.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"@type": "ngff:Image",
"multiscales": []
}
17 changes: 17 additions & 0 deletions 0.3/examples/valid/image.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"@type": "ngff:Image",
"multiscales": [
{
"version": "0.3",
"name": "example",
"datasets": [
{"path": "path/to/0"},
{"path": "1"},
{"path": "2"}
],
"axes": [
"z", "y", "x"
]
}
]
}
33 changes: 33 additions & 0 deletions 0.3/examples/valid/image_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"@id": "top",
"@type": "ngff:Image",
"multiscales": [
{
"@id": "inner",
"version": "0.3",
"name": "example",
"datasets": [
{
"path": "path/to/0"
}
],
"type": "gaussian",
"metadata": {
"method": "skimage.transform.pyramid_gaussian",
"version": "0.16.1",
"args": [
"true",
"false"
],
"kwargs": {
"multichannel": true
}
},
"axes": [
"z",
"y",
"x"
]
}
]
}
Loading