-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
MRG: Test constant consistency #5332
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
417fa3e
ENH: Test constant consistency
larsoner 06d80f7
FIX: Update names
larsoner 5f5b85d
FIX: Tests
larsoner 1ba5a30
FIX: Fix constant checks
larsoner 3cf0540
FIX: Last fixes in this round
larsoner f52fd72
ENH: Make new FWD namespace
larsoner b92f1c9
FIX: Use codeload
larsoner 44f011d
FIX: Better redirect following
larsoner 637dbcb
FIX: String encoding
larsoner 26ad2a8
FIX: Better alias
larsoner 6b18f44
FIX: Clearer unicode test
larsoner 70e3cbe
FIX: Ancient pytest
larsoner 3565f8f
FIX: Old Pytest
larsoner 3c06878
DOC: whats_new.rst
larsoner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# -*- coding: utf-8 -*- | ||
# Author: Alexandre Gramfort <[email protected]> | ||
# Denis Engemann <[email protected]> | ||
# | ||
|
@@ -513,16 +514,16 @@ def test_io_raw(): | |
rng = np.random.RandomState(0) | ||
tempdir = _TempDir() | ||
# test unicode io | ||
for chars in [b'\xc3\xa4\xc3\xb6\xc3\xa9', b'a']: | ||
for chars in [u'äöé', 'a']: | ||
with read_raw_fif(fif_fname) as r: | ||
assert ('Raw' in repr(r)) | ||
assert (op.basename(fif_fname) in repr(r)) | ||
desc1 = r.info['description'] = chars.decode('utf-8') | ||
r.info['description'] = chars | ||
temp_file = op.join(tempdir, 'raw.fif') | ||
r.save(temp_file, overwrite=True) | ||
with read_raw_fif(temp_file) as r2: | ||
desc2 = r2.info['description'] | ||
assert_equal(desc1, desc2) | ||
assert desc2 == chars | ||
|
||
# Let's construct a simple test for IO first | ||
raw = read_raw_fif(fif_fname).crop(0, 3.5) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
FYI @agramfort I saw in the official docs that strings are written this way, not using UTF-8, so I have changed it :(
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.
ok. Do we test IO with utf8 characters?
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.
Yep though I just pushed a commit to more explicitly test it
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 will not break the IO of old files?
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.
It might make some of the characters look different. But either way (what we have in
master
vs what this PR does) some files are broken on read and write. The difference is that what this PR does follows the FIF spec, what we had before did not. So this should probably be inwhats_new.rst
under theBUG
section.