json+struct: padding bytes and no C code#3440
Draft
petrelharp wants to merge 3 commits intotskit-dev:mainfrom
Draft
json+struct: padding bytes and no C code#3440petrelharp wants to merge 3 commits intotskit-dev:mainfrom
petrelharp wants to merge 3 commits intotskit-dev:mainfrom
Conversation
petrelharp
commented
Mar 20, 2026
python/tskit/metadata.py
Outdated
| ) | ||
| json_bytes = encoded[start : start + jlen] | ||
| blob_bytes = encoded[start + jlen : start + jlen + blen] | ||
| blob_bytes = encoded[start + jlen : start + jlen + blen + padding_length] |
Contributor
Author
There was a problem hiding this comment.
@benjeffery says in the other PR:
Don't you need the padding at the start? I think the test isn't catching this as its payload is 27, so it's padding is zero?
Contributor
Author
There was a problem hiding this comment.
lol yes - in my defense, I was planning to go adjust that test to include metadata of different lengths, so presumably I would have got this
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3440 +/- ##
==========================================
- Coverage 91.92% 91.90% -0.02%
==========================================
Files 37 37
Lines 32153 32095 -58
Branches 5143 5135 -8
==========================================
- Hits 29556 29498 -58
Misses 2264 2264
Partials 333 333
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Contributor
Author
|
The codecov failure here is fine: it's just because we've reduced the number of covered lines in |
padding bytes in json+struct codec
5363644 to
3d0f794
Compare
bhaller
reviewed
Mar 21, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This differs from #3437 in that:
My intention is that we deal with the python and C code separately, so this supercedes #3437. My proposal for the C side of things is in #3439.