Skip to content

Commit

Permalink
Merge pull request #376 from pyiron/struct
Browse files Browse the repository at this point in the history
Don't conflict with HasHDF in StructureStorage

Drops support for legacy storage format.
  • Loading branch information
pmrv committed Oct 7, 2021
2 parents 2062380 + f5c2920 commit 8a54663
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions pyiron_atomistics/atomistics/structure/structurestorage.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,22 +205,5 @@ def _number_of_structures(self):
return len(self)


def to_hdf(self, hdf, group_name="structures"):
# just overwrite group_name default
super().to_hdf(hdf=hdf, group_name=group_name)

def from_hdf(self, hdf, group_name="structures"):
with hdf.open(group_name) as hdf_s_lst:
version = hdf_s_lst.get("HDF_VERSION", "0.0.0")
if version == "0.0.0":
self._per_element_arrays["symbols"] = hdf_s_lst["symbols"].astype(np.dtype("U2"))
self._per_element_arrays["positions"] = hdf_s_lst["positions"]

self._per_chunk_arrays["start_index"] = hdf_s_lst["start_indices"]
self._per_chunk_arrays["length"] = hdf_s_lst["len_current_struct"]
self._per_chunk_arrays["identifier"] = hdf_s_lst["identifiers"].astype(np.dtype("U20"))
self._per_chunk_arrays["cell"] = hdf_s_lst["cells"]

self._per_chunk_arrays["pbc"] = np.full((self.num_chunks, 3), True)
else:
super().from_hdf(hdf=hdf, group_name=group_name)
def _get_hdf_group_name(self):
return "structures"

0 comments on commit 8a54663

Please sign in to comment.