<commit_before>#!/usr/bin/env python
"""
Extract data necessary for *fitpot* program from vasprun.xml:
total energy, atom positions, forces on atoms, and cell information.
This uses *Vasprun* class in the *pymatgen* package.
Following files will be written:

* pos
* erg.ref
* frc.ref

If the vasprun.xml includes MD trajectory data, directories
with 5-digit name are created and above three files are
put in those directories.

Usage:
    vasp2fitpot.py [options] <vasprun.xml>

Options:
    -h, --help   show this help message and exit.
    -s, --skip=N
                 skip every N steps from the output of MD data. [default: 1]
    --idoffset=I
                 offset of species ID converted from vasprun.xml to pos. [default: 1]
"""

__author__    = "<NAME>"
__email__     = "<EMAIL>"
__copyright__ = "Copyright 2015, <NAME>"
__license__   = "MIT"
__version__   = "0.1"

_usage     = "vasp2fitpot.py [options] <vasprun.xml>"
_fname_pos = "pos"
_fname_erg = "erg.ref"
_fname_frc = "frc.ref"

import os,sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')

import numpy as np
from docopt import docopt
from pymatgen.io.vaspio.vasp_output import Vasprun

from pmdsys import PMDSystem
from atom import Atom



def structure2aSys(structure,idoffset=1):
    """
    Converts Structure object of pymatgen to PMDSystem object in nap.

    Args:
        structure (Structure): pymatgen Structure object to be converted
        to PMDSystem object..

    Returns:
        aSys (PMDSystem): 
    """
    lattice= structure.lattice
    alc= lattice.a
    a1= np.array(lattice.matrix[0])
    a2= np.array(lattice.matrix[1])<commit_msg>Fixed fatal bug in vasp2fitpot.py about the lattice parameter.<commit_after>#!/usr/bin/env python
"""
Extract data necessary for *fitpot* program from vasprun.xml:
total energy, atom positions, forces on atoms, and cell information.
This uses *Vasprun* class in the *pymatgen* package.
Following files will be written:

* pos
* erg.ref
* frc.ref

If the vasprun.xml includes MD trajectory data, directories
with 5-digit name are created and above three files are
put in those directories.

Usage:
    vasp2fitpot.py [options] <vasprun.xml>

Options:
    -h, --help   show this help message and exit.
    -s, --skip=N
                 skip every N steps from the output of MD data. [default: 1]
    --idoffset=I
                 offset of species ID converted from vasprun.xml to pos. [default: 1]
"""

__author__    = "<NAME>"
__email__     = "<EMAIL>"
__copyright__ = "Copyright 2015, Ryo KOBAYASHI"
__license__   = "MIT"
__version__   = "0.1"

_usage     = "vasp2fitpot.py [options] <vasprun.xml>"
_fname_pos = "pos"
_fname_erg = "erg.ref"
_fname_frc = "frc.ref"

import os,sys
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/..')

import numpy as np
from docopt import docopt
from pymatgen.io.vaspio.vasp_output import Vasprun

from pmdsys import PMDSystem
from atom import Atom



def structure2aSys(structure,idoffset=1):
    """
    Converts Structure object of pymatgen to PMDSystem object in nap.

    Args:
        structure (Structure): pymatgen Structure object to be converted
        to PMDSystem object..

    Returns:
        aSys (PMDSystem): 
    """
    lattice= structure.lattice
    alc= 1.0
    a1= np.array(lattice.matrix[0])
    a2= np.array(lattice.matrix[1])
{'fraction_non_alphanumeric': 0.10280932456664674, 'fraction_numerical': 0.01105797967722654, 'mean_word_length': 3.258269720101781, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5416969', 'n_tokens_mistral': 1157, 'n_tokens_neox': 1119, 'n_words': 362}