Skip to content

Commit

Permalink
Remove HFile from types/array
Browse files Browse the repository at this point in the history
  • Loading branch information
GarethCabournDavies committed Jun 25, 2024
1 parent daef3b8 commit d6cd24b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pycbc/types/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

from functools import wraps

import h5py
import lal as _lal
import numpy as _numpy
from numpy import float32, float64, complex64, complex128, ones
Expand All @@ -40,7 +41,6 @@
import pycbc.scheme as _scheme
from pycbc.scheme import schemed, cpuonly
from pycbc.opt import LimitedSizeDict
from pycbc.io.hdf import HFile

#! FIXME: the uint32 datatype has not been fully tested,
# we should restrict any functions that do not allow an
Expand Down Expand Up @@ -1017,7 +1017,7 @@ def save(self, path, group=None):
_numpy.savetxt(path, output)
elif ext == '.hdf':
key = 'data' if group is None else group
with HFile(path, 'a') as f:
with h5py.File(path, 'a') as f:
f.create_dataset(key, data=self.numpy(), compression='gzip',
compression_opts=9, shuffle=True)
else:
Expand Down Expand Up @@ -1136,7 +1136,7 @@ def load_array(path, group=None):
data = _numpy.loadtxt(path)
elif ext == '.hdf':
key = 'data' if group is None else group
with HFile(path, 'r') as f:
with h5py.File(path, 'r') as f:
array = Array(f[key])
return array
else:
Expand Down

0 comments on commit d6cd24b

Please sign in to comment.