Skip to main content

Conformance tests for OME-Zarr transformations

Project description

ome-zarr-transformations-conformance

Test fixtures for RFC-5 transformations for OME-Zarr.

Structure

Each directory in ./cases/ represents a test case. It is an OME-Zarr Scene; it contains a zarr.json whose attributes contains an ome object which itself contains a scene object as described by the OME-Zarr v0.6+ specification. This scene contains a transform graph.

The dingus

Implementations of OME-Zarr transformations should provide a "dingus" CLI whose last 4 positional arguments MUST be:

  • PATH: a path to an OME-Zarr hierarchy on the file system
  • SOURCE: the name of the source coordinate system
  • TARGET: the name of the target coordinate system
  • COORDINATES: a JSON-serialised array of D-length arrays of numbers, where D is the dimensionality of a single coordinates

The dingus MUST then

  1. open the OME-Zarr hierarchy at PATH and parse the $.ome.scene from the attributes
  2. calculate a transformation from the coordinate system with name specified by SOURCE to the coordinate system with name specified by TARGET (this may require inverting one or more transforms)
  3. apply this transformation to the COORDINATES array
  4. print to STDOUT a JSON-serialised Response object
  5. exit with status code 0

If any of the above steps are not supported by the implementation, the dingus MUST exit with a status code other than 0. It MAY print to STDOUT a JSON-serialised Error object.

Object: Response

field necessity type description
coordinates MUST array of array of number The resulting coordinates from transforming the input.
message MAY string Free-text details.

Object: Error

field necessity type description
message MAY string Free-text description of error.

Test procedure

Each OME-Zarr hierarchy additionally includes a conformance.toml, which describes the test case. The implementation's dingus CLI does not need to parse this.

The transform_conformance.py script:

  • iterates through all test cases
  • parses the conformance.toml
  • calls the provided dingus CLI, supplying the test case path, the source and target coordinate system names, and the source coordinates
  • reads the output of the dingus CLI
    • if the return code is 0
      • if should_error = false, parse the response and check the output coordinates against those defined in target.coordinates, using the defined tolerances
      • if should_error = true, fail the test
    • if the return code is non-zero
      • if should_error = true, pass the test
      • if should_error = false, fail the test
  • builds a table of test successes and failures, potentially including any messages returned by the dingus CLI

It is called like:

./transformation_conformance.py ./cases -- myDingus --some-arg anotherArg

This in turn calls the dingus repeatedly, seeing arguments like

myDingus --some-arg anotherArg './cases/translation.ome.zarr' 'input' 'output' '[[1, 2]]'

Configs

For convenience, simple test cases can be configured by a single TOML file representing the OME-Zarr scene and Conformance objects; see ./cases_config/ directory and the ./write_cases.py script.

Where invert = true, also create a test which switches the source and target objects.

More complicated test cases cannot be configured this way.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ome_zarr_transformations_conformance-0.1.2.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file ome_zarr_transformations_conformance-0.1.2.tar.gz.

File metadata

  • Download URL: ome_zarr_transformations_conformance-0.1.2.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ome_zarr_transformations_conformance-0.1.2.tar.gz
Algorithm Hash digest
SHA256 690e18147efe224d6d571d67957957c8c08c94e7df51a7b72218c38ea949d897
MD5 1f454a2f7bcf7188a15e84b3e05d9477
BLAKE2b-256 76b2ad1102916ddd6851cdcba23c4aa5ca0459b02e300afc59435dd79dfd6536

See more details on using hashes here.

File details

Details for the file ome_zarr_transformations_conformance-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ome_zarr_transformations_conformance-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 25.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ome_zarr_transformations_conformance-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dbb406fa075717e54e82b372d48001f1c869fa5c278eee53a0ad5850264b92fb
MD5 d91b80c62fe3c77e9bbc286b08ccc160
BLAKE2b-256 cfd94cfefebc68615fad2ae77ceb10ab243184104ae8f16044730a2f8491fadc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page