<commit_before>import pytest

from compas.datastructures import Mesh
from compas.datastructures import mesh_subdivide


@pytest.fixture
def mesh_tris():
    mesh = Mesh.from_polyhedron(6)
    mesh.quads_to_triangles()
    return mesh


@pytest.fixture
def mesh_quads():
    mesh = Mesh.from_polyhedron(6)
    return mesh


def test_quads_subdivide(mesh_quads):
    subd = mesh_subdivide(mesh_quads)
    assert subd.number_of_faces() == 4 * mesh_quads.number_of_faces()


def test_tris_subdivide(mesh_tris):
    subd = mesh_subdivide(mesh_tris)
    assert subd.number_of_faces() == 3 * mesh_tris.number_of_faces()<commit_msg>more subd tests<commit_after>import pytest

from compas.datastructures import Mesh
from compas.datastructures import mesh_subdivide


@pytest.fixture
def mesh_tris():
    mesh = Mesh.from_polyhedron(6)
    mesh.quads_to_triangles()
    return mesh


@pytest.fixture
def mesh_quads():
    mesh = Mesh.from_polyhedron(6)
    return mesh


def test_quads_subdivide(mesh_quads):
    subd = mesh_subdivide(mesh_quads)
    assert subd.number_of_faces() == 4 * mesh_quads.number_of_faces()
    assert subd.number_of_vertices() == (mesh_quads.number_of_vertices() +
                                         mesh_quads.number_of_edges() +
                                         mesh_quads.number_of_faces())


def test_tris_subdivide(mesh_tris):
    subd = mesh_subdivide(mesh_tris)
    assert subd.number_of_faces() == 3 * mesh_tris.number_of_faces()
    assert subd.number_of_vertices() == (mesh_tris.number_of_vertices() +
                                         mesh_tris.number_of_edges() +
                                         mesh_tris.number_of_faces())


def test_quads_subdivide_tri(mesh_quads):
    subd = mesh_subdivide(mesh_quads, scheme='tri')
    assert subd.number_of_faces() == 4 * mesh_quads.number_of_faces()
    assert subd.number_of_vertices() == mesh_quads.number_of_vertices() + mesh_quads.number_of_faces()


def test_tris_subdivide_tri(mesh_tris):
    subd = mesh_subdivide(mesh_tris, scheme='tri')
    assert subd.number_of_faces() == 3 * mesh_tris.number_of_faces()
    assert subd.number_of_vertices() == mesh_tris.number_of_vertices() + mesh_tris.number_of_faces()


def test_quads_subdivide_quad(mesh_quads):
    subd = mesh_subdivide(mesh_quads, scheme='quad')
    assert subd.number_of_faces() == 4 * mesh_quads.number_of_faces()
    assert subd.number_of_vertices() == (mesh_quads.number_of_vertices() +
                                         mesh_quads.number_of_edges() +
                                         mesh_quads.number_of_faces())


def test_tris_subdivide_quad(mesh_tris):
    subd = mesh_subdivide(mesh_tris, scheme='quad')
    assert subd.number_of_faces() == 3 * mesh_tris.number_of_faces()
    assert subd.number_of_vertices() == (mesh_tris.number_of_vertices() +
                                         mesh_tris.number_of_edges() +
                                         mesh_tris.number_of_faces())
{'fraction_non_alphanumeric': 0.0953020134228188, 'fraction_numerical': 0.004026845637583893, 'mean_word_length': 3.1117241379310343, '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': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6262614', 'n_tokens_mistral': 1046, 'n_tokens_neox': 1008, 'n_words': 147}