.. _DeePMDHDF5Format:

deepmd/hdf5 format
==================

Class: :class:`DeePMDHDF5Format <dpdata.plugins.deepmd.DeePMDHDF5Format>`


HDF5 format for DeePMD-kit.















.. rubric:: Examples

Dump a MultiSystems to a HDF5 file:

>>> import dpdata
>>> dpdata.MultiSystems().from_deepmd_npy("data").to_deepmd_hdf5("data.hdf5")


Conversions
-----------

.. _DeePMDHDF5Format_from_system:

Convert from this format to System
``````````````````````````````````

.. py:function:: dpdata.System(file_name: 'str | (h5py.Group | h5py.File)', type_map: 'list[str] | None' = None, fmt: Literal['deepmd/hdf5'] = None) -> dpdata.system.System
   :noindex:
.. py:function:: dpdata.System.from_deepmd_hdf5(file_name: 'str | (h5py.Group | h5py.File)', type_map: 'list[str] | None' = None) -> dpdata.system.System
   :noindex:

   
Convert HDF5 file to System data.


:Parameters:

    **file_name** : str or h5py.Group or h5py.File
        file name of the HDF5 file or HDF5 object. If it is a string,
        hashtag is used to split path to the HDF5 file and the HDF5 group

    **type_map** : dict[str]
        type map



:Returns:

    System
        converted system




:Raises:

    TypeError
        file_name is not str or h5py.Group or h5py.File











.. _DeePMDHDF5Format_to_system:

Convert from System to this format
``````````````````````````````````

.. py:function:: dpdata.System.to(fmt: Literal['deepmd/hdf5'], file_name: 'str | (h5py.Group | h5py.File)', set_size: 'int' = 5000, comp_prec: 'np.dtype' = <class 'numpy.float64'>)
   :noindex:
.. py:function:: dpdata.System.to_deepmd_hdf5(file_name: 'str | (h5py.Group | h5py.File)', set_size: 'int' = 5000, comp_prec: 'np.dtype' = <class 'numpy.float64'>)
   :noindex:

   
Convert System data to HDF5 file.


:Parameters:

    **file_name** : str or h5py.Group or h5py.File
        file name of the HDF5 file or HDF5 object. If it is a string,
        hashtag is used to split path to the HDF5 file and the HDF5 group

    **set_size** : int, default=5000
        set size

    **comp_prec** : np.dtype
        data precision


















.. _DeePMDHDF5Format_to_labeled_system:

Convert from LabeledSystem to this format
`````````````````````````````````````````

.. py:function:: dpdata.LabeledSystem.to(fmt: Literal['deepmd/hdf5'], file_name: 'str | (h5py.Group | h5py.File)', set_size: 'int' = 5000, comp_prec: 'np.dtype' = <class 'numpy.float64'>)
   :noindex:
.. py:function:: dpdata.LabeledSystem.to_deepmd_hdf5(file_name: 'str | (h5py.Group | h5py.File)', set_size: 'int' = 5000, comp_prec: 'np.dtype' = <class 'numpy.float64'>)
   :noindex:

   
Convert System data to HDF5 file.


:Parameters:

    **file_name** : str or h5py.Group or h5py.File
        file name of the HDF5 file or HDF5 object. If it is a string,
        hashtag is used to split path to the HDF5 file and the HDF5 group

    **set_size** : int, default=5000
        set size

    **comp_prec** : np.dtype
        data precision


















.. _DeePMDHDF5Format_from_labeled_system:

Convert from this format to LabeledSystem
`````````````````````````````````````````

.. py:function:: dpdata.LabeledSystem(file_name: 'str | (h5py.Group | h5py.File)', type_map: 'list[str] | None' = None, fmt: Literal['deepmd/hdf5'] = None) -> dpdata.system.LabeledSystem
   :noindex:
.. py:function:: dpdata.LabeledSystem.from_deepmd_hdf5(file_name: 'str | (h5py.Group | h5py.File)', type_map: 'list[str] | None' = None) -> dpdata.system.LabeledSystem
   :noindex:

   
Convert HDF5 file to LabeledSystem data.


:Parameters:

    **file_name** : str or h5py.Group or h5py.File
        file name of the HDF5 file or HDF5 object. If it is a string,
        hashtag is used to split path to the HDF5 file and the HDF5 group

    **type_map** : dict[str]
        type map



:Returns:

    LabeledSystem
        converted system




:Raises:

    TypeError
        file_name is not str or h5py.Group or h5py.File











.. _DeePMDHDF5Format_from_multi_systems:

Convert from this format to MultiSystems
````````````````````````````````````````

.. py:function:: dpdata.MultiSystems.from_deepmd_hdf5(directory: 'str') -> dpdata.system.MultiSystems
   :noindex:

   
Generate HDF5 groups from a HDF5 file, which will be
passed to `from_system`.


:Parameters:

    **directory** : str
        HDF5 file name



:Returns:

    MultiSystems
        converted system















.. _DeePMDHDF5Format_to_multi_systems:

Convert from MultiSystems to this format
````````````````````````````````````````

.. py:function:: dpdata.MultiSystems.to(fmt: Literal['deepmd/hdf5'], directory: 'str') -> dpdata.system.MultiSystems
   :noindex:
.. py:function:: dpdata.MultiSystems.to_deepmd_hdf5(directory: 'str') -> dpdata.system.MultiSystems
   :noindex:

   
Generate HDF5 groups, which will be passed to `to_system`.


:Parameters:

    **directory** : str
        HDF5 file name



:Returns:

    MultiSystems
        this system













