-
Notifications
You must be signed in to change notification settings - Fork 258
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
MAINT: Deprecations #1243
MAINT: Deprecations #1243
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1243 +/- ##
=======================================
Coverage 92.16% 92.16%
=======================================
Files 98 98
Lines 12368 12370 +2
Branches 2540 2542 +2
=======================================
+ Hits 11399 11401 +2
Misses 646 646
Partials 323 323
☔ View full report in Codecov by Sentry. |
How do you feel about trying to purge Also unclear why |
|
nibabel/casting.py
Outdated
if isinstance(s, bytes): | ||
return s.decode('latin1') | ||
return str(s) |
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.
... in other words, unless in each instance that asstr
is used we know something is always either bytes or str (in which case, why use this func at all???) then the places asstr
is used we'll need to put this conditional in. But maybe that's cleaner... I'm happy either way!
My hope is that we actually can know what types we're getting and whether or not to coerce them, rather than always having conditionals, but I haven't looked into them. That's the task I'm asking if you want to undertake. No worries if not, and I'm fine with keeping asstr until somebody (perhaps even me) does feel the urge. |
I took a mostly naive approach by decoding in all cases. Hopefully that works -- it did in limited testing locally -- but it probably depends on how good your test coverage is! If you want deeper investigation, |
if isinstance(creator, bytes): | ||
creator = creator.decode('latin-1') |
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.
This one has both bytes
and str
tests in nicom/tests/test_utils.py
so I assume it's necessary
Well it's green now so feel free to merge if you want. Safer to revert the last three commits but if you trust your tests you should be okay! |
Pushed some minor changes directly. Should not affect tests, and will merge on pass. Thanks for putting in the extra effort! |
Recently for some reason in some joblib-parallel runs I've gotten:
Why this started happening just recently is a mystery to me, but this PR adds
from . import orientations
tonibabel/__init__.py
which hopefully seems reasonable. (It has worked in MNE for at least a year, not sure why it just became an issue...)Deals with warnings of the form: