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

Add JSON schemas for plate and well specification #120

Merged
merged 16 commits into from
May 18, 2022

Conversation

sbesson
Copy link
Member

@sbesson sbesson commented May 13, 2022

Similarly to what has been done for multiscales, this PR introduced four new JSON schemas to the 0.4 specification:

  • plate.schema which should enforce the mandatory properties (MUST) of the plate specification
  • strict_plate.schema which extends plate.schema and enforces the recommended properties (SHOULD).
  • well.schema which should enforce the mandatory properties (MUST) of the well specification
  • strict_well.schema which extends well.schema and enforces the recommended properties (SHOULD).

Tests formatted using the JSON schema test suite layout are added and the example snippets are extracted under examples using the similar logic as #118.

Two modifications of the validation tests were required. e49f126 ensures only the examples located in the same folder as .config.json are tested against a given schema. 949a352 creates a shared schema store. Since the strict schemas are referencing other schemas via $ref, this store is required to allow the test the local versions under /schemas. Otherwise, the tests will try to resolve remote schemas which would fail either if working offline or when working with unpublished schemas.

The specification of the JSON schema required a few assumptions that are currently underspecified:

  • rows, columns and wells are the only mandatory properties of plate
  • name and version are recommended properties of plate
  • all other top-level plateproperties are optional
  • the id of each element of the acquisitions array is an integer
  • starttime and endtime of each element of the acquisitions array is an integer
    -version is a recommended property of well

Probably the biggest inconsistency identified by this schema work is about the type of acquisition.starttime and acquisition.endtime which is marked as "epoch string" in the specification text while the JSON examples use integers.

At the moment, each test suite is creating its own internal schema
store with a single schema.
This prevents the testing combined schemas like the strict schemas
either when the parent schema is unpublished or simply offline.

This commit migrates the logic to create a single global schema store
@sbesson sbesson changed the title Add JSON schemas for plate specification Add JSON schemas for plate and well specification May 14, 2022
Copy link
Member

@melissalinkert melissalinkert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments aside, this all looks fine to me.

0.4/schemas/plate.schema Outdated Show resolved Hide resolved
0.4/schemas/plate.schema Outdated Show resolved Hide resolved
@sbesson
Copy link
Member Author

sbesson commented May 17, 2022

👍 30d0156 should ensure that id, starttime and endtime cannot be negative and 38c3eb2 shoud clarify the description of the timestamps

Copy link
Member

@joshmoore joshmoore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I assume you want to capture any changes/clarifications to the text in follow ups, no?

@sbesson
Copy link
Member Author

sbesson commented May 17, 2022

If we are all fine with the current state, next todos were:

1- update the text of the plate and well sections accordingly
2- port the same set of changes (JSON schemas, tests & specification) to latest

Doing this as separate follow-up PRs has the benefit of iterating quicker.

@sbesson sbesson merged commit e0a4397 into ome:main May 18, 2022
@sbesson sbesson deleted the plate_specification branch May 18, 2022 11:18
github-actions bot added a commit that referenced this pull request May 18, 2022
Add JSON schemas for plate and well specification

SHA: e0a4397
Reason: push, by @sbesson

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants