<commit_before>import helpers
import numpy as np
import pytest

import meshio

test_set_full = [
    helpers.empty_mesh,
    helpers.line_mesh,
    helpers.tri_mesh,
    helpers.line_tri_mesh,
    helpers.tri_mesh_2d,
    helpers.triangle6_mesh,
    helpers.quad_mesh,
    helpers.quad8_mesh,
    helpers.tri_quad_mesh,
    helpers.tet_mesh,
    helpers.tet10_mesh,
    helpers.hex_mesh,
    helpers.hex20_mesh,
    helpers.add_point_data(helpers.tri_mesh, 1),
    helpers.add_cell_data(helpers.tri_mesh, [("a", (), np.float64)]),
]


@pytest.mark.parametrize("mesh", test_set_full)
@pytest.mark.parametrize("compression", [None, "gzip"])
def test_xdmf3(mesh, compression):
    def write(*args, **kwargs):
        return meshio.xdmf.write(*args, compression=compression, **kwargs)

    helpers.write_read(write, meshio.xdmf.read, mesh, 1.0e-14)


def test_generic_io():
    helpers.generic_io("test.hmf")
    # With additional, insignificant suffix:
    helpers.generic_io("test.0.hmf")<commit_msg>tests: expect warning for hmf<commit_after>import helpers
import numpy as np
import pytest

import meshio

test_set_full = [
    helpers.empty_mesh,
    helpers.line_mesh,
    helpers.tri_mesh,
    helpers.line_tri_mesh,
    helpers.tri_mesh_2d,
    helpers.triangle6_mesh,
    helpers.quad_mesh,
    helpers.quad8_mesh,
    helpers.tri_quad_mesh,
    helpers.tet_mesh,
    helpers.tet10_mesh,
    helpers.hex_mesh,
    helpers.hex20_mesh,
    helpers.add_point_data(helpers.tri_mesh, 1),
    helpers.add_cell_data(helpers.tri_mesh, [("a", (), np.float64)]),
]


@pytest.mark.parametrize("mesh", test_set_full)
@pytest.mark.parametrize("compression", [None, "gzip"])
def test_xdmf3(mesh, compression):
    def write(*args, **kwargs):
        return meshio.xdmf.write(*args, compression=compression, **kwargs)

    helpers.write_read(write, meshio.xdmf.read, mesh, 1.0e-14)


def test_generic_io():
    with pytest.warns(UserWarning):
        helpers.generic_io("test.hmf")

    with pytest.warns(UserWarning):
        # With additional, insignificant suffix:
        helpers.generic_io("test.0.hmf")
{'fraction_non_alphanumeric': 0.12446351931330472, 'fraction_numerical': 0.015259895088221268, 'mean_word_length': 4.117073170731707, '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': '6767418', 'n_tokens_mistral': 810, 'n_tokens_neox': 788, 'n_words': 119}