Skip to content
Snippets Groups Projects
Commit 6601f669 authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Merge branch 'deprecation' into 'master'

Deprecation

See merge request !38
parents e8c1fcfd 300308bb
No related branches found
No related tags found
1 merge request!38Deprecation
Pipeline #60598 passed
......@@ -88,12 +88,17 @@ def open_file(filename):
if extension in hdf5_extensions:
with h5py.File(filename, "r") as f:
if "array" not in f.keys():
keys = list(f.keys())
if len(keys) == 1:
key = keys[0]
else:
key = "array"
if key not in keys:
raise RuntimeError(
"The file '%s' does not contain the key 'array'" % filename
f"The file {filename} does not contain the key {key}"
)
return np.array(f["array"])
return np.array(f[key])
elif extension in image_extensions:
img = imageio.imread(filename)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment