repo_id stringclasses 400
values | commit_sha stringclasses 400
values | commit_index int32 0 951 | in_repo_split stringclasses 1
value | cross_repo_split stringclasses 1
value | test_file stringlengths 7 121 | test_function stringlengths 1 108 | assertion_type stringclasses 32
values | difficulty stringclasses 8
values | context_lines int32 3 600 | prefix large_stringlengths 44 113k | target large_stringlengths 1 498 | anchor_sha stringclasses 400
values | anchor_index int32 0 951 | qna_source stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/legacy_reader.py | _read_exodusii_mesh | assert | numeric_literal | 170 | import numpy
from meshio import Mesh
from meshio.vtk_io import vtk_to_meshio_type
def read(filetype, filename):
import vtk
from vtk.util import numpy_support
def _read_data(data):
"""Extract numpy arrays from a VTK data set."""
# Go through all arrays, fetch data.
out = {}
... | 1 | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/legacy_reader.py | read | assert | string_literal | 102 | import numpy
from meshio import Mesh
from meshio.vtk_io import vtk_to_meshio_type
def read(filetype, filename):
import vtk
from vtk.util import numpy_support
def _read_data(data):
"""Extract numpy arrays from a VTK data set."""
# Go through all arrays, fetch data.
out = {}
... | "exodus" | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/legacy_writer.py | _get_writer | assert | string_literal | 72 | import logging
import numpy
vtk_to_meshio_type = {
0: "empty",
1: "vertex",
# 2: 'poly_vertex',
3: "line",
# 4: 'poly_line',
5: "triangle",
# 6: 'triangle_strip',
7: "polygon",
# 8: 'pixel',
9: "quad",
10: "tetra",
# 11: 'voxel',
12: "hexahedron",
13: "wedge",
... | "exodus" | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/legacy_writer.py | write | assert | complex_expr | 93 | import logging
import numpy
vtk_to_meshio_type = {
0: "empty",
1: "vertex",
# 2: 'poly_vertex',
3: "line",
# 4: 'poly_line',
5: "triangle",
# 6: 'triangle_strip',
7: "polygon",
# 8: 'pixel',
9: "quad",
10: "tetra",
# 11: 'voxel',
12: "hexahedron",
13: "wedge",
... | mesh.cells | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/legacy_writer.py | write | assert | func_call | 90 | import logging
import numpy
vtk_to_meshio_type = {
0: "empty",
1: "vertex",
# 2: 'poly_vertex',
3: "line",
# 4: 'poly_line',
5: "triangle",
# 6: 'triangle_strip',
7: "polygon",
# 8: 'pixel',
9: "quad",
10: "tetra",
# 11: 'voxel',
12: "hexahedron",
13: "wedge",
... | len(mesh.points) | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/legacy_writer.py | write | assert | func_call | 95 | import logging
import numpy
vtk_to_meshio_type = {
0: "empty",
1: "vertex",
# 2: 'poly_vertex',
3: "line",
# 4: 'poly_line',
5: "triangle",
# 6: 'triangle_strip',
7: "polygon",
# 8: 'pixel',
9: "quad",
10: "tetra",
# 11: 'voxel',
12: "hexahedron",
13: "wedge",
... | len(mesh.cells[key]) | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/legacy_writer.py | write | assert | complex_expr | 132 | import logging
import numpy
vtk_to_meshio_type = {
0: "empty",
1: "vertex",
# 2: 'poly_vertex',
3: "line",
# 4: 'poly_line',
5: "triangle",
# 6: 'triangle_strip',
7: "polygon",
# 8: 'pixel',
9: "quad",
10: "tetra",
# 11: 'voxel',
12: "hexahedron",
13: "wedge",
... | mesh.cell_data[cell_type] | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_abaqus.py | test_reference_file | assert | variable | 34 | import os
import pathlib
import tempfile
import helpers
import numpy
import pytest
import meshio
def test(mesh):
def writer(*args, **kwargs):
return meshio.abaqus.write(*args, **kwargs)
helpers.write_read(writer, meshio.abaqus.read, mesh, 1.0e-15)
@pytest.mark.parametrize(
"filename, ref_sum, r... | ref_num_cells | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_abaqus.py | test_elset | assert | func_call | 39 | import os
import pathlib
import tempfile
import helpers
import numpy
import pytest
import meshio
def test(mesh):
def writer(*args, **kwargs):
return meshio.abaqus.write(*args, **kwargs)
helpers.write_read(writer, meshio.abaqus.read, mesh, 1.0e-15)
def test_elset():
points = numpy.array(
... | len(mesh.cells) | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_abaqus.py | test_reference_file | assert | variable | 35 | import os
import pathlib
import tempfile
import helpers
import numpy
import pytest
import meshio
def test(mesh):
def writer(*args, **kwargs):
return meshio.abaqus.write(*args, **kwargs)
helpers.write_read(writer, meshio.abaqus.read, mesh, 1.0e-15)
@pytest.mark.parametrize(
"filename, ref_sum, r... | ref_num_cell_sets | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_abaqus.py | test_elset | assert | complex_expr | 41 | import os
import pathlib
import tempfile
import helpers
import numpy
import pytest
import meshio
def test(mesh):
def writer(*args, **kwargs):
return meshio.abaqus.write(*args, **kwargs)
helpers.write_read(writer, meshio.abaqus.read, mesh, 1.0e-15)
def test_elset():
points = numpy.array(
... | mesh.cells[ic].type | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_abaqus.py | test_elset | assert | func_call | 44 | import os
import pathlib
import tempfile
import helpers
import numpy
import pytest
import meshio
def test(mesh):
def writer(*args, **kwargs):
return meshio.abaqus.write(*args, **kwargs)
helpers.write_read(writer, meshio.abaqus.read, mesh, 1.0e-15)
def test_elset():
points = numpy.array(
... | sorted(mesh.cell_sets.keys()) | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_cli.py | test_convert | assert | complex_expr | 34 | import tempfile
import helpers
import numpy
import meshio
def is_same_mesh(mesh0, mesh1, atol):
if not numpy.allclose(mesh0.points, mesh1.points, atol=atol, rtol=0.0):
return False
for cells0, cells1 in zip(mesh0.cells, mesh1.cells):
if cells0.type != cells1.type or not numpy.allclose(cells0.... | cells1.type | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_flac3d.py | test_reference_file | assert | variable | 52 | import copy
import pathlib
import sys
import helpers
import numpy
import pytest
import meshio
def test(mesh, binary, data):
if data:
mesh = copy.deepcopy(mesh)
mesh.cell_data["flac3d:group"] = [numpy.array(data)]
helpers.write_read(
lambda f, m: meshio.flac3d.write(f, m, binary=binary... | ref_num_cells | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_flac3d.py | test_reference_file | assert | variable | 55 | import copy
import pathlib
import sys
import helpers
import numpy
import pytest
import meshio
def test(mesh, binary, data):
if data:
mesh = copy.deepcopy(mesh)
mesh.cell_data["flac3d:group"] = [numpy.array(data)]
helpers.write_read(
lambda f, m: meshio.flac3d.write(f, m, binary=binary... | ref_sum_cell_data | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_gmsh.py | test_reference_file | assert | complex_expr | 33 | import copy
import pathlib
from functools import partial
import helpers
import numpy
import pytest
import meshio
def gmsh_periodic():
mesh = copy.deepcopy(helpers.quad_mesh)
trns = [0] * 16 # just for io testing
mesh.gmsh_periodic = [
[0, (3, 1), None, [[2, 0]]],
[0, (4, 6), None, [[3, 5... | tol * ref_sum | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_gmsh.py | test_reference_file | assert | variable | 35 | import copy
import pathlib
from functools import partial
import helpers
import numpy
import pytest
import meshio
def gmsh_periodic():
mesh = copy.deepcopy(helpers.quad_mesh)
trns = [0] * 16 # just for io testing
mesh.gmsh_periodic = [
[0, (3, 1), None, [[2, 0]]],
[0, (4, 6), None, [[3, 5... | ref_num_cells | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_gmsh.py | test_reference_file | assert | collection | 34 | import copy
import pathlib
from functools import partial
import helpers
import numpy
import pytest
import meshio
def gmsh_periodic():
mesh = copy.deepcopy(helpers.quad_mesh)
trns = [0] * 16 # just for io testing
mesh.gmsh_periodic = [
[0, (3, 1), None, [[2, 0]]],
[0, (4, 6), None, [[3, 5... | ["line", "triangle"] | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_gmsh.py | test_reference_file_with_entities | assert | variable | 58 | import copy
import pathlib
from functools import partial
import helpers
import numpy
import pytest
import meshio
def gmsh_periodic():
mesh = copy.deepcopy(helpers.quad_mesh)
trns = [0] * 16 # just for io testing
mesh.gmsh_periodic = [
[0, (3, 1), None, [[2, 0]]],
[0, (4, 6), None, [[3, 5... | ref_num_cells_in_cell_sets | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_med.py | test_reference_file_with_mixed_cells | assert | numeric_literal | 25 | import pathlib
import helpers
import numpy
import pytest
import meshio
h5py = pytest.importorskip("h5py")
def test_reference_file_with_mixed_cells():
this_dir = pathlib.Path(__file__).resolve().parent
filename = this_dir / "meshes" / "med" / "cylinder.med"
mesh = meshio.read(filename)
# Points
... | 52 | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_med.py | test_reference_file_with_point_cell_data | assert | collection | 26 | import pathlib
import helpers
import numpy
import pytest
import meshio
h5py = pytest.importorskip("h5py")
def test_reference_file_with_point_cell_data():
this_dir = pathlib.Path(__file__).resolve().parent
filename = this_dir / "meshes" / "med" / "box.med"
mesh = meshio.read(filename)
# Points
... | (8, 3) | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_med.py | test_reference_file_with_point_cell_data | assert | collection | 32 | import pathlib
import helpers
import numpy
import pytest
import meshio
h5py = pytest.importorskip("h5py")
def test_reference_file_with_point_cell_data():
this_dir = pathlib.Path(__file__).resolve().parent
filename = this_dir / "meshes" / "med" / "box.med"
mesh = meshio.read(filename)
# Points
... | (1, 8, 6) | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_med.py | test_reference_file_with_point_cell_data | assert | collection | 46 | import pathlib
import helpers
import numpy
import pytest
import meshio
h5py = pytest.importorskip("h5py")
def test_reference_file_with_point_cell_data():
this_dir = pathlib.Path(__file__).resolve().parent
filename = this_dir / "meshes" / "med" / "box.med"
mesh = meshio.read(filename)
# Points
... | (1, 8, 1) | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_med.py | test_reference_file_with_mixed_cells | assert | variable | 22 | import pathlib
import helpers
import numpy
import pytest
import meshio
h5py = pytest.importorskip("h5py")
def test_reference_file_with_mixed_cells():
this_dir = pathlib.Path(__file__).resolve().parent
filename = this_dir / "meshes" / "med" / "cylinder.med"
mesh = meshio.read(filename)
# Points
... | ref_num_cells | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_med.py | test_reference_file_with_mixed_cells | assert | variable | 37 | import pathlib
import helpers
import numpy
import pytest
import meshio
h5py = pytest.importorskip("h5py")
def test_reference_file_with_mixed_cells():
this_dir = pathlib.Path(__file__).resolve().parent
filename = this_dir / "meshes" / "med" / "cylinder.med"
mesh = meshio.read(filename)
# Points
... | ref_sum_cell_tags | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_med.py | test_reference_file_with_point_cell_data | assert | collection | 22 | import pathlib
import helpers
import numpy
import pytest
import meshio
h5py = pytest.importorskip("h5py")
def test_reference_file_with_point_cell_data():
this_dir = pathlib.Path(__file__).resolve().parent
filename = this_dir / "meshes" / "med" / "box.med"
mesh = meshio.read(filename)
# Points
... | {"hexahedron": 1} | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_med.py | test_reference_file_with_mixed_cells | assert | variable | 49 | import pathlib
import helpers
import numpy
import pytest
import meshio
h5py = pytest.importorskip("h5py")
def test_reference_file_with_mixed_cells():
this_dir = pathlib.Path(__file__).resolve().parent
filename = this_dir / "meshes" / "med" / "cylinder.med"
mesh = meshio.read(filename)
# Points
... | ref_cell_tags_info | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_med.py | test_reference_file_with_mixed_cells | assert | variable | 27 | import pathlib
import helpers
import numpy
import pytest
import meshio
h5py = pytest.importorskip("h5py")
def test_reference_file_with_mixed_cells():
this_dir = pathlib.Path(__file__).resolve().parent
filename = this_dir / "meshes" / "med" / "cylinder.med"
mesh = meshio.read(filename)
# Points
... | ref_point_tags_info | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_medit.py | test_reference_file | assert | numeric_literal | 43 | import os
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize(
"filename, ref_num_points, ref_num_triangle, ref_num_quad, ref_num_wedge, ref_num_tet, ref_num_hex, ref_tag_counts",
[
(
"sphere_mixed.1.meshb",
3270,
864,
0,
... | 3 | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_medit.py | test_reference_file | assert | none_literal | 63 | import os
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize(
"filename, ref_num_points, ref_num_triangle, ref_num_quad, ref_num_wedge, ref_num_tet, ref_num_hex, ref_tag_counts",
[
(
"sphere_mixed.1.meshb",
3270,
864,
0,
... | None | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_mesh.py | test_cells_dict | assert | numeric_literal | 13 | import copy
import sys
import helpers
import numpy
import pytest
import meshio
def test_cells_dict():
mesh = copy.deepcopy(helpers.tri_mesh)
assert len(mesh.cells_dict) == | 1 | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_mesh.py | test_sets_to_int_data | assert | complex_expr | 16 | import copy
import sys
import helpers
import numpy
import pytest
import meshio
@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires Python 3.6 or higher")
def test_sets_to_int_data():
mesh = helpers.add_cell_sets(helpers.tri_mesh)
mesh.sets_to_int_data()
assert "grain0-grain1" in | mesh.cell_data | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_mesh.py | test_int_data_to_sets | assert | complex_expr | 16 | import copy
import sys
import helpers
import numpy
import pytest
import meshio
def test_int_data_to_sets():
mesh = helpers.tri_mesh
mesh.cell_data = {"grain0-grain1": [numpy.array([0, 1])]}
mesh.int_data_to_sets()
assert "grain0" in | mesh.cell_sets | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_nastran.py | test_reference_file | assert | variable | 31 | import pathlib
import helpers
import numpy
import pytest
import meshio
def test(mesh):
helpers.write_read(meshio.nastran.write, meshio.nastran.read, mesh, 1.0e-13)
@pytest.mark.parametrize("filename", ["cylinder.fem", "cylinder_cells_first.fem"])
def test_reference_file(filename):
this_dir = pathlib.Path(__... | ref_num_cells | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_neuroglancer.py | test_reference_file | assert | variable | 19 | import pathlib
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize("filename, ref_sum, ref_num_cells", [("simple1", 20, 4)])
def test_reference_file(filename, ref_sum, ref_num_cells):
this_dir = pathlib.Path(__file__).resolve().parent
filename = this_dir / "meshes" / "neuroglance... | ref_num_cells | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_neuroglancer.py | test_reference_file | assert | func_call | 18 | import pathlib
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize("filename, ref_sum, ref_num_cells", [("simple1", 20, 4)])
def test_reference_file(filename, ref_sum, ref_num_cells):
this_dir = pathlib.Path(__file__).resolve().parent
filename = this_dir / "meshes" / "neuroglance... | tol * abs(ref_sum) | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_obj.py | test_reference_file | assert | string_literal | 21 | import pathlib
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize(
"filename, ref_sum, ref_num_cells", [("elephav.obj", 3.678372172450000e05, 1148)]
)
def test_reference_file(filename, ref_sum, ref_num_cells):
this_dir = pathlib.Path(__file__).resolve().parent
filename = thi... | "triangle" | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_obj.py | test_reference_file | assert | variable | 22 | import pathlib
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize(
"filename, ref_sum, ref_num_cells", [("elephav.obj", 3.678372172450000e05, 1148)]
)
def test_reference_file(filename, ref_sum, ref_num_cells):
this_dir = pathlib.Path(__file__).resolve().parent
filename = thi... | ref_num_cells | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_obj.py | test_reference_file | assert | func_call | 20 | import pathlib
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize(
"filename, ref_sum, ref_num_cells", [("elephav.obj", 3.678372172450000e05, 1148)]
)
def test_reference_file(filename, ref_sum, ref_num_cells):
this_dir = pathlib.Path(__file__).resolve().parent
filename = thi... | tol * abs(ref_sum) | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_ply.py | test_no_cells | assert | numeric_literal | 20 | import pathlib
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize("binary", [False, True])
def test_no_cells(binary):
import io
vertices = numpy.random.random((30, 3))
mesh = meshio.Mesh(vertices, [])
file = io.BytesIO()
mesh.write(file, "ply", binary=binary)
me... | 0 | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_ply.py | test_reference_file | assert | variable | 25 | import pathlib
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize(
"filename, ref_sum, ref_num_cells",
[
("bun_zipper_res4.ply", 3.414583969116211e01, 948),
("tet.ply", 6, 4),
],
)
def test_reference_file(filename, ref_sum, ref_num_cells):
this_dir = path... | ref_num_cells | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_ply.py | test_reference_file | assert | func_call | 24 | import pathlib
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize(
"filename, ref_sum, ref_num_cells",
[
("bun_zipper_res4.ply", 3.414583969116211e01, 948),
("tet.ply", 6, 4),
],
)
def test_reference_file(filename, ref_sum, ref_num_cells):
this_dir = path... | tol * abs(ref_sum) | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_su2.py | test_structured | assert | variable | 39 | import pathlib
import helpers
import numpy
import pytest
import meshio
test_set = [
helpers.tri_mesh_2d,
helpers.tet_mesh,
helpers.hex_mesh,
]
this_dir = pathlib.Path(__file__).resolve().parent
def test(mesh):
def writer(*args, **kwargs):
return meshio.su2.write(*args, **kwargs)
helpers... | sum_tags | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_su2.py | test_structured | assert | variable | 34 | import pathlib
import helpers
import numpy
import pytest
import meshio
test_set = [
helpers.tri_mesh_2d,
helpers.tet_mesh,
helpers.hex_mesh,
]
this_dir = pathlib.Path(__file__).resolve().parent
def test(mesh):
def writer(*args, **kwargs):
return meshio.su2.write(*args, **kwargs)
helpers... | ref_num_cells | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_su2.py | test_structured | assert | variable | 35 | import pathlib
import helpers
import numpy
import pytest
import meshio
test_set = [
helpers.tri_mesh_2d,
helpers.tet_mesh,
helpers.hex_mesh,
]
this_dir = pathlib.Path(__file__).resolve().parent
def test(mesh):
def writer(*args, **kwargs):
return meshio.su2.write(*args, **kwargs)
helpers... | ref_num_points | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_su2.py | test_structured | assert | complex_expr | 43 | import pathlib
import helpers
import numpy
import pytest
import meshio
test_set = [
helpers.tri_mesh_2d,
helpers.tet_mesh,
helpers.hex_mesh,
]
this_dir = pathlib.Path(__file__).resolve().parent
def test(mesh):
def writer(*args, **kwargs):
return meshio.su2.write(*args, **kwargs)
helpers... | ref_num_unique_tags + 1 | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_tetgen.py | test_point_cell_refs | assert | variable | 25 | import pathlib
import helpers
import pytest
import meshio
test_set = [helpers.tet_mesh]
def test(mesh):
helpers.write_read(
meshio.tetgen.write, meshio.tetgen.read, mesh, 1.0e-15, extension=".node"
)
@pytest.mark.parametrize(
"filename, point_ref_sum, cell_ref_sum", [("mesh.ele", 12, 373)]
)
de... | cell_ref_sum | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_tetgen.py | test_point_cell_refs | assert | variable | 24 | import pathlib
import helpers
import pytest
import meshio
test_set = [helpers.tet_mesh]
def test(mesh):
helpers.write_read(
meshio.tetgen.write, meshio.tetgen.read, mesh, 1.0e-15, extension=".node"
)
@pytest.mark.parametrize(
"filename, point_ref_sum, cell_ref_sum", [("mesh.ele", 12, 373)]
)
de... | point_ref_sum | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_ugrid.py | test_reference_file | assert | numeric_literal | 44 | import pathlib
import sys
import helpers
import numpy
import pytest
import meshio
this_dir = pathlib.Path(__file__).resolve().parent
@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires Python 3.6 or higher")
@pytest.mark.parametrize(
"filename, ref_num_points, ref_num_triangle, ref_num_quad, ref_num... | 3 | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_ugrid.py | test_reference_file | assert | none_literal | 64 | import pathlib
import sys
import helpers
import numpy
import pytest
import meshio
this_dir = pathlib.Path(__file__).resolve().parent
@pytest.mark.skipif(sys.version_info < (3, 6), reason="requires Python 3.6 or higher")
@pytest.mark.parametrize(
"filename, ref_num_points, ref_num_triangle, ref_num_quad, ref_num... | None | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_ugrid.py | test_volume | assert | collection | 49 | import pathlib
import sys
import helpers
import numpy
import pytest
import meshio
this_dir = pathlib.Path(__file__).resolve().parent
def _tet_volume(cell):
"""
Evaluate the volume of a tetrahedron using the value
of the deteminant
| a_x a_y a_z 1 |
| b_x b_y b_z 1 |
| c_x c_y c_z 1 |
| d... | (6, 5) | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_ugrid.py | test_volume | assert | string_literal | 48 | import pathlib
import sys
import helpers
import numpy
import pytest
import meshio
this_dir = pathlib.Path(__file__).resolve().parent
def _tet_volume(cell):
"""
Evaluate the volume of a tetrahedron using the value
of the deteminant
| a_x a_y a_z 1 |
| b_x b_y b_z 1 |
| c_x c_y c_z 1 |
| d... | "pyramid" | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_vtk.py | test_structured | assert | numeric_literal | 60 | import pathlib
from functools import partial
import helpers
import numpy
import pytest
import meshio
test_set = [
helpers.line_mesh,
helpers.tri_mesh_2d,
helpers.tri_mesh,
helpers.triangle6_mesh,
helpers.quad_mesh,
helpers.quad8_mesh,
helpers.tri_quad_mesh,
helpers.tet_mesh,
helpe... | 1 | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_vtk.py | test_reference_file | assert | string_literal | 54 | import pathlib
from functools import partial
import helpers
import numpy
import pytest
import meshio
test_set = [
helpers.line_mesh,
helpers.tri_mesh_2d,
helpers.tri_mesh,
helpers.triangle6_mesh,
helpers.quad_mesh,
helpers.quad8_mesh,
helpers.tri_quad_mesh,
helpers.tet_mesh,
helpe... | "triangle" | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_vtk.py | test_structured | assert | variable | 63 | import pathlib
from functools import partial
import helpers
import numpy
import pytest
import meshio
test_set = [
helpers.line_mesh,
helpers.tri_mesh_2d,
helpers.tri_mesh,
helpers.triangle6_mesh,
helpers.quad_mesh,
helpers.quad8_mesh,
helpers.tri_quad_mesh,
helpers.tet_mesh,
helpe... | ref_num_pnt | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_vtk.py | test_reference_file | assert | complex_expr | 53 | import pathlib
from functools import partial
import helpers
import numpy
import pytest
import meshio
test_set = [
helpers.line_mesh,
helpers.tri_mesh_2d,
helpers.tri_mesh,
helpers.triangle6_mesh,
helpers.quad_mesh,
helpers.quad8_mesh,
helpers.tri_quad_mesh,
helpers.tet_mesh,
helpe... | tol * ref_sum | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_vtk.py | test_reference_file | assert | variable | 55 | import pathlib
from functools import partial
import helpers
import numpy
import pytest
import meshio
test_set = [
helpers.line_mesh,
helpers.tri_mesh_2d,
helpers.tri_mesh,
helpers.triangle6_mesh,
helpers.quad_mesh,
helpers.quad8_mesh,
helpers.tri_quad_mesh,
helpers.tet_mesh,
helpe... | ref_num_cells | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_vtk.py | test_color_scalars | assert | variable | 50 | import pathlib
from functools import partial
import helpers
import numpy
import pytest
import meshio
test_set = [
helpers.line_mesh,
helpers.tri_mesh_2d,
helpers.tri_mesh,
helpers.triangle6_mesh,
helpers.quad_mesh,
helpers.quad8_mesh,
helpers.tri_quad_mesh,
helpers.tet_mesh,
helpe... | ref_num_points | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_vtk.py | test_structured | assert | complex_expr | 61 | import pathlib
from functools import partial
import helpers
import numpy
import pytest
import meshio
test_set = [
helpers.line_mesh,
helpers.tri_mesh_2d,
helpers.tri_mesh,
helpers.triangle6_mesh,
helpers.quad_mesh,
helpers.quad8_mesh,
helpers.tri_quad_mesh,
helpers.tet_mesh,
helpe... | mesh.cells[0].type | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_vtu.py | test_read_from_file | assert | numeric_literal | 58 | import pathlib
import helpers
import numpy
import pytest
import meshio
test_set = [
helpers.line_mesh,
helpers.tri_mesh,
helpers.triangle6_mesh,
helpers.quad_mesh,
helpers.quad8_mesh,
helpers.tri_quad_mesh,
helpers.polygon_mesh,
helpers.tet_mesh,
helpers.tet10_mesh,
helpers.he... | 1 | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_vtu.py | test_read_from_file | assert | variable | 61 | import pathlib
import helpers
import numpy
import pytest
import meshio
test_set = [
helpers.line_mesh,
helpers.tri_mesh,
helpers.triangle6_mesh,
helpers.quad_mesh,
helpers.quad8_mesh,
helpers.tri_quad_mesh,
helpers.polygon_mesh,
helpers.tet_mesh,
helpers.tet10_mesh,
helpers.he... | ref_num_pnt | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_vtu.py | test_read_from_file | assert | variable | 60 | import pathlib
import helpers
import numpy
import pytest
import meshio
test_set = [
helpers.line_mesh,
helpers.tri_mesh,
helpers.triangle6_mesh,
helpers.quad_mesh,
helpers.quad8_mesh,
helpers.tri_quad_mesh,
helpers.polygon_mesh,
helpers.tet_mesh,
helpers.tet10_mesh,
helpers.he... | ref_num_cells | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_vtu.py | test_read_from_file | assert | complex_expr | 59 | import pathlib
import helpers
import numpy
import pytest
import meshio
test_set = [
helpers.line_mesh,
helpers.tri_mesh,
helpers.triangle6_mesh,
helpers.quad_mesh,
helpers.quad8_mesh,
helpers.tri_quad_mesh,
helpers.polygon_mesh,
helpers.tet_mesh,
helpers.tet10_mesh,
helpers.he... | mesh.cells[0].type | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_wkt.py | test_reference_file | assert | string_literal | 22 | import pathlib
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize(
"filename, ref_sum, ref_num_cells",
[("simple.wkt", 4, 2), ("whitespaced.wkt", 3.2, 2)],
)
def test_reference_file(filename, ref_sum, ref_num_cells):
this_dir = pathlib.Path(__file__).resolve().parent
fil... | "triangle" | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_wkt.py | test_reference_file | assert | variable | 23 | import pathlib
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize(
"filename, ref_sum, ref_num_cells",
[("simple.wkt", 4, 2), ("whitespaced.wkt", 3.2, 2)],
)
def test_reference_file(filename, ref_sum, ref_num_cells):
this_dir = pathlib.Path(__file__).resolve().parent
fil... | ref_num_cells | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_wkt.py | test_reference_file | assert | func_call | 21 | import pathlib
import helpers
import numpy
import pytest
import meshio
@pytest.mark.parametrize(
"filename, ref_sum, ref_num_cells",
[("simple.wkt", 4, 2), ("whitespaced.wkt", 3.2, 2)],
)
def test_reference_file(filename, ref_sum, ref_num_cells):
this_dir = pathlib.Path(__file__).resolve().parent
fil... | tol * abs(ref_sum) | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/meshio | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | train | train | test/test_xdmf.py | test_time_series | assert | numeric_literal | 62 | import helpers
import numpy
import pytest
import meshio
test_set_full = [
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,... | 1.0e-12 | b3b5eca2fd496c5d6ca4b2f02f18f45080c90b47 | 146 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/helpers.py | assert_equality | assert | variable | 45 | import os
import subprocess
import tempfile
import matplotlib
import matplotlib.pyplot as plt
import tikzplotlib
def print_tree(obj, indent=""):
"""Recursively prints the tree structure of the matplotlib object.
"""
if isinstance(obj, matplotlib.text.Text):
print(indent, type(obj).__name__, f'("{... | code | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/helpers.py | assert_equality | assert | none_literal | 56 | import os
import subprocess
import tempfile
import matplotlib
import matplotlib.pyplot as plt
import tikzplotlib
def print_tree(obj, indent=""):
"""Recursively prints the tree structure of the matplotlib object.
"""
if isinstance(obj, matplotlib.text.Text):
print(indent, type(obj).__name__, f'("{... | None | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_annotate.py | test | assert_* | complex_expr | 39 | import matplotlib.pyplot as plt
import numpy as np
from helpers import assert_equality
def plot():
fig = plt.figure(1, figsize=(8, 5))
ax = fig.add_subplot(111, autoscale_on=False, xlim=(-1, 5), ylim=(-4, 3))
t = np.arange(0.0, 5.0, 0.2)
s = np.cos(2 * np.pi * t)
ax.plot(t, s, color="blue")
ax... | __file__[:-3] + "_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_axvline.py | test | assert_* | complex_expr | 17 | import matplotlib.pyplot as plt
import numpy as np
from helpers import assert_equality
def plot():
fig = plt.figure()
np.random.seed(123)
s = np.random.normal(0, 1, 10)
plt.gca().set_ylim(-1.0, +1.0)
plt.hist(s, 30)
plt.axvline(1.96)
return fig
def test():
assert_equality(plot, | __file__[:-3] + "_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_barchart.py | test | assert_* | string_literal | 25 | import matplotlib.pyplot as plt
import numpy as np
from helpers import assert_equality
def plot():
# plot data
fig = plt.figure()
ax = fig.add_subplot(111)
x = np.arange(3)
y1 = [1, 2, 3]
y2 = [3, 2, 4]
y3 = [5, 3, 1]
w = 0.25
ax.bar(x - w, y1, w, color="b", align="center")
a... | "test_barchart_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_barchart_errorbars.py | test | assert_* | string_literal | 30 | import matplotlib.pyplot as plt
import numpy as np
from helpers import assert_equality
def plot():
# plot data
fig = plt.figure()
ax = fig.add_subplot(111)
x = np.arange(3)
y1 = [1, 2, 3]
y1err = [0.1, 0.2, 0.5]
y2 = [3, 2, 4]
y2err = [0.4, 0.2, 0.5]
y3 = [5, 3, 1]
y3err = [0.... | "test_barchart_errorbars_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_barchart_legend.py | test | assert_* | string_literal | 26 | import matplotlib.pyplot as plt
import numpy as np
from helpers import assert_equality
def plot():
# plot data
fig = plt.figure()
ax = fig.add_subplot(111)
x = np.arange(3)
y1 = [1, 2, 3]
y2 = [3, 2, 4]
y3 = [5, 3, 1]
w = 0.25
ax.bar(x - w, y1, w, color="b", align="center", label... | "test_barchart_legend_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_basic_sin.py | test | assert_* | string_literal | 25 | import matplotlib.pyplot as plt
import numpy as np
from helpers import assert_equality
def plot():
fig = plt.figure()
with plt.style.context("ggplot"):
t = np.arange(0.0, 2.0, 0.1)
s = np.sin(2 * np.pi * t)
s2 = np.cos(2 * np.pi * t)
A = plt.cm.jet(np.linspace(0, 1, 10))
... | "test_basic_sin_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_boxplot.py | test | assert_* | string_literal | 85 | import matplotlib.pyplot as plt
from helpers import assert_equality
def plot():
# plot data
fig = plt.figure()
ax = fig.add_subplot(111)
data = [
[
0.8792419963142024,
0.8842648555256405,
0.8830545971510088,
0.8831310510125482,
0.883... | "test_boxplot_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_cleanfigure.py | test_semilogplot | assert | numeric_literal | 28 | import numpy as np
from matplotlib import pyplot as plt
import pytest
from tikzplotlib import clean_figure, get_tikz_code
RC_PARAMS = {"figure.figsize": [5, 5], "figure.dpi": 220, "pgf.rcfonts": False}
class Test_plottypes:
def test_semilogplot(self):
x = np.logspace(-3, 3, 20)
y = np.linspace(1... | 6 | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_cleanfigure.py | test_plot | assert | numeric_literal | 32 | import numpy as np
from matplotlib import pyplot as plt
import pytest
from tikzplotlib import clean_figure, get_tikz_code
RC_PARAMS = {"figure.figsize": [5, 5], "figure.dpi": 220, "pgf.rcfonts": False}
class Test_plottypes:
def test_plot(self):
x = np.linspace(1, 100, 20)
y = np.linspace(1, 100,... | 18 | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_cleanfigure.py | test_logplot | assert | numeric_literal | 29 | import numpy as np
from matplotlib import pyplot as plt
import pytest
from tikzplotlib import clean_figure, get_tikz_code
RC_PARAMS = {"figure.figsize": [5, 5], "figure.dpi": 220, "pgf.rcfonts": False}
class Test_plottypes:
def test_logplot(self):
x = np.logspace(-3, 3, 20)
y = np.logspace(-3, 3... | 11 | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_cleanfigure.py | test_plot3d | assert | numeric_literal | 36 | import numpy as np
from matplotlib import pyplot as plt
import pytest
from tikzplotlib import clean_figure, get_tikz_code
RC_PARAMS = {"figure.figsize": [5, 5], "figure.dpi": 220, "pgf.rcfonts": False}
class Test_plottypes:
def test_plot3d(self):
theta = np.linspace(-4 * np.pi, 4 * np.pi, 100)
z... | 14 | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_cleanfigure.py | test_sine | assert | numeric_literal | 32 | import numpy as np
from matplotlib import pyplot as plt
import pytest
from tikzplotlib import clean_figure, get_tikz_code
RC_PARAMS = {"figure.figsize": [5, 5], "figure.dpi": 220, "pgf.rcfonts": False}
class Test_lineplot_markers:
def test_sine(self):
x = np.linspace(1, 2 * np.pi, 100)
y = np.si... | 39 | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_cleanfigure.py | test_subplot | assert | numeric_literal | 57 | import numpy as np
from matplotlib import pyplot as plt
import pytest
from tikzplotlib import clean_figure, get_tikz_code
RC_PARAMS = {"figure.figsize": [5, 5], "figure.dpi": 220, "pgf.rcfonts": False}
class Test_subplots:
def test_subplot(self):
"""octave code
```octave
addpath ("../... | 36 | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_colorbars.py | test | assert_* | string_literal | 77 | import matplotlib as mpl
import matplotlib.pyplot as plt
from helpers import assert_equality
def plot():
# Make a figure and axes with dimensions as desired.
fig, ax = plt.subplots(3)
# Set the colormap and norm to correspond to the data for which the colorbar will be
# used.
cmap = mpl.cm.cool
... | "test_colorbars_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_context.py | test | assert_* | complex_expr | 18 | from helpers import assert_equality
def plot():
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
x, y = np.meshgrid(np.linspace(0, 1), np.linspace(0, 1))
z = x ** 2 - y ** 2
fig = plt.figure()
plt.pcolormesh(x, y, z, cmap=cm.viridis)
return fig
def test(... | __file__[:-3] + "_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_contourf.py | test | assert_* | complex_expr | 30 | import matplotlib.pyplot as plt
import numpy as np
from helpers import assert_equality
def plot():
nbins = 5
fig = plt.figure()
ax = plt.gca()
x_max = 2
x_min = 0
y_max = 2
y_min = 0
xi, yi = np.mgrid[x_min : x_max : nbins * 1j, y_min : y_max : nbins * 1j]
pos = np.empty(xi.shap... | __file__[:-3] + "_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_custom_collection.py | test | assert_* | string_literal | 42 | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from helpers import assert_equality
def rot(theta):
""" Get a stack of rotation matrices """
return np.stack(
[
np.stack([np.cos(theta), -np.sin(theta)], axis=-1),
np.stack([np.sin(theta), np.cos(theta)], axis... | "test_custom_collection_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_datetime.py | test | assert_* | complex_expr | 21 | import datetime as date
import matplotlib.pyplot as plt
from matplotlib import dates
from helpers import assert_equality
def plot():
fig = plt.figure()
values = [50, 50.02]
time = [date.datetime(2016, 10, 10, 18, 00), date.datetime(2016, 10, 10, 18, 15)]
plt.plot(time, values)
hfmt = dates.DateF... | __file__[:-3] + "_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_datetime_paths.py | test | assert_* | complex_expr | 25 | import datetime as date
import matplotlib.pyplot as plt
from matplotlib import dates
from helpers import assert_equality
def plot():
fig = plt.figure()
times = [date.datetime(2020, 1, 1, 12, 00), date.datetime(2020, 1, 2, 12, 00)]
line = [2, 2]
upper = [3, 4]
lower = [1, 0]
plt.plot(times, ... | __file__[:-3] + "_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_deterministic_output.py | test | assert | complex_expr | 48 | import subprocess
import sys
import tempfile
plot_code = """
import sys
import numpy as np
from matplotlib import pyplot as plt
import tikzplotlib
t = np.arange(0.0, 2.0, 0.1)
s = np.sin(2 * np.pi * t)
plt.plot(t, s, label="a")
plt.legend()
tikzplotlib.save(sys.argv[1])
"""
def test():
_, tmp_base = tempfile.mks... | tikzs[0] | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_dual_axis.py | test | assert_* | string_literal | 18 | import matplotlib.pyplot as plt
import numpy as np
from helpers import assert_equality
def plot():
fig = plt.figure()
ax = fig.add_subplot(111)
dat = np.linspace(0, 10, 20)
ax.plot(dat, dat ** 2)
ax2 = ax.twinx()
ax2.plot(20 * dat, 20 * dat ** 2)
ax.xaxis.tick_top()
return fig
def tes... | "test_dual_axis_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_errorband.py | test | assert_* | string_literal | 22 | import matplotlib.pyplot as plt
import numpy as np
from helpers import assert_equality
def plot():
fig, ax = plt.subplots()
with plt.style.context("ggplot"):
t = np.linspace(0, 2 * np.pi, 11)
s = np.sin(t)
ax.plot(t, s, "k-")
ax.fill_between(t, s + 0.1, s - 0.1, facecolor="k", ... | "test_errorband_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_errorbar.py | test | assert_* | string_literal | 19 | import matplotlib.pyplot as plt
from helpers import assert_equality
def plot():
# plot data
fig = plt.figure()
ax = fig.add_subplot(111)
x = [7.14, 7.36, 7.47, 7.52]
y = [3.3, 4.4, 8.8, 5.5]
ystd = [0.1, 0.5, 0.8, 0.3]
ax.errorbar(x, y, yerr=ystd)
return fig
def test():
assert_... | "test_errorbar_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_escape_chars.py | test | assert_* | string_literal | 15 | import matplotlib.pyplot as plt
from helpers import assert_equality
def plot():
fig = plt.figure()
plt.plot(0, 0, "kx")
plt.title("Foo & Bar Dogs_N_Cats")
plt.xlabel("Foo & Bar Dogs_N_Cats")
plt.ylabel("Foo & Bar Dogs_N_Cats")
return fig
def test():
assert_equality(plot, | "test_escape_chars_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_externalize_tables.py | test | assert_* | string_literal | 24 | from helpers import assert_equality
def plot():
from matplotlib import pyplot as plt
import numpy as np
fig = plt.figure()
with plt.style.context("ggplot"):
t = np.arange(0.0, 2.0, 0.1)
s = np.sin(2 * np.pi * t)
s2 = np.cos(2 * np.pi * t)
A = plt.cm.jet(np.linspace(0, 1... | "test_externalize_tables_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_fancy_colorbar.py | test | assert_* | string_literal | 19 | import matplotlib.pyplot as plt
import numpy as np
from helpers import assert_equality
def plot():
da = np.zeros((3, 3))
da[:2, :2] = 1.0
fig = plt.figure()
ax = plt.gca()
im = ax.imshow(da, cmap="viridis")
plt.colorbar(im, aspect=5, shrink=0.5)
return fig
def test():
assert_equali... | "test_fancy_colorbar_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_fancybox.py | test | assert_* | string_literal | 192 | import matplotlib.pyplot as plt
import matplotlib.transforms as mtransforms
from matplotlib.patches import FancyBboxPatch
from helpers import assert_equality
bb = mtransforms.Bbox([[0.3, 0.4], [0.7, 0.6]])
def draw_bbox(ax, bb_obj):
# boxstyle=square with pad=0, i.e. bbox itself.
p_bbox = FancyBboxPatch(
... | "test_fancybox_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_fillstyle.py | test | assert_* | string_literal | 18 | import matplotlib.pyplot as plt
import numpy as np
from helpers import assert_equality
def plot():
fig = plt.figure()
N = 10
t = np.linspace(0, 1, N)
x = np.arange(N)
plt.plot(t, x, "-o", fillstyle="none")
plt.tight_layout()
return fig
def test():
assert_equality(plot, | "test_fillstyle_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_hatch.py | test | assert_* | string_literal | 59 | from helpers import assert_equality
def plot():
"""
Hatch demo code from
https://matplotlib.org/3.1.1/gallery/shapes_and_collections/hatch_demo.html
Slightly modified to test more aspects of the hatch implementation
"""
import matplotlib.pyplot as plt
from matplotlib.patches im... | "test_hatch_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_heat.py | test | assert_* | string_literal | 18 | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from helpers import assert_equality
def plot():
fig = plt.figure()
x, y = np.ogrid[-10:10:100j, -10:10:100j]
extent = (x.min(), x.max(), y.min(), y.max())
cmap = matplotlib.cm.get_cmap("gray")
plt.imshow(x * y, extent=extent, cma... | "test_heat_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
nschloe/tikzplotlib | c6509285f7bf8874958373acd82e6ecab362781a | 68 | train | train | test/test_histogram.py | test | assert_* | string_literal | 19 | import matplotlib.pyplot as plt
import numpy as np
from helpers import assert_equality
def plot():
# Make plot with vertical (default) colorbar
fig = plt.figure()
ax = fig.add_subplot(111)
np.random.seed(123)
ax.hist(10 + 2 * np.random.randn(1000), label="men")
ax.hist(12 + 3 * np.random.rand... | "test_histogram_reference.tex") | c6509285f7bf8874958373acd82e6ecab362781a | 68 | v2_extractor_at_anchor |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.