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

Relax version detection #189

Merged
merged 1 commit into from
Apr 18, 2022
Merged

Relax version detection #189

merged 1 commit into from
Apr 18, 2022

Conversation

joshmoore
Copy link
Member

Some writers (like for the DANDI project) have stored
the versions as floating point values (e.g. 0.2).
Though this won't be long-term sustainable, relaxing
the version identification at this point seems
unproblematic.

cc: @LeeKamentsky

Some writers (like for the DANDI project) have stored
the versions as floating point values (e.g. `0.2`).
Though this won't be long-term sustainable, relaxing
the version identification at this point seems
unproblematic.
@LeeKamentsky
Copy link

I've updated those files to "0.4" as a string. My bad. Hopefully I am the only one.

@codecov
Copy link

codecov bot commented Apr 13, 2022

Codecov Report

Merging #189 (00138af) into master (a259858) will increase coverage by 0.01%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master     #189      +/-   ##
==========================================
+ Coverage   83.99%   84.00%   +0.01%     
==========================================
  Files          12       12              
  Lines        1362     1388      +26     
==========================================
+ Hits         1144     1166      +22     
- Misses        218      222       +4     
Impacted Files Coverage Δ
ome_zarr/format.py 97.59% <50.00%> (-0.59%) ⬇️
ome_zarr/writer.py 96.25% <0.00%> (-1.92%) ⬇️
ome_zarr/data.py 87.00% <0.00%> (+0.13%) ⬆️
ome_zarr/reader.py 85.45% <0.00%> (+0.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a259858...00138af. Read the comment docs.


# Support floating-point versions like `0.2`
if isinstance(version, float):
version = str(version)
Copy link
Member

Choose a reason for hiding this comment

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

While this is primarily consumed at the reader level currently and hence quite downstream of the generation process, this raises the question of whether this library should also raise a WARN level logging statement indicating the mismatch.

Copy link
Member Author

Choose a reason for hiding this comment

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

Possibly, though I'm already annoyed by the format mismatch warnings. Perhaps we could differentiate between a more purely user (view()) and developer (validate()) context.

Copy link
Member

Choose a reason for hiding this comment

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

I am quite annoyed by the format mismatch warning as well - happy to create an issue or even look into it 😄

In this scenario, the the warning is about a core issue with the data validation rather than exposing the internal guessing logic of the library so assuming I had to pick between the two, I would personally only keep the former. The idea of differentiating the usage contexts is interesting and possibly brings us back to the validation flag that @will-moore introduced while working on #189.

Copy link
Member Author

@joshmoore joshmoore Apr 13, 2022

Choose a reason for hiding this comment

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

I've found why it's duplicated and will open a PR (#190). We'll still need to decide on the first mismatch.

@will-moore
Copy link
Member

LGTM 👍

@joshmoore
Copy link
Member Author

Thanks, @will-moore. Anyone have an opinion on the warning? Or shall I just record the fact (in code or an issue) that we may want to warn here in the future when there's a clear "dev" situation?

@sbesson
Copy link
Member

sbesson commented Apr 18, 2022

As per the JSON schema, my assumption is that these datasets should throw a warning with the --validate option proposed in #142?

If so, no objection to getting this in its current form and the warning should naturally be appear as part of the validation framework.

@joshmoore joshmoore merged commit 6dbd227 into ome:master Apr 18, 2022
@joshmoore joshmoore deleted the relax-version branch April 18, 2022 15:14
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.

4 participants