コード例 #1
0
def test_boundary_step():
    geo = dmsh.Union([dmsh.Circle([-0.5, 0.0], 1.0), dmsh.Circle([+0.5, 0.0], 1.0)])
    geo.show()
    a = geo.boundary_step([-0.5, 0.9])
    assert numpy.array_equal(a, [-0.5, 1.0])

    a = geo.boundary_step([-0.5, 0.6])
    assert numpy.array_equal(a, [-0.5, 1.0])

    a = geo.boundary_step([0.05, 0.05])
    assert_equality(a, [-4.4469961425821203e-01, 9.9846976285554556e-01], 1.0e-10)
コード例 #2
0
ファイル: test_union.py プロジェクト: nschloe/dmsh
def test_boundary_step():
    geo = dmsh.Union(
        [dmsh.Circle([-0.5, 0.0], 1.0),
         dmsh.Circle([+0.5, 0.0], 1.0)])
    a = geo.boundary_step([-0.5, 0.9])
    assert np.array_equal(a, [-0.5, 1.0])

    a = geo.boundary_step([-0.5, 0.6])
    assert np.array_equal(a, [-0.5, 1.0])

    a = geo.boundary_step([0.05, 0.05])
    assert_equality(a, [-4.4469961425821203e-01, 9.9846976285554556e-01],
                    1.0e-10)

    pts = np.array([[-5.0, 0.0], [4.1, 0.0]])
    pts = geo.boundary_step(pts.T).T
    ref = np.array([[-1.5, 0.0], [1.5, 0.0]])
    assert np.all(np.abs(pts - ref) < 1.0e-10)

    pts = np.array([[-0.9, 0.0], [1.1, 0.0]])
    pts = geo.boundary_step(pts.T).T
    ref = np.array([[-1.5, 0.0], [1.5, 0.0]])
    assert np.all(np.abs(pts - ref) < 1.0e-10)
コード例 #3
0
def test():
    assert_equality(plot, "test_image_plot_lower_reference.tex")
    return
コード例 #4
0
def test():
    assert_equality(plot, "test_colorbars_reference.tex", assert_compilation=False)
コード例 #5
0
def test():
    assert_equality(plot, "test_annotate_reference.tex")
    return
コード例 #6
0
def test():
    assert_equality(plot, "test_histogram_reference.tex")
    return
コード例 #7
0
def test():
    assert_equality(plot, "test_basic_sin_reference.tex", table_row_sep="\\\\\n")
    return
コード例 #8
0
def test():
    assert_equality(plot, "test_errorband_reference.tex")
    return
コード例 #9
0
def test():
    assert_equality(plot, __file__[:-3] + "_reference.tex")
    return
コード例 #10
0
def test():
    assert_equality(plot, "test_barchart_errorbars_reference.tex")
    return
コード例 #11
0
def test():
    assert_equality(plot, "test_histogram_reference.tex")
    return
コード例 #12
0
def test():
    assert_equality(plot, "test_escape_chars_reference.tex")
    return
コード例 #13
0
def test():
    assert_equality(plot,
                    "test_basic_sin_reference.tex",
                    table_row_sep="\\\\\n")
    return
コード例 #14
0
def test():
    assert_equality(plot, "test_legend_best_location_reference.tex")
    return
コード例 #15
0
def test():
    assert_equality(plot, "test_errorband_reference.tex")
    return
コード例 #16
0
def test():
    assert_equality(plot, "test_externalize_tables_reference.tex")
    return
コード例 #17
0
def test():
    assert_equality(plot, "test_fancy_colorbar_reference.tex")
    return
コード例 #18
0
def test():
    assert_equality(plot, "test_externalize_tables_reference.tex")
    return
コード例 #19
0
def test():
    assert_equality(plot, "test_dual_axis_reference.tex")
    return
コード例 #20
0
def test():
    assert_equality(plot, "test_fancybox_reference.tex")
    return
コード例 #21
0
def test():
    assert_equality(plot, "test_image_plot_lower_reference.tex")
    return
コード例 #22
0
def test():
    assert_equality(plot, "test_barchart_legend_reference.tex")
    return
コード例 #23
0
def test():
    assert_equality(plot, "test_dual_axis_reference.tex")
    return
コード例 #24
0
def test():
    assert_equality(plot, "test_colorbars_reference.tex")
    return
コード例 #25
0
def test():
    assert_equality(plot, "test_legend_best_location_reference.tex")
    return
コード例 #26
0
def test():
    assert_equality(plot, "test_horizontal_alignment_reference.tex")
コード例 #27
0
def test():
    assert_equality(plot, __file__[:-3] + "_reference.tex", flavor="context")
    return
コード例 #28
0
def test():
    assert_equality(plot, "test_hatch_reference.tex")
コード例 #29
0
def test():
    assert_equality(plot, "test_fillstyle_reference.tex")
    return
コード例 #30
0
def test():
    assert_equality(plot, "test_boxplot_reference.tex")
    return
コード例 #31
0
def test():
    assert_equality(plot, "test_fillstyle_reference.tex")
    return
コード例 #32
0
def test():
    assert_equality(plot, "test_barchart_errorbars_reference.tex")
    return
コード例 #33
0
def test():
    assert_equality(plot, "test_line_set_data_reference.tex")
    return
コード例 #34
0
def test():
    assert_equality(plot, "test_legend_columns_reference.tex")
    return
コード例 #35
0
def test():
    assert_equality(plot, "test_custom_collection_reference.tex")
    return
コード例 #36
0
def test():
    assert_equality(plot, "test_basic_sin_reference.tex")
    return
コード例 #37
0
def test():
    assert_equality(plot, "test_fancybox_reference.tex")
    return