<commit_before># -*- coding: utf-8 -*-
"""
===============================================================================
Atom class for crystal structure basis (:mod:`sknano.core.atoms._basis_atom`)
===============================================================================

An `Atom` sub-class for a crystal structure basis atom.

.. currentmodule:: sknano.core.atoms._basis_atom

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

from functools import total_ordering
import copy
import numbers
import numpy as np

from sknano.core.math import Vector
from ._xyz_atom import XYZAtom

__all__ = ['BasisAtom']


@total_ordering
class BasisAtom(XYZAtom):
    """An abstract object representation of a crystal structure basis atom.

    Parameters
    ----------

    """

    def __init__(self, *args, lattice=None, xs=None, ys=None, zs=None,
                 **kwargs):

        super().__init__(*args, **kwargs)

        self.lattice = lattice
        try:
            self.rs = Vector([xs, ys, zs])
        except AttributeError:
            pass
        self.fmtstr = super().fmtstr + \
            ", xs={xs:.6f}, ys={ys:.6f}, zs={zs:.6f}"<commit_msg>Updating `fmtstr` to include the `lattice` value.<commit_after># -*- coding: utf-8 -*-
"""
===============================================================================
Atom class for crystal structure basis (:mod:`sknano.core.atoms._basis_atom`)
===============================================================================

An `Atom` sub-class for a crystal structure basis atom.

.. currentmodule:: sknano.core.atoms._basis_atom

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

from functools import total_ordering
import copy
import numbers
import numpy as np

from sknano.core.math import Vector
from ._xyz_atom import XYZAtom

__all__ = ['BasisAtom']


@total_ordering
class BasisAtom(XYZAtom):
    """An abstract object representation of a crystal structure basis atom.

    Parameters
    ----------

    """

    def __init__(self, *args, lattice=None, xs=None, ys=None, zs=None,
                 **kwargs):

        super().__init__(*args, **kwargs)

        self.lattice = lattice
        try:
            self.rs = Vector([xs, ys, zs])
        except AttributeError:
            pass
        self.fmtstr = super().fmtstr + \
            ", xs={xs:.6f}, ys={ys:.6f}, zs={zs:.6f}, lattice={lattice!r}"
{'fraction_non_alphanumeric': 0.232413525068014, 'fraction_numerical': 0.003109211037699184, 'mean_word_length': 3.604651162790698, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1534873', 'n_tokens_mistral': 765, 'n_tokens_neox': 712, 'n_words': 196}