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

Fix version number in v05 multiscales #145

Closed
dstansby opened this issue Feb 4, 2025 · 3 comments · Fixed by #146
Closed

Fix version number in v05 multiscales #145

dstansby opened this issue Feb 4, 2025 · 3 comments · Fixed by #146

Comments

@dstansby
Copy link
Collaborator

dstansby commented Feb 4, 2025

Hi @dstansby - I was just testing a tool to generate TypeScript types from Pydantic - see https://github.com/marketplace/actions/pydantic-to-typescript

When I ran it on the _v05 classes...

$ pydantic2ts --module src/ome_zarr_models/_v05/image.py --output image05.ts

It gave me a Multiscale with version?: "0.4" | null; and I also don't see the "version": "0.5" which is required on ImageAttrs I think?

Apologies if this is already on your radar but I didn't recognise it in the issues above. Thanks.

/**
 * Model for the metadata of OME-Zarr data.
 *
 * See https://ngff.openmicroscopy.org/0.4/#image-layout.
 */
export interface ImageAttrs {
  /**
   * The multiscale datasets for this image
   *
   * @minItems 1
   */
  multiscales: [Multiscale, ...Multiscale[]];
  omero?: Omero | null;
  [k: string]: unknown;
}
/**
 * An element of multiscales metadata.
 */
export interface Multiscale {
  axes: Axis[];
  /**
   * @minItems 1
   */
  datasets: [Dataset, ...Dataset[]];
  version?: "0.4" | null;
  coordinateTransformations?: [unknown] | [unknown, unknown] | null;
  metadata?: {
    [k: string]: unknown;
  };
  name?: JsonValue | null;
  type?: {
    [k: string]: unknown;
  };
  [k: string]: unknown;
}

Originally posted by @will-moore in #88

@dstansby
Copy link
Collaborator Author

dstansby commented Feb 4, 2025

I've removed the version number in v05 over in #146 (thanks for reporting, this was not on our list and should have been!). For

and I also don't see the "version": "0.5" which is required on ImageAttrs I think?

ImageAttrs models the metdata that sits under the 'ome' key, so shouldn't contain the ome version, as that also sits directly under the 'ome' key. Does that make sense?

@will-moore
Copy link

From https://ngff.openmicroscopy.org/0.5/index.html#multiscale-md we get:

"attributes": {
    "ome": {
      "version": "0.5",
      "multiscales": [
        {
...

so we have "version" and "multiscales" as siblings.

If ImageAttrs models the metadata that sits under the 'ome' key, then I would expect it to include version?

@dstansby
Copy link
Collaborator Author

dstansby commented Feb 4, 2025

Woops, thanks for pointing that out... fix should be at #149, could you take a look and see if that looks right now?

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 a pull request may close this issue.

2 participants