<commit_before>from random import choice, random, randrange, uniform
import pytest

from htsohm.material_files import random_number_density

@pytest.fixture
def LCs():
    #==============================================================================
    # default limits (see htsohm.sample.yaml)
    LC_limits = [25.6, 51.2]

    #==============================================================================
    # pick random lattice-constans within limits
    LCs = {
        'a'           : uniform(*LC_limits),
        'b'           : uniform(*LC_limits),
        'c'           : uniform(*LC_limits)
    }
    LCs['volume'] = LCs['a'] * LCs['b'] * LCs['c']
    return LCs

@pytest.fixture
def ND_limits():
    #==========================================================================
    # default limits (see htsohm.sample.yaml)
    limits = [1.49e-05, 0.02122]
    return limits

def test_boundaries(LCs, ND_limits):
#    for i in range(0, 10):
     number_density = random_number_density(ND_limits, LCs) / LCs['volume']
     assert number_density >= ND_limits[0] and number_density <= ND_limits[1]

def test_two_site_constraint(LCs, ND_limits):
#    for i in range(0, 10):
    assert random_number_density(ND_limits, LCs) >= 2
<commit_msg>latest version of test<commit_after>from random import choice, random, randrange, uniform
import pytest

from htsohm.material_files import random_number_density

@pytest.fixture
def LCs():
    lattice_constants = {
        'a' : 1,
        'b' : 1,
        'c' : 1
    }
    return lattice_constants

def test_number_density_bounds():
    assert random_number_density((100000, 100000), LCs) == 100000

def test_two_site_constraint():
    assert random_number_density((0, 1), LCs) == 2 and random_number_density((0, 2), LCs) == 2

{'fraction_non_alphanumeric': 0.23202247191011235, 'fraction_numerical': 0.029775280898876405, 'mean_word_length': 3.9472222222222224, 'pattern_counts': {'":': 0, '<': 4, '<?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': '2734801', 'n_tokens_mistral': 606, 'n_tokens_neox': 542, 'n_words': 130}