-
Notifications
You must be signed in to change notification settings - Fork 28
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
Joint BIDS-NWB metadata extraction. #1183
Conversation
Codecov ReportBase: 89.08% // Head: 89.16% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1183 +/- ##
==========================================
+ Coverage 89.08% 89.16% +0.07%
==========================================
Files 76 76
Lines 9448 9469 +21
==========================================
+ Hits 8417 8443 +26
+ Misses 1031 1026 -5
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@yarikoptic any ideas why this test requires docker? Does it need some upload function to generate the (dev) [deco]~/src/dandi-cli ❱ pytest -vvs dandi/tests/test_metadata.py::test_bids_nwb_metadata_integration
=========================================================== test session starts ============================================================
platform linux -- Python 3.10.9, pytest-7.2.0, pluggy-1.0.0 -- /usr/bin/python3.10
cachedir: .pytest_cache
rootdir: /home/chymera/src/dandi-cli, configfile: tox.ini
plugins: pkgcore-0.12.18, mock-3.10.0
collected 1 item
dandi/tests/test_metadata.py::test_bids_nwb_metadata_integration Cloning into '/tmp/pytest-of-chymera/pytest-6/gitrepo0'...
remote: Enumerating objects: 2490, done.
remote: Counting objects: 100% (2490/2490), done.
remote: Compressing objects: 100% (1786/1786), done.
remote: Total 2490 (delta 541), reused 1899 (delta 364), pack-reused 0
Receiving objects: 100% (2490/2490), 371.26 KiB | 1.66 MiB/s, done.
Resolving deltas: 100% (541/541), done.
remote: Enumerating objects: 5, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 0), reused 3 (delta 0), pack-reused 0
Receiving objects: 100% (5/5), 7.57 KiB | 7.57 MiB/s, done.
remote: Enumerating objects: 142, done.
remote: Counting objects: 100% (142/142), done.
remote: Compressing objects: 100% (97/97), done.
remote: Total 142 (delta 38), reused 121 (delta 36), pack-reused 0
Receiving objects: 100% (142/142), 361.83 KiB | 2.62 MiB/s, done.
Resolving deltas: 100% (38/38), done.
errors pretty printing info
SKIPPED (docker engine not running)
=========================================================== slowest 10 durations ===========================================================
3.09s setup dandi/tests/test_metadata.py::test_bids_nwb_metadata_integration
0.00s teardown dandi/tests/test_metadata.py::test_bids_nwb_metadata_integration
============================================================ 1 skipped in 3.18s ============================================================
(dev) [deco]~/src/dandi-cli/ ❱ ag bids_nwb_dandiset -B 2 -A 3 dandi/tests/test_metadata.py
52-
53-
54:def test_bids_nwb_metadata_integration(bids_nwb_dandiset: SampleDandiset) -> None:
55: metadata = get_metadata(bids_nwb_dandiset)
56- print(metadata)
57-
58- |
Hm, so hitting a digest issue again, perhaps this PR could cautiously be extended to cover #1178 as well, since it might require sorting that bit out... @jwodder sorry to ping you again, but I might benefit from your insight on this. Did I make any obvious mistake in d99891f? I'm basically trying to generate a fake digest as per the code thus far used in Line 350 in 9aae3bf
Alternatively, and in the context of the overall digest discussion, is there any way to just pull the plug on it in a more comprehensive manner? And if so would it be at all advisable? |
@TheChymera Print out the value of
I'm not sure what you mean. dandi-schema requires a digest in order to construct a |
It appears we do indeed have the etag |
@TheChymera Pass |
@TheChymera This should fix it: diff --git a/dandi/files/bids.py b/dandi/files/bids.py
index d2238c3..3c0d910 100644
--- a/dandi/files/bids.py
+++ b/dandi/files/bids.py
@@ -226,7 +226,7 @@ class NWBBIDSAsset(BIDSAsset, NWBAsset):
digest: Optional[Digest] = None,
ignore_errors: bool = True,
) -> BareAsset:
- bids_metadata = BIDSAsset.get_metadata(self)
+ bids_metadata = BIDSAsset.get_metadata(self, digest, ignore_errors)
nwb_metadata = NWBAsset.get_metadata(self, digest, ignore_errors)
return BareAsset(
**{**bids_metadata.dict(), **nwb_metadata.dict(exclude_none=True)} |
Although this doesn't really touch the logic of BIDS validation, apparently this PR introduces 2 new test failures in existing tests... Tried to debug this yesterday (have a commit littered with print calls, but it really didn't help me narrow it down). Checking the logs, I get
And I have absolutely no clue why... I'll continue looking, but if you have any ideas @yarikoptic @jwodder let me know. |
I think I figured it out. |
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.
left some suggestion which I am yet to pursue "deeper" as well since it seems there is some unclear stack of semantics in what extracts what metadata
@jwodder could we merge? |
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.
just left 1 suggestion to adopt to avoid obscure mix of / and \ in paths on windows. The rest is ok, let's proceed after suggestion is adopted
🚀 PR was released in |
Closes: #1172