Beispiel #1
0
def test_simple_io(input_val, expected_result, fformat, engine):
    if engine == "python" and fformat not in [
            "irap_ascii",
            "irap_binary",
            "zmap_ascii",
    ]:
        pytest.skip("Only one engine available")
    surf = RegularSurface(ncol=2, nrow=2, xinc=2.0, yinc=2.0, values=input_val)
    surf.to_file("my_file", fformat=fformat)
    surf_from_file = RegularSurface._read_file("my_file",
                                               fformat=fformat,
                                               engine=engine)
    assert_similar_surfaces(surf, surf_from_file)
    assert surf_from_file.values.data.tolist() == expected_result
Beispiel #2
0
def test_complex_io(surf, fformat, output_engine, input_engine):
    if (input_engine == "python"
            or output_engine == "python") and fformat not in [
                "irap_ascii",
                "irap_binary",
                "zmap_ascii",
            ]:
        pytest.skip("Only one engine available")
    if fformat == "petromod":
        pytest.xfail("Several hypotesis failures (4)")
    surf.to_file("my_file", fformat=fformat, engine=output_engine)
    surf_from_file = RegularSurface._read_file("my_file",
                                               fformat=fformat,
                                               engine=input_engine)
    assert_similar_surfaces(surf, surf_from_file)