diff --git a/RATapi/outputs.py b/RATapi/outputs.py index d082f527..f8ee3e68 100644 --- a/RATapi/outputs.py +++ b/RATapi/outputs.py @@ -101,8 +101,6 @@ def __str__(self): class PredictionIntervals(RATResult): reflectivity: list sld: list - reflectivityXData: list - sldXData: list sampleChi: np.ndarray @@ -189,8 +187,6 @@ def make_results( prediction_intervals = PredictionIntervals( reflectivity=bayes_results.predictionIntervals.reflectivity, sld=bayes_results.predictionIntervals.sld, - reflectivityXData=bayes_results.predictionIntervals.reflectivityXData, - sldXData=bayes_results.predictionIntervals.sldXData, sampleChi=bayes_results.predictionIntervals.sampleChi, ) diff --git a/RATapi/utils/plotting.py b/RATapi/utils/plotting.py index 080c1ef8..e9a6b65e 100644 --- a/RATapi/utils/plotting.py +++ b/RATapi/utils/plotting.py @@ -118,10 +118,8 @@ def plot_ref_sld_helper( # Plot confidence intervals if required if confidence_intervals is not None: ref_min, ref_max = confidence_intervals["reflectivity"][i] - # FIXME: remove x-data once rascalsoftware/RAT#249 is merged - ref_x_data = confidence_intervals["reflectivity-x-data"][i][0] - mult = (1 if not q4 else ref_x_data**4) / div - ref_plot.fill_between(ref_x_data, ref_min * mult, ref_max * mult, alpha=0.6, color="grey") + mult = (1 if not q4 else r[:, 0] ** 4) / div + ref_plot.fill_between(r[:, 0], ref_min / div, ref_max / div, alpha=0.6, color="grey") if data.dataPresent[i]: sd_x = sd[:, 0] @@ -146,9 +144,7 @@ def plot_ref_sld_helper( # Plot confidence intervals if required if confidence_intervals is not None: sld_min, sld_max = confidence_intervals["sld"][i][j] - # FIXME: remove x-data once rascalsoftware/RAT#249 is merged - sld_x_data = confidence_intervals["sld-x-data"][i][j][0] - sld_plot.fill_between(sld_x_data, sld_min, sld_max, alpha=0.6, color="grey") + sld_plot.fill_between(sld[j][:, 0], sld_min, sld_max, alpha=0.6, color="grey") if data.resample[i] == 1 or data.modelType == "custom xy": layers = data.resampledLayers[i][0] @@ -278,9 +274,6 @@ def plot_ref_sld( [(sld_inter[interval[0]], sld_inter[interval[1]]) for sld_inter in sld] for sld in results.predictionIntervals.sld ], - # FIXME: remove x-data once rascalsoftware/RAT#249 is merged - "reflectivity-x-data": results.predictionIntervals.reflectivityXData, - "sld-x-data": results.predictionIntervals.sldXData, } else: raise ValueError( diff --git a/cpp/RAT b/cpp/RAT index ee47ff97..8bcffd98 160000 --- a/cpp/RAT +++ b/cpp/RAT @@ -1 +1 @@ -Subproject commit ee47ff97b070131ee05e14c16720d42aac736a4f +Subproject commit 8bcffd98722d0c7b1e69a51d357b6f81cd1613ec diff --git a/cpp/rat.cpp b/cpp/rat.cpp index 0a6d129f..67fd1fac 100644 --- a/cpp/rat.cpp +++ b/cpp/rat.cpp @@ -302,8 +302,6 @@ struct PredictionIntervals { py::list reflectivity; py::list sld; - py::list reflectivityXData; - py::list sldXData; py::array_t sampleChi; }; @@ -1160,8 +1158,6 @@ BayesResults bayesResultsFromStruct8T(const RAT::struct8_T results) bayesResults.predictionIntervals.reflectivity = pyList1DFromRatCellWrap>(results.predictionIntervals.reflectivity); bayesResults.predictionIntervals.sld = pyList2dFromRatCellWrap>(results.predictionIntervals.sld); - bayesResults.predictionIntervals.reflectivityXData = pyList1DFromRatCellWrap>(results.predictionIntervals.reflectivityXData); - bayesResults.predictionIntervals.sldXData = pyList2dFromRatCellWrap>(results.predictionIntervals.sldXData); bayesResults.predictionIntervals.sampleChi = pyArray1dFromBoundedArray>(results.predictionIntervals.sampleChi); bayesResults.confidenceIntervals.percentile95 = pyArrayFromRatArray2d(results.confidenceIntervals.percentile95); @@ -1283,8 +1279,6 @@ PYBIND11_MODULE(rat_core, m) { .def(py::init<>()) .def_readwrite("reflectivity", &PredictionIntervals::reflectivity) .def_readwrite("sld", &PredictionIntervals::sld) - .def_readwrite("reflectivityXData", &PredictionIntervals::reflectivityXData) - .def_readwrite("sldXData", &PredictionIntervals::sldXData) .def_readwrite("sampleChi", &PredictionIntervals::sampleChi); py::class_(m, "PlotEventData") diff --git a/tests/conftest.py b/tests/conftest.py index b5e125ef..815acf6a 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1778,138 +1778,6 @@ def dream_bayes(): ), ], ] - bayes.predictionIntervals.reflectivityXData = [ - np.array( - [ - [ - 0.011403, - 0.013861, - 0.016848, - 0.020479, - 0.024892, - 0.030256, - 0.036777, - 0.044702, - 0.054336, - 0.066045, - 0.080279, - 0.097579, - 0.11861, - 0.14417, - 0.17524, - 0.213, - 0.25891, - 0.3147, - 0.38252, - 0.46496, - 0.56516, - ], - ], - ), - np.array( - [ - [ - 0.011403, - 0.013861, - 0.016848, - 0.020479, - 0.024892, - 0.030256, - 0.036777, - 0.044702, - 0.054336, - 0.066045, - 0.080279, - 0.097579, - 0.11861, - 0.14417, - 0.17524, - 0.213, - 0.25891, - 0.3147, - 0.38252, - 0.46496, - 0.56516, - ], - ], - ), - ] - bayes.predictionIntervals.sldXData = [ - [ - np.array( - [ - [ - 0.0, - 11.0, - 22.0, - 33.0, - 44.0, - 55.0, - 66.0, - 77.0, - 88.0, - 99.0, - 110.0, - 121.0, - 132.0, - 143.0, - 154.0, - 165.0, - 176.0, - 187.0, - 198.0, - 209.0, - 220.0, - 231.0, - 242.0, - 253.0, - 264.0, - 275.0, - 286.0, - 297.0, - 308.0, - 319.0, - ], - ], - ), - np.array( - [ - [ - 0.0, - 11.0, - 22.0, - 33.0, - 44.0, - 55.0, - 66.0, - 77.0, - 88.0, - 99.0, - 110.0, - 121.0, - 132.0, - 143.0, - 154.0, - 165.0, - 176.0, - 187.0, - 198.0, - 209.0, - 220.0, - 231.0, - 242.0, - 253.0, - 264.0, - 275.0, - 286.0, - 297.0, - 308.0, - 319.0, - ], - ], - ), - ], - ] bayes.predictionIntervals.sampleChi = np.array( [ 1.46133559e16, @@ -4050,138 +3918,6 @@ def dream_results(): ), ] ], - reflectivityXData=[ - np.array( - [ - [ - 0.011403, - 0.013861, - 0.016848, - 0.020479, - 0.024892, - 0.030256, - 0.036777, - 0.044702, - 0.054336, - 0.066045, - 0.080279, - 0.097579, - 0.118610, - 0.144170, - 0.175240, - 0.213000, - 0.258910, - 0.314700, - 0.382520, - 0.464960, - 0.565160, - ], - ], - ), - np.array( - [ - [ - 0.011403, - 0.013861, - 0.016848, - 0.020479, - 0.024892, - 0.030256, - 0.036777, - 0.044702, - 0.054336, - 0.066045, - 0.080279, - 0.097579, - 0.118610, - 0.144170, - 0.175240, - 0.213000, - 0.258910, - 0.314700, - 0.382520, - 0.464960, - 0.565160, - ], - ], - ), - ], - sldXData=[ - [ - np.array( - [ - [ - 0.0, - 11.0, - 22.0, - 33.0, - 44.0, - 55.0, - 66.0, - 77.0, - 88.0, - 99.0, - 110.0, - 121.0, - 132.0, - 143.0, - 154.0, - 165.0, - 176.0, - 187.0, - 198.0, - 209.0, - 220.0, - 231.0, - 242.0, - 253.0, - 264.0, - 275.0, - 286.0, - 297.0, - 308.0, - 319.0, - ], - ], - ), - np.array( - [ - [ - 0.0, - 11.0, - 22.0, - 33.0, - 44.0, - 55.0, - 66.0, - 77.0, - 88.0, - 99.0, - 110.0, - 121.0, - 132.0, - 143.0, - 154.0, - 165.0, - 176.0, - 187.0, - 198.0, - 209.0, - 220.0, - 231.0, - 242.0, - 253.0, - 264.0, - 275.0, - 286.0, - 297.0, - 308.0, - 319.0, - ], - ], - ), - ], - ], sampleChi=np.array( [ 1.46133559e16, diff --git a/tests/test_outputs.py b/tests/test_outputs.py index ed4df65d..22a5dd37 100644 --- a/tests/test_outputs.py +++ b/tests/test_outputs.py @@ -86,8 +86,6 @@ def dream_str(): "predictionIntervals = PredictionIntervals(\n" "\treflectivity = [Data array: [5 x 21], Data array: [5 x 21]],\n" "\tsld = [[Data array: [5 x 30], Data array: [5 x 30]]],\n" - "\treflectivityXData = [Data array: [1 x 21], Data array: [1 x 21]],\n" - "\tsldXData = [[Data array: [1 x 30], Data array: [1 x 30]]],\n" "\tsampleChi = Data array: [1000],\n" "),\n" "confidenceIntervals = ConfidenceIntervals(\n" diff --git a/tests/test_plotting.py b/tests/test_plotting.py index bd877348..c2a92c49 100644 --- a/tests/test_plotting.py +++ b/tests/test_plotting.py @@ -68,8 +68,6 @@ def bayes_fig(request) -> plt.figure: [(curve[:, 1] - curve[:, 1] * 0.1, curve[:, 1] + curve[:, 1] * 0.1) for curve in sld] for sld in dat.sldProfiles ], - "reflectivity-x-data": [[curve[:, 0]] for curve in dat.reflectivity], - "sld-x-data": [[[profile[:, 0]] for profile in sld] for sld in dat.sldProfiles], } return RATplot.plot_ref_sld_helper(data=dat, fig=figure, confidence_intervals=confidence_intervals) diff --git a/tests/utils.py b/tests/utils.py index 91ac0f1f..64a475cd 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -116,7 +116,7 @@ def check_bayes_fields_equal(actual_results, expected_results) -> None: } list_fields = { - "predictionIntervals": ["reflectivity", "reflectivityXData"], + "predictionIntervals": ["reflectivity"], "confidenceIntervals": [], "dreamParams": [], "dreamOutput": [], @@ -124,7 +124,7 @@ def check_bayes_fields_equal(actual_results, expected_results) -> None: } double_list_fields = { - "predictionIntervals": ["sld", "sldXData"], + "predictionIntervals": ["sld"], "confidenceIntervals": [], "dreamParams": [], "dreamOutput": [],