-
Notifications
You must be signed in to change notification settings - Fork 48
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
Dataset HDF5 broken #714
Comments
This issue appears to be related: h5py/h5py#1948 The issue seems to be that dataset_kwargs = {"chunks": True, "fletcher32": True} Perhaps just setting this to |
Working through this now; have other issues I'm hitting in trying to export e.g.
|
This means that it's trying to convert a force or gradient into an energy. Perhaps the HDF5 export code was written before we started storing gradients? |
The error is triggered by this line, where a new_data[qname] *= constants.conversion_factor(units[qname], self.units)
I'm not entirely sure how this data model was intended to work---presumably each driver was intended to have its own au_units = {"energy": "hartree", "gradient": "hartree/bohr", "hessian": "hartree/bohr**2"} that would provide the desired post-conversion units units = {"energy": "kcal/mol", "gradient": "kcal/mol/angstrom", "hessian": "kcal/mol/angstrom**2"} and to just look up the appropriate new_data[qname] *= constants.conversion_factor(units[qname], self.units)
self._column_metadata[qname].update({"native": True, "units": self.units}) Alternatively, it's possible that |
You can also just set the units on the dataset for example |
I've created #715 that fixes HDF5 export functionality, but as @jthorton points out this does not feature much information; as constructed it only gives Rather than working to expand this functionality here, I'd rather us focus on getting the functionality we want in QCSubmit if possible. We'll get what we need into openforcefield/openff-qcsubmit#197. @bennybp and I want to get a reasonable export pathway into QCFractal proper, but this should go into the |
v0.50 does not have HDF5 support (yet), so this issue is moot now. |
Describe the bug
Exporting single point datasets to HDF5 files seems to be broken.
To Reproduce
ValueError Traceback (most recent call last)
Input In [23], in
----> 1 ds.to_file("test.hdf5", "hdf5")
File ~/mambaforge/envs/bespokefit/lib/python3.8/site-packages/qcportal/collections/dataset.py:240, in Dataset.to_file(self, path, encoding)
237 elif encoding.lower() in ["hdf5", "h5"]:
238 from . import HDF5View
--> 240 HDF5View(path).write(self)
241 else:
242 raise NotImplementedError(f"Unsupported encoding: {encoding}")
File ~/mambaforge/envs/bespokefit/lib/python3.8/site-packages/qcportal/collections/dataset_view.py:321, in HDF5View.write(self, ds)
319 molecules = ds.get_molecules(force=True)
320 mol_shape = (len(molecules),)
--> 321 mol_geometry = molecule_group.create_dataset(
322 "geometry", shape=mol_shape, dtype=vlen_double_t, **dataset_kwargs
323 )
324 mol_symbols = molecule_group.create_dataset("symbols", shape=mol_shape, dtype=vlen_utf8_t, **dataset_kwargs)
325 mol_schema = molecule_group.create_dataset("schema", shape=mol_shape, dtype=bytes_t, **dataset_kwargs)
File ~/mambaforge/envs/bespokefit/lib/python3.8/site-packages/h5py/_hl/group.py:149, in Group.create_dataset(self, name, shape, dtype, data, **kwds)
146 parent_path, name = name.rsplit(b'/', 1)
147 group = self.require_group(parent_path)
--> 149 dsid = dataset.make_new_dset(group, shape, dtype, data, name, **kwds)
150 dset = dataset.Dataset(dsid)
151 return dset
File ~/mambaforge/envs/bespokefit/lib/python3.8/site-packages/h5py/_hl/dataset.py:142, in make_new_dset(parent, shape, dtype, data, name, chunks, compression, shuffle, fletcher32, maxshape, compression_opts, fillvalue, scaleoffset, track_times, external, track_order, dcpl, allow_unknown_filter)
138 else:
139 sid = h5s.create_simple(shape, maxshape)
--> 142 dset_id = h5d.create(parent.id, name, tid, sid, dcpl=dcpl)
144 if (data is not None) and (not isinstance(data, Empty)):
145 dset_id.write(h5s.ALL, h5s.ALL, data)
File h5py/_objects.pyx:54, in h5py._objects.with_phil.wrapper()
File h5py/_objects.pyx:55, in h5py._objects.with_phil.wrapper()
File h5py/h5d.pyx:87, in h5py.h5d.create()
ValueError: Unable to create dataset (not suitable for filters)
Expected behavior
This should make a HDF5 view of the dataset.
Additional context
QCPortal version 0.15.8
h5py version 3.6.0
The text was updated successfully, but these errors were encountered: