<commit_before># -*- coding: utf-8 -*-
"""
========================================================================
Class for LAMMPS atoms (:mod:`sknano.structure_io.atoms._lammps_atoms`)
========================================================================

.. currentmodule:: sknano.structure_io.atoms._lammps_atoms

"""
from __future__ import absolute_import, division, print_function
__docformat__ = 'restructuredtext en'

from collections import OrderedDict

import numpy as np

try:
    from scipy.spatial import KDTree
    has_kdtree = True
except ImportError:
    print('Install scipy version >= 0.13.0 to allow '
          'nearest-neighbor queries between atoms.')
    has_kdtree = False

from ...tools import xyz_axes
from ._atoms import Atoms

__all__ = ['LAMMPSAtoms']


class LAMMPSAtoms(Atoms):
    """`Atoms` class for creating collection of `LAMMPSAtom` objects.

    Parameters
    ----------
    atoms : {None, sequence, `LAMMPSAtoms`}, optional
        if not `None`, then a list of `LAMMPSAtom` instance objects or an
        existing `LAMMPSAtoms` instance object.
    copylist : bool, optional
        perform shallow copy of atoms list
    deepcopy : bool, optional
        perform deepcopy of atoms list
    use_kdtree : bool, optional
        use :py:class:`~scipy:scipy.spatial.KDTree` to perform
        nearest-neighbor analysis.

    """

    def __init__(self, atoms=None, copylist=True, deepcopy=False,
                 use_kdtree=True):

        super(LAMMPSAtoms, self).__init__(
            atoms=atoms, copylist=copylist, deepcopy=deepcopy,
            update_property_lists=False)

        self._property_lists['q'] = self._charges = []
        self._property_lists['v'] = self._velocities = []
        self._property_lists['atomID'] = self._atom_ids = []
        self._property_lists['moleculeID'] = self._molecule_ids = []
        self._property_lists['CN'] = self._coordination_numbers = []
        self._property_lists['NN'] = self._nearest_neighbors = []
        #self._forces = []

        self._atomtypes = {}

        self._atom_tree = None

        if use_kdtree and has_kdtree is False:
            use_kdtree = False
        self._use_kdtree = use_kdtree

        self._NN_number = 6
        self._NN_cutoff = np.inf

        if atoms is not None:
            for atom in self._atoms:
                for p, plist in self._property_lists.iteritems():
                    plist.append(getattr(atom, p))

            if use_kdtree:
                self._atom_tree = self.atom_tree<commit_msg>minor tweaks<commit_after># -*- coding: utf-8 -*-
"""
========================================================================
Class for LAMMPS atoms (:mod:`sknano.structure_io.atoms._lammps_atoms`)
========================================================================

.. currentmodule:: sknano.structure_io.atoms._lammps_atoms

"""
from __future__ import absolute_import, division, print_function
__docformat__ = 'restructuredtext en'

from collections import OrderedDict

import numpy as np

try:
    from scipy.spatial import KDTree
    has_kdtree = True
except ImportError:
    print('Install scipy version >= 0.13.0 to allow '
          'nearest-neighbor queries between atoms.')
    has_kdtree = False

from ...tools import xyz_axes
from ._atoms import Atoms

__all__ = ['LAMMPSAtoms']


class LAMMPSAtoms(Atoms):
    """`Atoms` class for creating collection of `LAMMPSAtom` objects.

    Parameters
    ----------
    atoms : {None, sequence, `LAMMPSAtoms`}, optional
        if not `None`, then a list of `LAMMPSAtom` instance objects or an
        existing `LAMMPSAtoms` instance object.
    copylist : bool, optional
        perform shallow copy of atoms list
    deepcopy : bool, optional
        perform deepcopy of atoms list
    use_kdtree : bool, optional
        use :py:class:`~scipy:scipy.spatial.KDTree` to perform
        nearest-neighbor analysis.

    """

    def __init__(self, atoms=None, copylist=True, deepcopy=False,
                 use_kdtree=True):

        super(LAMMPSAtoms, self).__init__(
            atoms=atoms, copylist=copylist, deepcopy=deepcopy,
            update_property_lists=False)

        self._atomtypes = {}

        self._property_lists['q'] = self._charges = []
        self._property_lists['v'] = self._velocities = []
        self._property_lists['atomID'] = self._atom_ids = []
        self._property_lists['moleculeID'] = self._molecule_ids = []
        self._property_lists['CN'] = self._coordination_numbers = []
        self._property_lists['NN'] = self._nearest_neighbors = []
        #self._forces = []

        self._atom_tree = None
        if use_kdtree and has_kdtree is False:
            use_kdtree = False
        self._use_kdtree = use_kdtree

        self._NN_number = 6
        self._NN_cutoff = np.inf

        if atoms is not None:
            for atom in self._atoms:
                for p, plist in self._property_lists.iteritems():
                    plist.append(getattr(atom, p))

            if use_kdtree:
                self._atom_tree = self.atom_tree
{'fraction_non_alphanumeric': 0.1531496062992126, 'fraction_numerical': 0.002362204724409449, 'mean_word_length': 2.805992509363296, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '3942795', 'n_tokens_mistral': 1575, 'n_tokens_neox': 1514, 'n_words': 356}