<commit_before># -*- coding: utf-8 -*-
#
from __future__ import absolute_import, division, print_function

import nose
from nose.tools import *
from pkg_resources import resource_filename
from sknano.io import DATAData, DATAReader, DATAWriter, DATA2XYZConverter, \
    DATAFormatSpec, atom_styles


def test_atom_styles():
    print('atom_styles: {}\n'.format(atom_styles))

    formatspec = DATAFormatSpec(atom_style='full')
    #print('formatspec.header_specs: {}\n'.format(header_specs))
    #print('formatspec.section_header_map: {}\n'.format(section_header_map))
    print('formatspec.section_attrs: {}\n'.format(formatspec.section_attrs))
    print('formatspec.section_attrs_specs: {}\n'.format(
        formatspec.section_attrs_specs))


def test_data():
    datafile = resource_filename('sknano', 'data/nanotubes/1010_1cell.data')
    atoms = DATAData(fpath=datafile).atoms
    atoms.assign_unique_ids()
    atoms.update_attrs()
    assert_not_equal(atoms.Natoms, 20)
    assert_equal(atoms.Natoms, 40)


def test_reader():
    datafile = resource_filename('sknano', 'data/nanotubes/1010_1cell.data')
    reader = DATAReader(datafile)
    atoms = reader.atoms
    atoms.assign_unique_ids()
    atoms.update_attrs()
    assert_not_equal(atoms.Natoms, 20)
    assert_equal(atoms.Natoms, 40)


if __name__ == '__main__':
    nose.runmodule()
<commit_msg>Updating test module for LAMMPS data format.<commit_after># -*- coding: utf-8 -*-
#
from __future__ import absolute_import, division, print_function

import nose
from nose.tools import *
from pkg_resources import resource_filename
from sknano.io import DATAData, DATAReader, DATAWriter, DATA2XYZConverter, \
    DATAFormatSpec, atom_styles


def test_atom_styles():
    print('atom_styles: {}\n'.format(atom_styles))

    formatspec = DATAFormatSpec(atom_style='full')
    #print('formatspec.header_specs: {}\n'.format(header_specs))
    #print('formatspec.section_header_map: {}\n'.format(section_header_map))
    print('formatspec.section_attrs: {}\n'.format(formatspec.section_attrs))
    print('formatspec.section_attrs_specs: {}\n'.format(
        formatspec.section_attrs_specs))


def test_data():
    datafile = resource_filename('sknano', 'data/nanotubes/1010_1cell.data')
    atoms = DATAData(fpath=datafile).structure.atoms
    atoms.assign_unique_ids()
    atoms.update_attrs()
    assert_not_equal(atoms.Natoms, 20)
    assert_equal(atoms.Natoms, 40)


def test_reader():
    datafile = resource_filename('sknano', 'data/nanotubes/1010_1cell.data')
    reader = DATAReader(datafile)
    atoms = reader.structure.atoms
    atoms.assign_unique_ids()
    atoms.update_attrs()
    assert_not_equal(atoms.Natoms, 20)
    assert_equal(atoms.Natoms, 40)


if __name__ == '__main__':
    nose.runmodule()

{'fraction_non_alphanumeric': 0.12387143373058866, 'fraction_numerical': 0.01444564824846515, 'mean_word_length': 4.918803418803419, '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': '3821402', 'n_tokens_mistral': 991, 'n_tokens_neox': 958, 'n_words': 154}