Skip to content

Commit

Permalink
add an example
Browse files Browse the repository at this point in the history
  • Loading branch information
njzjz committed Oct 8, 2021
1 parent 00e3af1 commit eb14fd3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dpdata/plugins/deepmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ def from_labeled_system(self, file_name, type_map=None, **kwargs):

@Format.register("deepmd/hdf5")
class DeePMDCompFormat(Format):
"""HDF5 format for DeePMD-kit.
Examples
--------
Dump a MultiSystems to a HDF5 file:
>>> import dpdata
>>> dpdata.MultiSystems().from_deepmd_npy("data").to_deepmd_hdf5("data.hdf5")
"""
def from_system(self, file_name, type_map=None, **kwargs):
s = file_name.split("#")
name = s[1] if len(s) > 1 else ""
Expand Down

0 comments on commit eb14fd3

Please sign in to comment.