Skip to content

Commit

Permalink
python: quiet h5py missing
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Dec 3, 2019
1 parent fea917b commit 4610505
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/GetShape.f90
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

inquire(file=fn, exist=exists)
if (.not. exists) then
write(stderr, '(A,A)'), fn, ' is not a file.'
write(stderr, *) fn // ' is not a file.'
error stop 77
endif

Expand Down
12 changes: 8 additions & 4 deletions tests/GetShapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
import subprocess
import argparse
import sys
import h5py
from pathlib import Path
try:
import h5py
except ImportError:
h5py = None


p = argparse.ArgumentParser()
Expand All @@ -21,9 +24,10 @@
print("h5ls tool:")
subprocess.run(["h5ls", f"{fn}/{P.var}"])

with h5py.File(fn, "r") as f:
print("h5py")
print(f[P.var].shape)
if h5py is not None:
with h5py.File(fn, "r") as f:
print("h5py")
print(f[P.var].shape)


if shutil.which("octave-cli"):
Expand Down

0 comments on commit 4610505

Please sign in to comment.