-
Notifications
You must be signed in to change notification settings - Fork 72
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
Md null schema #2720
Md null schema #2720
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2720 +/- ##
==========================================
- Coverage 89.72% 86.96% -2.77%
==========================================
Files 29 11 -18
Lines 31573 24358 -7215
Branches 6115 4501 -1614
==========================================
- Hits 28328 21182 -7146
+ Misses 1853 1817 -36
+ Partials 1392 1359 -33
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I now think we should use this for the def __str__(self) -> str:
if isinstance(self._schema, collections.OrderedDict):
s = pprint.pformat(dict(self._schema))
else:
s = pprint.pformat(self._schema)
if "\n" in s:
return f"MetadataSchema(\n{s}\n)"
else:
return f"MetadataSchema({s})" What do you think, @benjeffery ? Will this break anything? |
b01a6b7
to
8406c09
Compare
8406c09
to
97ef3b4
Compare
I've rebased this and make the string |
@Mergifyio rebase |
✅ Branch has been successfully rebased |
97ef3b4
to
cc49b84
Compare
While thinking with metadata for the
tskit
poster, I remembered this on the queue. As discussed with @benjeffery - this is mostly a documentation PR, but it also changes behaviour so thatstr(tskit.MetadataSchema(schema=None))
returns"Null_schema"
rather thanNone
, which was pretty confusing, becausetskit.MetadataSchema(schema=None) is None
always returnsFalse
.