From 6dfbeb8d7ee3a766b80b999e3d84558fb80c06fb Mon Sep 17 00:00:00 2001 From: Eric Wieser Date: Mon, 28 Dec 2020 11:53:47 +0000 Subject: [PATCH] Fix a CI failure on h5py 3 (#388) 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`. --- clifford/io.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clifford/io.py b/clifford/io.py index 958486ae..24cbb4d7 100644 --- a/clifford/io.py +++ b/clifford/io.py @@ -136,5 +136,9 @@ def read_ga_file(file_name): else: support = None metric = f['metric'][:] - basis_names = f['basis_names'][:] + if hasattr(h5py.Dataset, 'asstr'): + basis_names = f['basis_names'].asstr()[:] + else: + # h5py < 3 + basis_names = f['basis_names'][:] return data_array, metric, basis_names, support