-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add NWB support III - provenance writing #17
Add NWB support III - provenance writing #17
Conversation
Codecov Report
@@ Coverage Diff @@
## main #17 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 518 526 +8
=========================================
+ Hits 518 526 +8
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
# Propagate video metadata | ||
default_metadata["original_videos"] = [f"{video.filename}"] # type: ignore | ||
default_metadata["labeled_videos"] = [f"{video.filename}"] # type: ignore | ||
|
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.
Was getting error sleap_io/io/nwb.py:201: error: Incompatible types in assignment (expression has type "List[str]", target has type "str")
in liens 200 and 201. Is there are more elegant way of avoiding this? I guess I have to define the dict above in a specific way but I expect an heterogeneous input for each of the keys.
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.
Ugh, yeah, the typing for complicated dict
value types is a bit hairy. Technically I suppose this is intended to discourage the use of dict
s as generic grab bags of different data structures that aren't documented explicitly, but it sacrifices a lot of flexibility.
Ignoring is fine for now. In my view, typing is a "best effort" practice and should be ignored if it makes the code harder to read or iterate on.
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!
Description
After #14 which makes provenance data available the next step is to write this data (such as the sleap version) to the nwb file. The main purpose of this PR is to do this. I added one test to ensure that the data is properly propagated by default and another one to ensure that default behavior can be overwritten through the use of
pose_estimation_metadata
.There are other two minor additions of this PR:
pose_estimation_metadata
argument.Types of changes
Does this address any currently open issues?
Outside contributors checklist
Thank you for contributing to SLEAP-IO!
❤️