Skip to content
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

CI failure in io module #387

Closed
eric-wieser opened this issue Dec 28, 2020 · 1 comment · Fixed by #388
Closed

CI failure in io module #387

eric-wieser opened this issue Dec 28, 2020 · 1 comment · Fixed by #388
Labels

Comments

@eric-wieser
Copy link
Member

https://travis-ci.org/github/pygae/clifford/jobs/751737929#L369-L388

This looks like a possible bug in h5py:

def test_write_and_read(self, tmp_path):
file_name = str(tmp_path / "test.ga")
basis_names = np.array(layout.basis_names, dtype=str)
mv_array = ConformalMVArray([random_point_pair() for i in range(1000)]).value
write_ga_file(file_name, mv_array, layout.metric, basis_names, compression=True,
transpose=False, sparse=False, support=False)
data_array, metric_2, basis_names_2, support = read_ga_file(file_name)
np.testing.assert_equal(data_array, mv_array)
np.testing.assert_equal(layout.metric, metric_2)
np.testing.assert_equal(basis_names, basis_names_2)

>       np.testing.assert_equal(basis_names, basis_names_2)
E       AssertionError: 
E       Arrays are not equal
E       
E       Mismatched elements: 5 / 5 (100%)
E        x: array(['e1', 'e2', 'e3', 'e4', 'e5'], dtype='<U2')
E        y: array([b'e1', b'e2', b'e3', b'e4', b'e5'], dtype=object)

Somehow the array is being converted from str to bytes...

Versions:

  • numpy: 1.19.4
  • h5py: 3.1.0
  • python: 3.8.6
@eric-wieser
Copy link
Member Author

The conda CI succeeds, but only uses h5py-2.10.0

eric-wieser added a commit that referenced this issue Dec 28, 2020
Closes #387. h5py 3 overhauls how string serialization works, meaning that the reader always has to ask for them to be decoded back to `str` from `bytes`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant