Aggregate events.tsv for invalid entities (and rec) - #864
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #864 +/- ##
==========================================
+ Coverage 83.64% 83.73% +0.09%
==========================================
Files 42 42
Lines 4506 4525 +19
==========================================
+ Hits 3769 3789 +20
+ Misses 737 736 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
yarikoptic
left a comment
There was a problem hiding this comment.
THANK YOU for the PR -- we should fix this indeed. BUT I think we should not sanitize rec, and also tune code a bit
|
One heads-up when applying the suggestions above: turning What needs updating in
|
|
Hey @yarikoptic - thank you so much for that in-depth review. I feel this was much more work than what I did initially with the PR 😅 Your and Claude's points are very valid and I applied most of them verbatim. Fixed the tests as well. It's just unfortunate that the reason I dug into this is now off the table with rec- being untouched. But, well, worth it anyway! |
|
thanks @octomike ! So, you are still having multiple github actions is ATM a bust , so I will run tests locally but also wait for a day or so |
|
re RTD -- if you update branch on top of master (merge or rebase), should render ok |
Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
3e4a26b to
121ad10
Compare
Yeah, I'll think about it. I'm inclined to just have this artifact fixed after conversion now that the possible neat solution is off the table. Will check with the "customer" (researcher).
Don't sweat it. |
| def __contains__(self, entity: object) -> bool: | ||
| return entity in self._entities | ||
|
|
||
| def drop(self, entity: str, missing_ok: bool=False) -> None: |
There was a problem hiding this comment.
| def drop(self, entity: str, missing_ok: bool=False) -> None: | |
| def drop(self, entity: str, missing_ok: bool = False) -> None: |
to please linters
There was a problem hiding this comment.
hm, I need to sleep on it but it says
may be you didn't allow contributors to push to you branch and that's the reason @octomike ?
We currently get two (empty) events.tsv files for our
rec-normandrec-rawbold pairs. This is redundant and should be aggregated into an events file without a rec entity altogether (the spec allows it, but I would argue that events are independent of reconstruction methods, right?).I had a look at the code and cleaned it up a little to utilize
BIDSFile.parse()instead of manual splits around_echo. I also realized that there are other entities valid for the bold, but invalid for the corresponding events.tsv and remove them. For that I added adrop()and a trivial__contains__()method to BIDSFile to easily remove an entity from the filename and have concise tests.This should also fix #849
I believe the
__contains__is an intuitive add-on, but it might lead to confusion with code like this:Under the hood it will now check if
recis in the_entitiesdictionary, but it might read as: Isrecliterally in the string representation of the filename? I'm not sure if you want to avoid this little trap.