def test_propstatset(): qcp = QCProperties() qcp.get_grid_statistics(GRIDDATA) qcp.get_well_statistics(WELLDATA) qcp.get_bwell_statistics(BWELLDATA) assert len(qcp.dataframe["ID"].unique()) == 3
def test_blockedwells(self, data_bwells): """Test extracting statsitics from blocked well logs""" qcp = QCProperties() qcp.get_bwell_statistics(data_bwells) assert list(qcp.dataframe["PROPERTY"].unique()) == ["PORO"] row = qcp.dataframe[(qcp.dataframe["FACIES"] == "Total") & (qcp.dataframe["PROPERTY"] == "PORO")] assert row["Avg"].values == pytest.approx(0.1709, abs=0.001) assert row["Max"].values == pytest.approx(0.3640, abs=0.001)
def test_auto_combination(self, data_grid, data_wells, data_bwells): """Tests combining statistic """ qcp = QCProperties() qcp.get_grid_statistics(data_grid) assert len(qcp.dataframe["ID"].unique()) == 1 qcp.get_well_statistics(data_wells) assert len(qcp.dataframe["ID"].unique()) == 2 qcp.get_bwell_statistics(data_bwells) assert len(qcp.dataframe["ID"].unique()) == 3
def test_propstatset_auto_combination(): qcp = QCProperties() qcp.get_grid_statistics(GRIDDATA) assert len(qcp.dataframe["ID"].unique()) == 1 qcp.get_well_statistics(WELLDATA) assert len(qcp.dataframe["ID"].unique()) == 2 qcp.get_bwell_statistics(BWELLDATA, reuse=True) assert len(qcp.dataframe["ID"].unique()) == 3
def test_statistics_bwells(): data = data_orig_bwells.copy() data["wells"] = BWELLS data["name"] = "Blocked_Logs" qcp = QCProperties() stat = qcp.get_bwell_statistics(data, reuse=True) assert set(stat.dataframe.columns) == set([ "Avg", "Avg_Weighted", "FACIES", "Max", "Min", "P10", "P90", "PROPERTY", "Stddev", "SOURCE", "ID", ]) assert list(stat.dataframe["ID"].unique())[0] == "Blocked_Logs" assert set(stat.dataframe["PROPERTY"].unique()) == set(["PORO"]) assert stat.dataframe[stat.dataframe["PROPERTY"] == "PORO"]["Avg"].max() == pytest.approx(0.2678, abs=0.001) row = stat.dataframe[(stat.dataframe["FACIES"] == "Total") & (stat.dataframe["PROPERTY"] == "PORO")] assert row["Avg"].values == pytest.approx(0.1709, abs=0.001)
def test_full_dataframe_bwells(): data = data_orig_bwells.copy() data["wells"] = BWELLS qcp = QCProperties() stat = qcp.get_bwell_statistics(data, reuse=True) assert set(stat.property_dataframe.columns) == set(["PORO", "FACIES"]) assert stat.property_dataframe["PORO"].mean() == pytest.approx(0.1709, abs=0.001)
def test_filters_bwells(): data = data_orig_bwells.copy() data["wells"] = BWELLS data["selectors"] = { "FACIES": { "name": "Facies", "include": "Channel" }, } qcp = QCProperties() stat = qcp.get_bwell_statistics(data, reuse=True) assert set(["Channel", "Total"]) == set(stat.dataframe["FACIES"].unique())