Skip to content

Fix for time_units in tskit 0.4.1 #55

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

Closed
wants to merge 2 commits into from

Conversation

benjeffery
Copy link
Member

Fixes #54

@benjeffery
Copy link
Member Author

Thanks for the report @rwaples! We'll get a release out ASAP!

@benjeffery
Copy link
Member Author

@jeromekelleher A quick fix for now, but I think tszip should be enumerating the properties it can cope with, rather than assuming the ones it doesn't recognise are arrays.

Copy link
Member

@jeromekelleher jeromekelleher left a comment

Choose a reason for hiding this comment

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

I agree - can we do something with the types of the values instead?

for name in columns:
if name.endswith("metadata_schema"):
if name.endswith("metadata_schema") or name == "time_units":
Copy link
Member

@jeromekelleher jeromekelleher Jan 20, 2022

Choose a reason for hiding this comment

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

Would if isinstance(column[name], str) work here? Is the metadata column below also effectively assuming it's a bytes value?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've pushed a commit that does that on compress. On decompress we can't detect, although the best idea might be to write the type to the zarr metadata. Will try that later.

@codecov-commenter
Copy link

Codecov Report

Merging #55 (61f512f) into main (55bc8c4) will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #55      +/-   ##
==========================================
+ Coverage   97.70%   97.74%   +0.04%     
==========================================
  Files           6        6              
  Lines         305      311       +6     
  Branches       55       61       +6     
==========================================
+ Hits          298      304       +6     
  Misses          5        5              
  Partials        2        2              
Impacted Files Coverage Δ
tszip/cli.py 100.00% <100.00%> (ø)
tszip/compression.py 98.88% <100.00%> (ø)

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 cb69791...61f512f. Read the comment docs.

@benjeffery
Copy link
Member Author

@jeromekelleher I've updated this to store type info in the zarr - this should mean that tszip copes with any additional string or bytes attributes on tables.

@jeromekelleher
Copy link
Member

What's the status here @benjeffery - I think we decided to keep the file format changes for another version, and just do the decode side by name?

@benjeffery
Copy link
Member Author

What's the status here @benjeffery - I think we decided to keep the file format changes for another version, and just do the decode side by name?

Yep, I think I'll open another PR with those changes, and leave these here for reference if we do do the file change.

@benjeffery
Copy link
Member Author

Closing in favour of #58

@jeromekelleher
Copy link
Member

Yep, I think I'll open another PR with those changes, and leave these here for reference if we do do the file change.

Sounds good - could we open an issue to track the proposed changes to the file format? I think these would be an improvement and more future-proof.

@benjeffery benjeffery closed this Jan 25, 2022
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.

New time_units field breaks compression
3 participants