.. _N2P2Format:

n2p2 format
===========

Class: :class:`N2P2Format <dpdata.plugins.n2p2.N2P2Format>`


n2p2.

This class support the conversion from and to the training data of n2p2 format.
For more information about the n2p2 format, please refer to https://compphysvienna.github.io/n2p2/topics/cfg_file.html
















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

.. _N2P2Format_from_labeled_system:

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

.. py:function:: dpdata.LabeledSystem(file_name: 'FileType', fmt: Literal['n2p2'] = None) -> dpdata.system.LabeledSystem
   :noindex:
.. py:function:: dpdata.LabeledSystem.from_n2p2(file_name: 'FileType') -> dpdata.system.LabeledSystem
   :noindex:

   
Read from n2p2 format.


:Parameters:

    **file_name** : str
        file name, i.e. the first argument



:Returns:

    LabeledSystem
        converted system















.. _N2P2Format_to_labeled_system:

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

.. py:function:: dpdata.LabeledSystem.to(fmt: Literal['n2p2'], file_name: 'FileType')
   :noindex:
.. py:function:: dpdata.LabeledSystem.to_n2p2(file_name: 'FileType')
   :noindex:

   
Write n2p2 format.

By default, LabeledSystem.to will fallback to System.to.

:Parameters:

    **file_name** : str
        file name, where the data will be written
















