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] refactor of tests and code in GLM module #4066
Conversation
👋 @Remi-Gau Thanks for creating a PR! Until this PR is ready for review, you can include the [WIP] tag in its title, or leave it as a github draft. Please make sure it is compliant with our contributing guidelines. In particular, be sure it checks the boxes listed below.
For new features:
For bug fixes:
We will review it as quick as possible, feel free to ping us with questions if needed. |
Codecov Report
@@ Coverage Diff @@
## main #4066 +/- ##
=======================================
Coverage 91.60% 91.60%
=======================================
Files 143 143
Lines 16096 16086 -10
Branches 3347 3340 -7
=======================================
- Hits 14745 14736 -9
Misses 804 804
+ Partials 547 546 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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 overall
I am getting a failure on Windows only, on this test. Anyone can spot the issue here?
|
it seems the default encoding used on windows with a wester/american locale is more lenient than utf-8: import io
img_data = (
b"GIF87a\x01\x00\x01\x00\xe7*\x00\x00\x00\x00\x01\x01"
b"\x01\x02\x02\x07\x08\x08\x08\x0b\x0b\x0b\x0c\x0c\x0c\r;"
)
buf = io.BytesIO(img_data)
stream = io.TextIOWrapper(buf, encoding="cp1252")
stream.readline() # OK (but garbage output)
buf = io.BytesIO(img_data)
stream = io.TextIOWrapper(buf, encoding="utf-8")
stream.readline() # UnicodeDecodeError btw,
|
also looking at the git blame for this file, it seems the black-formatting commits still show up in the git blame |
I know. 🙈
|
Thanks for looking this up. I did not even where to look on this one. |
Thanks for looking this up. I did not even where to look on this one.
when you see different encoding errors or absence thereof on windows and unix, it helps to remember they don't use the same default encoding
another difference that comes up often in nilearn tests is windows refuses to unlink files that have an open file handle
So you would suggest nuking this test out of the test suite?
the check in the code and the test
|
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!
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, thx !
Will fix the error in the doc build in this PR: it is just a typo (apparently I cannot spell my own name). |
Changes proposed in this pull request: