Repository navigation
Utf8 regression #1000
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
Utf8 regression #1000
Changes from all commits
f5e914b
14d9bf3
0293f5f
b5fcffb
3fd33a0
c53d283
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |
| import numpy as np | ||
| import numpy.testing as npt | ||
|
|
||
| from biom import example_table | ||
| from biom.parse import (generatedby, MetadataMap, parse_biom_table, parse_uc, | ||
| load_table, save_table) | ||
| from biom.table import Table | ||
|
|
@@ -283,6 +284,15 @@ def test_parse_adjacency_table_no_header(self): | |
| obs = Table.from_adjacency(''.join(lines)) | ||
| self.assertEqual(obs, exp) | ||
|
|
||
| def test_parse_biom_table_hdf5_accent_utf8_regression(self): | ||
| tab = example_table.copy() | ||
| tab.update_ids({i: f'{i}fóó' for i in tab.ids()}, inplace=True) | ||
| with NamedTemporaryFile(delete=False) as tmpfile: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Potentially, but err'ing on following the style of the rest of the script. And, a left over file in
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I see. It looks like those add this to the end of the test: self.to_remove.append(tmpfile.name)It's mostly github's problem these days I suppose. So your call, but wanted to mention it. |
||
| with h5py.File(tmpfile.name, 'w') as fp: | ||
| tab.to_hdf5(fp, 'asf') | ||
| obs = load_table(tmpfile.name) | ||
| self.assertEqual(obs, tab) | ||
|
|
||
| def test_parse_biom_table_hdf5(self): | ||
| """Make sure we can parse a HDF5 table through the same loader""" | ||
| cwd = os.getcwd() | ||
|
|
||
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.
🫤 that feels rude of h5py
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.
Might be HDF5 as the C-API is touchy. Or, we may not be correctly enforcing types on empty tables