-
Notifications
You must be signed in to change notification settings - Fork 70
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
base: main
Are you sure you want to change the base?
Md null schema #2720
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2720 +/- ##
==========================================
- Coverage 94.08% 94.07% -0.01%
==========================================
Files 29 29
Lines 28516 28518 +2
Branches 1609 1610 +1
==========================================
+ Hits 26828 26829 +1
Misses 1653 1653
- Partials 35 36 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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? |
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
.