Skip to content

Commit

Permalink
Re-apply tests for MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichSuter committed Apr 23, 2024
1 parent 6d5186d commit 9bffe49
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions tests/test_well/test_well.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,29 +259,27 @@ def test_shortwellname(create_well):
assert short == "A-142H"


# @pytest.mark.skipif(sys.platform.startswith("darwin"), reason="No pytables on macOS")
# def test_hdf_io_single(tmp_path):
# """Test HDF io, single well."""
# mywell = xtgeo.well_from_file(WELL1)

# wname = (tmp_path / "hdfwell").with_suffix(".hdf")
# mywell.to_hdf(wname)
# mywell2 = xtgeo.well_from_file(wname, fformat="hdf")
# assert mywell2.nrow == mywell.nrow


# @pytest.mark.skipif(sys.platform.startswith("darwin"), reason="No pytables on macOS")
# def test_import_as_rms_export_as_hdf_many(tmp_path, simple_well):
# """Import RMS and export as HDF5 and RMS asc, many, and compare timings."""
# t0 = xtg.timer()
# wname = (tmp_path / "$random").with_suffix(".hdf")
# wuse = simple_well.to_hdf(wname, compression=None)
# print("Time for save HDF: ", xtg.timer(t0))

# t0 = xtg.timer()
# result = xtgeo.well_from_file(wuse, fformat="hdf5")
# assert result.get_dataframe().equals(simple_well.get_dataframe())
# print("Time for load HDF: ", xtg.timer(t0))
def test_hdf_io_single(tmp_path, testdata_path):
"""Test HDF io, single well."""
mywell = xtgeo.well_from_file(testdata_path / WELL1)

wname = (tmp_path / "hdfwell").with_suffix(".hdf")
mywell.to_hdf(wname)
mywell2 = xtgeo.well_from_file(wname, fformat="hdf")
assert mywell2.nrow == mywell.nrow


def test_import_as_rms_export_as_hdf_many(tmp_path, simple_well):
"""Import RMS and export as HDF5 and RMS asc, many, and compare timings."""
t0 = xtg.timer()
wname = (tmp_path / "$random").with_suffix(".hdf")
wuse = simple_well.to_hdf(wname, compression=None)
print("Time for save HDF: ", xtg.timer(t0))

t0 = xtg.timer()
result = xtgeo.well_from_file(wuse, fformat="hdf5")
assert result.get_dataframe().equals(simple_well.get_dataframe())
print("Time for load HDF: ", xtg.timer(t0))


def test_import_export_rmsasc(tmp_path, simple_well):
Expand Down

0 comments on commit 9bffe49

Please sign in to comment.