def fixture_tracks(): """ Load track data from the sample bathymetry file. """ dataframe = load_sample_data(name="bathymetry") dataframe.columns = ["x", "y", "z"] # longitude, latitude, bathymetry return [dataframe.query(expr="z > -20")] # reduce size of dataset
def fixture_data_fractures_compilation(): """ Load the sample fractures compilation dataset which contains fracture lengths and azimuths as hypothetically digitized from geological maps. Lengths are stored in the first column, azimuths in the second. """ return load_sample_data(name="fractures")
def test_load_sample_data(): """ Check that the dataset loads without errors. """ data = load_sample_data(name="japan_quakes") assert data.shape == (115, 7) summary = data.describe() assert summary.loc["min", "year"] == 1987 assert summary.loc["max", "year"] == 1988 assert summary.loc["min", "month"] == 1 assert summary.loc["max", "month"] == 12 assert summary.loc["min", "day"] == 1 assert summary.loc["max", "day"] == 31
def fixture_dataframe(): """ Load the table data from the sample bathymetry dataset. """ return load_sample_data(name="bathymetry")
def test_load_sample_invalid(): """ Check that the function raises error for unsupported filenames. """ with pytest.raises(GMTInvalidInput): load_sample_data(name="bad.filename")
def fixture_mars_shape(): """ Load the table data for the shape of Mars. """ return load_sample_data(name="mars_shape")