From 8193877ccb8512696795c79c95962ee4ad01c757 Mon Sep 17 00:00:00 2001 From: Paul Sharp <44529197+DrPaulSharp@users.noreply.github.com> Date: Wed, 19 Mar 2025 17:10:14 +0000 Subject: [PATCH 1/5] Removes limits struct from input to RAT --- RATapi/examples/languages/custom_bilayer.o | Bin 0 -> 34776 bytes RATapi/inputs.py | 20 ++------ RATapi/run.py | 3 +- tests/test_inputs.py | 57 ++------------------- 4 files changed, 9 insertions(+), 71 deletions(-) create mode 100644 RATapi/examples/languages/custom_bilayer.o diff --git a/RATapi/examples/languages/custom_bilayer.o b/RATapi/examples/languages/custom_bilayer.o new file mode 100644 index 0000000000000000000000000000000000000000..aa967bdbe6367f51cfab56b36ffb069c6bfe46f1 GIT binary patch literal 34776 zcmcg#eRx&HnLo)Dj20zWKd7}Dr~)dcxd9ZctwFeOBS9h|h>Birk{c4uS8r}0xN6Z5 z<%+4;ilx@I^lPPE|DaF1UE1wO&{pYFpDx?4rQL32yS2+!cAK_7yKKMQ-#h1>bKWy& zCdsutoyT)$&Tr=Zn0MZJXU;i8e1EE8MR{47r&F2tUN5}UsON3CBP`dcVx9L{?=z|` z-4o4H&Tl}zjLXZBr?|WV`AROQk=JwiM$T6uZ@{&h?{DIK4e~}V-^}@1&hrF4~ z>yh8WA{!40QIb;%fka zymXxM-%PK>HDmasqV($_EmrTnL7e^ia!Y-ks83kx)1v+~OMRoLpJJ)sAnK=D>MKP3 z>6ZFR)T6J&TJ?96ao=Iw_Zjzt(fibP!7Q~?-t5NBNR<56!@!1p5gSH-GkwD$m^`(Y z8b;-+hI^v2Zhc-8?9*J@r_Te&4aC*ict3GB)PUH^)zI9Re}LHevPdbdi(h##1hmn{ zQ?7FLPR*8BrSP*M1pymU`*6D&UG>?L%BzVt4}{{Gg07)ij)b){Qb*;@G2EoU;ZA~Q zq>j@qTHl#M#f;P#-J;^o;j|j78N)OEF{A1btOB@en5Ip-^$0wgrct{1LpdLO^WHi_ zJ{`*6IPBlwI_&$7>d^4K$+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wzd`BceR7Qh3O|6 z|0L*b{&$r7FX#VVmj2W80qJC}zq?ufMDgb?hx{>%{4R@p`ulS>`7g43bNw;x_ku%y z#R}i>a{PNN^6Bp++vK0ahs@>KS>kBQr@xbDv;Sh2FYVuFk>BZ%pJw@-k!Y1n|NE4K z{&psuD1Lp+p?{-A|9)s-&YzbY@`qV|E$gi_(|+`K0B!c`u*j$PSEl?a0Bqy;_bk6t z3+CLEPYiAHx3l~-(>;rPD=t(10*CynbA3W~W9AZ%A9)9TEz`FJlzzb+|8CIR^gqn{ zZ(@4VpWeTj`v0v%{*x?!Gt=wLwBO%23_!^^0%>kGk%%!=iohqZT{?H`s4)q&jP(ofBoW0+y7bc8L{ZU(;@#WEZ_7$ zbNq%J@@J-f#ijhmEb_nZkpE+rzs6@1{F?UrvO|6i%jZnJKYH9E|Nk8FFTcPSIVX_p z7fkuDJLC_tV7Y(#kVXE@)9mBFhUL?qOD0o(1L$qzzn|p~GBJ(+9$XcCugB#0v!Tl9b0qJPdI{|=Vl8ffkpO#L@G5Q{~fZ? zeeWdGSLueFoBe+$=!vIEKl5!q!QRuO3{3iqL9hHL+RWR|_S=W&b4uj@pT?!>b@yzt zsr`W}`o;e*3G<86eq2j&ne=A>!z;X4+IN)?{g~->1JiypP+_C5;=sQU{gcV0|9^!R B>hk~q literal 0 HcmV?d00001 diff --git a/RATapi/inputs.py b/RATapi/inputs.py index 0bc00284..3798cb0f 100644 --- a/RATapi/inputs.py +++ b/RATapi/inputs.py @@ -10,7 +10,7 @@ import RATapi import RATapi.controls import RATapi.wrappers -from RATapi.rat_core import Checks, Control, Limits, NameStore, ProblemDefinition +from RATapi.rat_core import Checks, Control, NameStore, ProblemDefinition from RATapi.utils.enums import Calculations, Languages, LayerModels, TypeOptions parameter_field = { @@ -113,7 +113,7 @@ def __len__(self): return len(self.files) -def make_input(project: RATapi.Project, controls: RATapi.Controls) -> tuple[ProblemDefinition, Limits, Control]: +def make_input(project: RATapi.Project, controls: RATapi.Controls) -> tuple[ProblemDefinition, Control]: """Construct the inputs required for the compiled RAT code using the data defined in the input project and controls. Parameters @@ -127,28 +127,14 @@ def make_input(project: RATapi.Project, controls: RATapi.Controls) -> tuple[Prob ------- problem : RAT.rat_core.ProblemDefinition The problem input used in the compiled RAT code. - limits : RAT.rat_core.Limits - A list of min/max values for each parameter defined in the project. cpp_controls : RAT.rat_core.Control The controls object used in the compiled RAT code. """ - limits = Limits() - - for class_list in RATapi.project.parameter_class_lists: - setattr( - limits, - parameter_field[class_list], - [[element.min, element.max] for element in getattr(project, class_list)], - ) - - if project.model == LayerModels.CustomXY: - controls.calcSldDuringFit = True - problem = make_problem(project) cpp_controls = make_controls(controls) - return problem, limits, cpp_controls + return problem, cpp_controls def make_problem(project: RATapi.Project) -> ProblemDefinition: diff --git a/RATapi/run.py b/RATapi/run.py index 17f47ecc..476daa39 100644 --- a/RATapi/run.py +++ b/RATapi/run.py @@ -109,7 +109,7 @@ def run(project, controls): horizontal_line = "\u2500" * 107 + "\n" display_on = controls.display != Display.Off - problem_definition, limits, cpp_controls = make_input(project, controls) + problem_definition, cpp_controls = make_input(project, controls) if display_on: print("Starting RAT " + horizontal_line) @@ -118,7 +118,6 @@ def run(project, controls): with ProgressBar(display=display_on), TextOutput(display=display_on): problem_definition, output_results, bayes_results = RATapi.rat_core.RATMain( problem_definition, - limits, cpp_controls, ) end = time.time() diff --git a/tests/test_inputs.py b/tests/test_inputs.py index d931ff5f..38911ef2 100644 --- a/tests/test_inputs.py +++ b/tests/test_inputs.py @@ -9,7 +9,7 @@ import RATapi import RATapi.wrappers from RATapi.inputs import FileHandles, check_indices, make_controls, make_input, make_problem -from RATapi.rat_core import Checks, Control, Limits, NameStore, ProblemDefinition +from RATapi.rat_core import Checks, Control, NameStore, ProblemDefinition from RATapi.utils.enums import ( BackgroundActions, BoundHandling, @@ -351,36 +351,6 @@ def custom_xy_problem(test_names, test_checks): return problem -@pytest.fixture -def normal_limits(): - """The expected limits object from "standard_layers_project" and "custom_xy_project".""" - limits = Limits() - limits.params = [[1.0, 5.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]] - limits.backgroundParams = [[1e-7, 1e-5]] - limits.scalefactors = [[0.02, 0.25]] - limits.bulkIns = [[0.0, 0.0]] - limits.bulkOuts = [[6.2e-6, 6.35e-6]] - limits.resolutionParams = [[0.01, 0.05]] - limits.domainRatios = [] - - return limits - - -@pytest.fixture -def domains_limits(): - """The expected limits object from "domains_project".""" - limits = Limits() - limits.params = [[1.0, 5.0], [0.0, 0.0], [0.0, 0.0], [0.0, 0.0]] - limits.backgroundParams = [[1e-7, 1e-5]] - limits.scalefactors = [[0.02, 0.25]] - limits.bulkIns = [[0.0, 0.0]] - limits.bulkOuts = [[6.2e-6, 6.35e-6]] - limits.resolutionParams = [[0.01, 0.05]] - limits.domainRatios = [[0.4, 0.6]] - - return limits - - @pytest.fixture def standard_layers_controls(): """The expected controls object for input to the compiled RAT code given the default inputs and @@ -458,55 +428,38 @@ def custom_xy_controls(): @pytest.mark.parametrize( - ["test_project", "test_problem", "test_limits", "test_controls"], + ["test_project", "test_problem", "test_controls"], [ ( "standard_layers_project", "standard_layers_problem", - "normal_limits", "standard_layers_controls", ), ( "custom_xy_project", "custom_xy_problem", - "normal_limits", "custom_xy_controls", ), ( "domains_project", "domains_problem", - "domains_limits", "standard_layers_controls", ), ], ) -def test_make_input(test_project, test_problem, test_limits, test_controls, request) -> None: - """When converting the "project" and "controls", we should obtain the five input objects required for the compiled +def test_make_input(test_project, test_problem, test_controls, request) -> None: + """When converting the "project" and "controls", we should obtain the two input objects required for the compiled RAT code. """ test_project = request.getfixturevalue(test_project) test_problem = request.getfixturevalue(test_problem) - test_limits = request.getfixturevalue(test_limits) test_controls = request.getfixturevalue(test_controls) - parameter_fields = [ - "params", - "backgroundParams", - "scalefactors", - "bulkIns", - "bulkOuts", - "resolutionParams", - "domainRatios", - ] + problem, controls = make_input(test_project, RATapi.Controls()) - problem, limits, controls = make_input(test_project, RATapi.Controls()) problem = pickle.loads(pickle.dumps(problem)) check_problem_equal(problem, test_problem) - limits = pickle.loads(pickle.dumps(limits)) - for limit_field in parameter_fields: - assert np.all(getattr(limits, limit_field) == getattr(test_limits, limit_field)) - controls = pickle.loads(pickle.dumps(controls)) check_controls_equal(controls, test_controls) From 16e53d1ad3f07c6788cf53e10af74ac2dce67e1c Mon Sep 17 00:00:00 2001 From: Paul Sharp <44529197+DrPaulSharp@users.noreply.github.com> Date: Wed, 19 Mar 2025 18:32:36 +0000 Subject: [PATCH 2/5] Renames "layerSlds" as "layers" --- RATapi/outputs.py | 13 +-- tests/conftest.py | 240 +++++++++++++++++++++--------------------- tests/test_outputs.py | 4 +- tests/utils.py | 2 +- 4 files changed, 130 insertions(+), 129 deletions(-) diff --git a/RATapi/outputs.py b/RATapi/outputs.py index 84b3222d..af3c7a69 100644 --- a/RATapi/outputs.py +++ b/RATapi/outputs.py @@ -141,12 +141,13 @@ class Results: The background for each contrast defined over the simulation range. resolutions : list The resolution for each contrast defined over the simulation range. - layerSlds : list - The array of layer parameter values for each contrast. sldProfiles : list The SLD profiles for each contrast. + layers : list + The array of layer parameter values for each contrast. resampledLayers : list - If resampling is used, the SLD for each contrast after resampling has been performed. + If resampling is used, the array of layer parameter values for each contrast after resampling has been + performed. calculationResults : CalculationResults The chi-squared fit results from the final calculation and fit. contrastParams : ContrastParams @@ -164,8 +165,8 @@ class Results: shiftedData: list backgrounds: list resolutions: list - layerSlds: list sldProfiles: list + layers: list resampledLayers: list calculationResults: CalculationResults contrastParams: ContrastParams @@ -502,8 +503,8 @@ def make_results( shiftedData=output_results.shiftedData, backgrounds=output_results.backgrounds, resolutions=output_results.resolutions, - layerSlds=output_results.layerSlds, sldProfiles=output_results.sldProfiles, + layers=output_results.layers, resampledLayers=output_results.resampledLayers, calculationResults=calculation_results, contrastParams=contrast_params, @@ -524,8 +525,8 @@ def make_results( shiftedData=output_results.shiftedData, backgrounds=output_results.backgrounds, resolutions=output_results.resolutions, - layerSlds=output_results.layerSlds, sldProfiles=output_results.sldProfiles, + layers=output_results.layers, resampledLayers=output_results.resampledLayers, calculationResults=calculation_results, contrastParams=contrast_params, diff --git a/tests/conftest.py b/tests/conftest.py index ce580c15..7d987a9f 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -774,36 +774,6 @@ def reflectivity_calculation_output_results(): ] ), ] - results.layerSlds = [ - [ - np.array( - [ - [1.954000e01, 4.001499e-06, 3.000000e00], - [2.266000e01, -6.586988e-08, 3.000000e00], - [8.560000e00, 3.672535e-06, 5.640000e00], - [1.712000e01, 5.980000e-06, 5.640000e00], - [1.070000e01, 3.100365e-06, 6.014000e00], - [1.782000e01, 6.751924e-07, 6.014000e00], - [1.782000e01, 6.751924e-07, 6.014000e00], - [1.070000e01, 3.100365e-06, 6.014000e00], - ], - ), - ], - [ - np.array( - [ - [1.9540000e01, 3.1114020e-06, 3.0000000e00], - [2.2660000e01, -2.6387028e-07, 3.0000000e00], - [8.5600000e00, 1.9590700e-06, 5.6400000e00], - [1.7120000e01, 2.2100000e-06, 5.6400000e00], - [1.0700000e01, 1.7375100e-06, 6.0140000e00], - [1.7820000e01, 1.0164400e-08, 6.0140000e00], - [1.7820000e01, 1.0164400e-08, 6.0140000e00], - [1.0700000e01, 1.7375100e-06, 6.0140000e00], - ], - ), - ], - ] results.sldProfiles = [ [ np.array( @@ -866,6 +836,36 @@ def reflectivity_calculation_output_results(): ), ], ] + results.layers = [ + [ + np.array( + [ + [1.954000e01, 4.001499e-06, 3.000000e00], + [2.266000e01, -6.586988e-08, 3.000000e00], + [8.560000e00, 3.672535e-06, 5.640000e00], + [1.712000e01, 5.980000e-06, 5.640000e00], + [1.070000e01, 3.100365e-06, 6.014000e00], + [1.782000e01, 6.751924e-07, 6.014000e00], + [1.782000e01, 6.751924e-07, 6.014000e00], + [1.070000e01, 3.100365e-06, 6.014000e00], + ], + ), + ], + [ + np.array( + [ + [1.9540000e01, 3.1114020e-06, 3.0000000e00], + [2.2660000e01, -2.6387028e-07, 3.0000000e00], + [8.5600000e00, 1.9590700e-06, 5.6400000e00], + [1.7120000e01, 2.2100000e-06, 5.6400000e00], + [1.0700000e01, 1.7375100e-06, 6.0140000e00], + [1.7820000e01, 1.0164400e-08, 6.0140000e00], + [1.7820000e01, 1.0164400e-08, 6.0140000e00], + [1.0700000e01, 1.7375100e-06, 6.0140000e00], + ], + ), + ], + ] results.resampledLayers = [[np.array([[0.0, 0.0, 0.0]])], [np.array([[0.0, 0.0, 0.0]])]] results.calculationResults = RATapi.rat_core.Calculation() results.calculationResults.chiValues = np.array([202.83057377, 1641.4024969]) @@ -1430,36 +1430,6 @@ def reflectivity_calculation_results(): ] ), ], - layerSlds=[ - [ - np.array( - [ - [1.954000e01, 4.001499e-06, 3.000000e00], - [2.266000e01, -6.586988e-08, 3.000000e00], - [8.560000e00, 3.672535e-06, 5.640000e00], - [1.712000e01, 5.980000e-06, 5.640000e00], - [1.070000e01, 3.100365e-06, 6.014000e00], - [1.782000e01, 6.751924e-07, 6.014000e00], - [1.782000e01, 6.751924e-07, 6.014000e00], - [1.070000e01, 3.100365e-06, 6.014000e00], - ], - ), - ], - [ - np.array( - [ - [1.9540000e01, 3.1114020e-06, 3.0000000e00], - [2.2660000e01, -2.6387028e-07, 3.0000000e00], - [8.5600000e00, 1.9590700e-06, 5.6400000e00], - [1.7120000e01, 2.2100000e-06, 5.6400000e00], - [1.0700000e01, 1.7375100e-06, 6.0140000e00], - [1.7820000e01, 1.0164400e-08, 6.0140000e00], - [1.7820000e01, 1.0164400e-08, 6.0140000e00], - [1.0700000e01, 1.7375100e-06, 6.0140000e00], - ], - ), - ], - ], sldProfiles=[ [ np.array( @@ -1522,6 +1492,36 @@ def reflectivity_calculation_results(): ), ], ], + layers=[ + [ + np.array( + [ + [1.954000e01, 4.001499e-06, 3.000000e00], + [2.266000e01, -6.586988e-08, 3.000000e00], + [8.560000e00, 3.672535e-06, 5.640000e00], + [1.712000e01, 5.980000e-06, 5.640000e00], + [1.070000e01, 3.100365e-06, 6.014000e00], + [1.782000e01, 6.751924e-07, 6.014000e00], + [1.782000e01, 6.751924e-07, 6.014000e00], + [1.070000e01, 3.100365e-06, 6.014000e00], + ], + ), + ], + [ + np.array( + [ + [1.9540000e01, 3.1114020e-06, 3.0000000e00], + [2.2660000e01, -2.6387028e-07, 3.0000000e00], + [8.5600000e00, 1.9590700e-06, 5.6400000e00], + [1.7120000e01, 2.2100000e-06, 5.6400000e00], + [1.0700000e01, 1.7375100e-06, 6.0140000e00], + [1.7820000e01, 1.0164400e-08, 6.0140000e00], + [1.7820000e01, 1.0164400e-08, 6.0140000e00], + [1.0700000e01, 1.7375100e-06, 6.0140000e00], + ], + ), + ], + ], resampledLayers=[[np.array([[0.0, 0.0, 0.0]])], [np.array([[0.0, 0.0, 0.0]])]], calculationResults=RATapi.outputs.CalculationResults( chiValues=np.array([202.83057377, 1641.4024969]), @@ -2091,36 +2091,6 @@ def dream_output_results(): ] ), ] - results.layerSlds = [ - [ - np.array( - [ - [3.15755349e01, 3.35278238e-06, 4.16625659e00], - [3.61791464e01, 7.68327921e-07, 4.16625659e00], - [1.00488530e01, 2.06044530e-06, 2.78042232e01], - [1.08043784e01, 3.29384190e-06, 2.78042232e01], - [2.42251646e01, 2.35556998e-06, 1.55593097e01], - [1.49022278e01, 7.42138004e-07, 1.55593097e01], - [1.49022278e01, 7.42138004e-07, 1.55593097e01], - [2.42251646e01, 2.35556998e-06, 1.55593097e01], - ], - ), - ], - [ - np.array( - [ - [3.15755349e01, 4.11636356e-06, 4.16625659e00], - [3.61791464e01, 1.39268494e-06, 4.16625659e00], - [1.00488530e01, 2.45715680e-06, 2.78042232e01], - [1.08043784e01, 5.26668495e-06, 2.78042232e01], - [2.42251646e01, 3.31348777e-06, 1.55593097e01], - [1.49022278e01, 1.37428245e-06, 1.55593097e01], - [1.49022278e01, 1.37428245e-06, 1.55593097e01], - [2.42251646e01, 3.31348777e-06, 1.55593097e01], - ], - ), - ], - ] results.sldProfiles = [ [ np.array( @@ -2191,6 +2161,36 @@ def dream_output_results(): ), ], ] + results.layers = [ + [ + np.array( + [ + [3.15755349e01, 3.35278238e-06, 4.16625659e00], + [3.61791464e01, 7.68327921e-07, 4.16625659e00], + [1.00488530e01, 2.06044530e-06, 2.78042232e01], + [1.08043784e01, 3.29384190e-06, 2.78042232e01], + [2.42251646e01, 2.35556998e-06, 1.55593097e01], + [1.49022278e01, 7.42138004e-07, 1.55593097e01], + [1.49022278e01, 7.42138004e-07, 1.55593097e01], + [2.42251646e01, 2.35556998e-06, 1.55593097e01], + ], + ), + ], + [ + np.array( + [ + [3.15755349e01, 4.11636356e-06, 4.16625659e00], + [3.61791464e01, 1.39268494e-06, 4.16625659e00], + [1.00488530e01, 2.45715680e-06, 2.78042232e01], + [1.08043784e01, 5.26668495e-06, 2.78042232e01], + [2.42251646e01, 3.31348777e-06, 1.55593097e01], + [1.49022278e01, 1.37428245e-06, 1.55593097e01], + [1.49022278e01, 1.37428245e-06, 1.55593097e01], + [2.42251646e01, 3.31348777e-06, 1.55593097e01], + ], + ), + ], + ] results.resampledLayers = [[np.array([[0.0, 0.0, 0.0]])], [np.array([[0.0, 0.0, 0.0]])]] results.calculationResults = RATapi.rat_core.Calculation() results.calculationResults.chiValues = (np.array([4.6077885, 7.00028098]),) @@ -4576,36 +4576,6 @@ def dream_results(): ] ), ], - layerSlds=[ - [ - np.array( - [ - [3.15755349e01, 3.35278238e-06, 4.16625659e00], - [3.61791464e01, 7.68327921e-07, 4.16625659e00], - [1.00488530e01, 2.06044530e-06, 2.78042232e01], - [1.08043784e01, 3.29384190e-06, 2.78042232e01], - [2.42251646e01, 2.35556998e-06, 1.55593097e01], - [1.49022278e01, 7.42138004e-07, 1.55593097e01], - [1.49022278e01, 7.42138004e-07, 1.55593097e01], - [2.42251646e01, 2.35556998e-06, 1.55593097e01], - ], - ), - ], - [ - np.array( - [ - [3.15755349e01, 4.11636356e-06, 4.16625659e00], - [3.61791464e01, 1.39268494e-06, 4.16625659e00], - [1.00488530e01, 2.45715680e-06, 2.78042232e01], - [1.08043784e01, 5.26668495e-06, 2.78042232e01], - [2.42251646e01, 3.31348777e-06, 1.55593097e01], - [1.49022278e01, 1.37428245e-06, 1.55593097e01], - [1.49022278e01, 1.37428245e-06, 1.55593097e01], - [2.42251646e01, 3.31348777e-06, 1.55593097e01], - ], - ), - ], - ], sldProfiles=[ [ np.array( @@ -4676,6 +4646,36 @@ def dream_results(): ), ], ], + layers=[ + [ + np.array( + [ + [3.15755349e01, 3.35278238e-06, 4.16625659e00], + [3.61791464e01, 7.68327921e-07, 4.16625659e00], + [1.00488530e01, 2.06044530e-06, 2.78042232e01], + [1.08043784e01, 3.29384190e-06, 2.78042232e01], + [2.42251646e01, 2.35556998e-06, 1.55593097e01], + [1.49022278e01, 7.42138004e-07, 1.55593097e01], + [1.49022278e01, 7.42138004e-07, 1.55593097e01], + [2.42251646e01, 2.35556998e-06, 1.55593097e01], + ], + ), + ], + [ + np.array( + [ + [3.15755349e01, 4.11636356e-06, 4.16625659e00], + [3.61791464e01, 1.39268494e-06, 4.16625659e00], + [1.00488530e01, 2.45715680e-06, 2.78042232e01], + [1.08043784e01, 5.26668495e-06, 2.78042232e01], + [2.42251646e01, 3.31348777e-06, 1.55593097e01], + [1.49022278e01, 1.37428245e-06, 1.55593097e01], + [1.49022278e01, 1.37428245e-06, 1.55593097e01], + [2.42251646e01, 3.31348777e-06, 1.55593097e01], + ], + ), + ], + ], resampledLayers=[[np.array([[0.0, 0.0, 0.0]])], [np.array([[0.0, 0.0, 0.0]])]], calculationResults=RATapi.outputs.CalculationResults( chiValues=np.array([4.6077885, 7.00028098]), diff --git a/tests/test_outputs.py b/tests/test_outputs.py index 7d9a0afd..a0f91af9 100644 --- a/tests/test_outputs.py +++ b/tests/test_outputs.py @@ -24,8 +24,8 @@ def reflectivity_calculation_str(): "shiftedData = [Data array: [21 x 3], Data array: [21 x 3]],\n" "backgrounds = [Data array: [82 x 3], Data array: [82 x 3]],\n" "resolutions = [Data array: [82 x 2], Data array: [82 x 2]],\n" - "layerSlds = [[Data array: [8 x 3]], [Data array: [8 x 3]]],\n" "sldProfiles = [[Data array: [25 x 2], Data array: [25 x 2]]],\n" + "layers = [[Data array: [8 x 3]], [Data array: [8 x 3]]],\n" "resampledLayers = [[Data array: [1 x 3]], [Data array: [1 x 3]]],\n" "calculationResults = CalculationResults(\n" "\tchiValues = [ 202.83057377 1641.4024969 ],\n" @@ -59,8 +59,8 @@ def dream_str(): "shiftedData = [Data array: [21 x 3], Data array: [21 x 3]],\n" "backgrounds = [Data array: [82 x 3], Data array: [82 x 3]],\n" "resolutions = [Data array: [82 x 2], Data array: [82 x 2]],\n" - "layerSlds = [[Data array: [8 x 3]], [Data array: [8 x 3]]],\n" "sldProfiles = [[Data array: [29 x 2], Data array: [29 x 2]]],\n" + "layers = [[Data array: [8 x 3]], [Data array: [8 x 3]]],\n" "resampledLayers = [[Data array: [1 x 3]], [Data array: [1 x 3]]],\n" "calculationResults = CalculationResults(\n" "\tchiValues = [4.6077885 7.00028098],\n" diff --git a/tests/utils.py b/tests/utils.py index a9411aac..36805e6d 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -31,7 +31,7 @@ def check_results_equal(actual_results, expected_results) -> None: "CalculationResults" and "ContrastParams". """ list_fields = ["reflectivity", "simulation", "shiftedData", "backgrounds", "resolutions"] - double_list_fields = ["layerSlds", "sldProfiles", "resampledLayers"] + double_list_fields = ["sldProfiles", "layers", "resampledLayers"] contrast_param_fields = [ "scalefactors", "bulkIn", From 269ecea2157771d3e33d7cf0e939fc81f4bbd1af Mon Sep 17 00:00:00 2001 From: Paul Sharp <44529197+DrPaulSharp@users.noreply.github.com> Date: Tue, 25 Mar 2025 12:45:07 +0000 Subject: [PATCH 3/5] Updates submodule and build --- RATapi/examples/languages/custom_bilayer.o | Bin 34776 -> 0 bytes RATapi/outputs.py | 4 -- cpp/RAT | 2 +- cpp/includes/defines.h | 11 ++- cpp/rat.cpp | 77 ++++----------------- tests/conftest.py | 2 - tests/test_inputs.py | 2 +- tests/test_outputs.py | 1 - tests/utils.py | 2 +- 9 files changed, 19 insertions(+), 82 deletions(-) delete mode 100644 RATapi/examples/languages/custom_bilayer.o diff --git a/RATapi/examples/languages/custom_bilayer.o b/RATapi/examples/languages/custom_bilayer.o deleted file mode 100644 index aa967bdbe6367f51cfab56b36ffb069c6bfe46f1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 34776 zcmcg#eRx&HnLo)Dj20zWKd7}Dr~)dcxd9ZctwFeOBS9h|h>Birk{c4uS8r}0xN6Z5 z<%+4;ilx@I^lPPE|DaF1UE1wO&{pYFpDx?4rQL32yS2+!cAK_7yKKMQ-#h1>bKWy& zCdsutoyT)$&Tr=Zn0MZJXU;i8e1EE8MR{47r&F2tUN5}UsON3CBP`dcVx9L{?=z|` z-4o4H&Tl}zjLXZBr?|WV`AROQk=JwiM$T6uZ@{&h?{DIK4e~}V-^}@1&hrF4~ z>yh8WA{!40QIb;%fka zymXxM-%PK>HDmasqV($_EmrTnL7e^ia!Y-ks83kx)1v+~OMRoLpJJ)sAnK=D>MKP3 z>6ZFR)T6J&TJ?96ao=Iw_Zjzt(fibP!7Q~?-t5NBNR<56!@!1p5gSH-GkwD$m^`(Y z8b;-+hI^v2Zhc-8?9*J@r_Te&4aC*ict3GB)PUH^)zI9Re}LHevPdbdi(h##1hmn{ zQ?7FLPR*8BrSP*M1pymU`*6D&UG>?L%BzVt4}{{Gg07)ij)b){Qb*;@G2EoU;ZA~Q zq>j@qTHl#M#f;P#-J;^o;j|j78N)OEF{A1btOB@en5Ip-^$0wgrct{1LpdLO^WHi_ zJ{`*6IPBlwI_&$7>d^4K$+K%T*!lOjQa^lNHIwJH!QkcJ-%3XCc`ZhR^vE8MvRx`X zh)$w{^tM)TAfSK}rKq%0jAP1l@p-F+3M(V%MB`*wop}Pi9dT6vl!n?6RoNP;9>8}ihDQX$`)(cpObFGEm{I%C+R%i0L zY*$xrYo@cOKbNP)8tGe~y|L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p?{-A|9)s-&YzbY@`qV|E$gi_(|+`K0B!c`u*j$PSEl?a0Bqy;_bk6t z3+CLEPYiAHx3l~-(>;rPD=t(10*CynbA3W~W9AZ%A9)9TEz`FJlzzb+|8CIR^gqn{ zZ(@4VpWeTj`v0v%{*x?!Gt=wLwBO%23_!^^0%>kGk%%!=iohqZT{?H`s4)q&jP(ofBoW0+y7bc8L{ZU(;@#WEZ_7$ zbNq%J@@J-f#ijhmEb_nZkpE+rzs6@1{F?UrvO|6i%jZnJKYH9E|Nk8FFTcPSIVX_p z7fkuDJLC_tV7Y(#kVXE@)9mBFhUL?qOD0o(1L$qzzn|p~GBJ(+9$XcCugB#0v!Tl9b0qJPdI{|=Vl8ffkpO#L@G5Q{~fZ? zeeWdGSLueFoBe+$=!vIEKl5!q!QRuO3{3iqL9hHL+RWR|_S=W&b4uj@pT?!>b@yzt zsr`W}`o;e*3G<86eq2j&ne=A>!z;X4+IN)?{g~->1JiypP+_C5;=sQU{gcV0|9^!R B>hk~q diff --git a/RATapi/outputs.py b/RATapi/outputs.py index af3c7a69..150ebc2d 100644 --- a/RATapi/outputs.py +++ b/RATapi/outputs.py @@ -324,8 +324,6 @@ class DreamOutput(RATResult): The runtime of the DREAM algorithm in seconds. iteration : float The number of iterations performed. - modelOutput : float - Unused. Will always be 0. AR : np.ndarray A two-column array where ``DreamOutput.AR[i, 0]`` is an iteration number and ``DreamOutput.AR[i, 1]`` is the average acceptance rate of chain step @@ -345,7 +343,6 @@ class DreamOutput(RATResult): outlierChains: np.ndarray runtime: float iteration: float - modelOutput: float AR: np.ndarray R_stat: np.ndarray CR: np.ndarray @@ -484,7 +481,6 @@ def make_results( outlierChains=bayes_results.dreamOutput.outlierChains, runtime=bayes_results.dreamOutput.runtime, iteration=bayes_results.dreamOutput.iteration, - modelOutput=bayes_results.dreamOutput.modelOutput, AR=bayes_results.dreamOutput.AR, R_stat=bayes_results.dreamOutput.R_stat, CR=bayes_results.dreamOutput.CR, diff --git a/cpp/RAT b/cpp/RAT index 282d17be..b33f77a0 160000 --- a/cpp/RAT +++ b/cpp/RAT @@ -1 +1 @@ -Subproject commit 282d17beb964af0855c1b2cc412e0b187b1a4140 +Subproject commit b33f77a0cbab9c9493cfe06120e3e1ac97d3e8f8 diff --git a/cpp/includes/defines.h b/cpp/includes/defines.h index ffecaec3..90e6e544 100644 --- a/cpp/includes/defines.h +++ b/cpp/includes/defines.h @@ -237,8 +237,6 @@ runtime : float The runtime of the DREAM algorithm in seconds. iteration : float The number of iterations performed. -modelOutput : float - Unused. Will always be 0. AR : np.ndarray[np.float] A two-column array where ``DreamOutput.AR[i, 0]`` is an iteration number and ``DreamOutput.AR[i, 1]`` is the average acceptance rate of chain step @@ -259,7 +257,6 @@ struct DreamOutput py::array_t outlierChains; real_T runtime; real_T iteration; - real_T modelOutput; py::array_t AR; py::array_t R_stat; py::array_t CR; @@ -354,12 +351,12 @@ backgrounds : list The background for each contrast defined over the simulation range. resolutions : list The resolution for each contrast defined over the simulation range. -layerSlds : list - The array of layer parameter values for each contrast. sldProfiles : list The SLD profiles for each contrast. +layers : list + The array of layer parameter values for each contrast. resampledLayers : list - If resampling is used, the SLD for each contrast after resampling has been performed. + If resampling is used, the array of layer parameter values for each contrast after resampling has been performed. calculationResults : RATapi.rat_core.Calculation The chi-squared fit results from the final calculation and fit. contrastParams : RATapi.rat_core.ContrastParams @@ -377,8 +374,8 @@ struct OutputResult { py::list shiftedData; py::list backgrounds; py::list resolutions; - py::list layerSlds; py::list sldProfiles; + py::list layers; py::list resampledLayers; Calculation calculationResults {}; ContrastParams contrastParams {}; diff --git a/cpp/rat.cpp b/cpp/rat.cpp index d8d48d68..a92dc49d 100644 --- a/cpp/rat.cpp +++ b/cpp/rat.cpp @@ -301,21 +301,6 @@ RAT::b_ProblemDefinition createProblemDefinitionStruct(const ProblemDefinition& } -RAT::ProblemLimits createProblemLimitsStruct(const Limits& limits) -{ - RAT::ProblemLimits limits_struct; - limits_struct.params = customCaller("Limits.params", pyArrayToRatArray2d, limits.params); - limits_struct.backgroundParams = customCaller("Limits.backgroundParams", pyArrayToRatArray2d, limits.backgroundParams); - limits_struct.scalefactors = customCaller("Limits.scalefactors", pyArrayToRatArray2d, limits.scalefactors); - limits_struct.bulkIns = customCaller("Limits.bulkIns", pyArrayToRatArray2d, limits.bulkIns); - limits_struct.bulkOuts = customCaller("Limits.bulkOuts", pyArrayToRatArray2d, limits.bulkOuts); - limits_struct.resolutionParams = customCaller("Limits.resolutionParams", pyArrayToRatArray2d, limits.resolutionParams); - limits_struct.domainRatios = customCaller("Limits.domainRatios", pyArrayToRatArray2d, limits.domainRatios); - - return limits_struct; -} - - RAT::Controls createControlsStruct(const Control& control) { RAT::Controls control_struct; @@ -391,26 +376,26 @@ OutputResult OutputResultFromStruct(const RAT::Results result) output_result.resolutions.append(array); } - for (int32_T idx0{0}; idx0 < result.layerSlds.size(0); idx0++) { + for (int32_T idx0{0}; idx0 < result.sldProfiles.size(0); idx0++) { py::list inner_list; - for (int32_T idx1{0}; idx1 < result.layerSlds.size(1); idx1++) { - auto tmp = result.layerSlds[idx0 + result.layerSlds.size(0) * idx1]; + for (int32_T idx1{0}; idx1 < result.sldProfiles.size(1); idx1++) { + auto tmp = result.sldProfiles[idx0 + result.sldProfiles.size(0) * idx1]; auto array = py::array_t({tmp.f1.size(0), tmp.f1.size(1)}); std::memcpy(array.request().ptr, tmp.f1.data(), array.nbytes()); inner_list.append(array); } - output_result.layerSlds.append(inner_list); + output_result.sldProfiles.append(inner_list); } - for (int32_T idx0{0}; idx0 < result.sldProfiles.size(0); idx0++) { + for (int32_T idx0{0}; idx0 < result.layers.size(0); idx0++) { py::list inner_list; - for (int32_T idx1{0}; idx1 < result.sldProfiles.size(1); idx1++) { - auto tmp = result.sldProfiles[idx0 + result.sldProfiles.size(0) * idx1]; + for (int32_T idx1{0}; idx1 < result.layers.size(1); idx1++) { + auto tmp = result.layers[idx0 + result.layers.size(0) * idx1]; auto array = py::array_t({tmp.f1.size(0), tmp.f1.size(1)}); std::memcpy(array.request().ptr, tmp.f1.data(), array.nbytes()); inner_list.append(array); } - output_result.sldProfiles.append(inner_list); + output_result.layers.append(inner_list); } for (int32_T idx0{0}; idx0 < result.resampledLayers.size(0); idx0++) { @@ -548,7 +533,6 @@ BayesResults bayesResultsFromStruct(const RAT::BayesResults results) bayesResults.dreamOutput.outlierChains = pyArray2dFromBoundedArray>(results.dreamOutput.outlierChains); bayesResults.dreamOutput.runtime = results.dreamOutput.runtime; bayesResults.dreamOutput.iteration = results.dreamOutput.iteration; - bayesResults.dreamOutput.modelOutput = results.dreamOutput.modelOutput; bayesResults.dreamOutput.R_stat = pyArrayFromRatArray2d(results.dreamOutput.R_stat); bayesResults.dreamOutput.CR = pyArrayFromRatArray2d(results.dreamOutput.CR); bayesResults.dreamOutput.AR = pyArray2dFromBoundedArray>(results.dreamOutput.AR); @@ -582,8 +566,6 @@ Parameters ---------- problem_def : Rat.rat_core.ProblemDefinition The project input for the RAT calculation. -limits : RATapi.rat_core.Limits - Min and max values for each parameter defined in the problem definition. control : RATapi.rat_core.Control The controls object for the RAT calculation. @@ -597,16 +579,15 @@ bayes_result : Rat.rat_core.BayesResults The extra results if RAT calculation is Bayesian. )"; -py::tuple RATMain(const ProblemDefinition& problem_def, const Limits& limits, const Control& control) +py::tuple RATMain(const ProblemDefinition& problem_def, const Control& control) { RAT::b_ProblemDefinition problem_def_struct = createProblemDefinitionStruct(problem_def); - RAT::ProblemLimits limits_struct = createProblemLimitsStruct(limits); RAT::Controls control_struct = createControlsStruct(control); // Output RAT::Results results; RAT::BayesResults bayesResults; // Call the entry-point - RAT::RATMain(&problem_def_struct, &limits_struct, &control_struct, &results, &bayesResults); + RAT::RATMain(&problem_def_struct, &control_struct, &results, &bayesResults); // Copy result to output auto out_problem_def = problemDefinitionFromStruct(problem_def_struct); out_problem_def.customFiles = problem_def.customFiles.attr("copy")(); @@ -802,7 +783,6 @@ PYBIND11_MODULE(rat_core, m) { .def_readwrite("outlierChains", &DreamOutput::outlierChains) .def_readwrite("runtime", &DreamOutput::runtime) .def_readwrite("iteration", &DreamOutput::iteration) - .def_readwrite("modelOutput", &DreamOutput::modelOutput) .def_readwrite("AR", &DreamOutput::AR) .def_readwrite("R_stat", &DreamOutput::R_stat) .def_readwrite("CR", &DreamOutput::CR); @@ -836,8 +816,8 @@ PYBIND11_MODULE(rat_core, m) { .def_readwrite("shiftedData", &OutputResult::shiftedData) .def_readwrite("backgrounds", &OutputResult::backgrounds) .def_readwrite("resolutions", &OutputResult::resolutions) - .def_readwrite("layerSlds", &OutputResult::layerSlds) .def_readwrite("sldProfiles", &OutputResult::sldProfiles) + .def_readwrite("layers", &OutputResult::layers) .def_readwrite("resampledLayers", &OutputResult::resampledLayers) .def_readwrite("calculationResults", &OutputResult::calculationResults) .def_readwrite("contrastParams", &OutputResult::contrastParams) @@ -912,39 +892,6 @@ PYBIND11_MODULE(rat_core, m) { return chk; })); - py::class_(m, "Limits", docsLimits.c_str()) - .def(py::init<>()) - .def_readwrite("params", &Limits::params) - .def_readwrite("backgroundParams", &Limits::backgroundParams) - .def_readwrite("scalefactors", &Limits::scalefactors) - .def_readwrite("bulkIns", &Limits::bulkIns) - .def_readwrite("bulkOuts", &Limits::bulkOuts) - .def_readwrite("resolutionParams", &Limits::resolutionParams) - .def_readwrite("domainRatios", &Limits::domainRatios) - .def(py::pickle( - [](const Limits &lim) { // __getstate__ - /* Return a tuple that fully encodes the state of the object */ - return py::make_tuple(lim.params, lim.backgroundParams, lim.scalefactors, lim.bulkIns, lim.bulkOuts, - lim.resolutionParams, lim.domainRatios); - }, - [](py::tuple t) { // __setstate__ - if (t.size() != 7) - throw std::runtime_error("Encountered invalid state unpickling Limits object!"); - - /* Create a new C++ instance */ - Limits lim; - - lim.params = t[0].cast>(); - lim.backgroundParams = t[1].cast>(); - lim.scalefactors = t[2].cast>(); - lim.bulkIns = t[3].cast>(); - lim.bulkOuts = t[4].cast>(); - lim.resolutionParams = t[5].cast>(); - lim.domainRatios = t[6].cast>(); - - return lim; - })); - py::class_(m, "Control", docsControl.c_str()) .def(py::init<>()) .def_readwrite("parallel", &Control::parallel) @@ -1150,7 +1097,7 @@ PYBIND11_MODULE(rat_core, m) { return p; })); - m.def("RATMain", &RATMain, docsRATMain.c_str(), py::arg("problem_def"), py::arg("limits"), py::arg("control")); + m.def("RATMain", &RATMain, docsRATMain.c_str(), py::arg("problem_def"), py::arg("control")); m.def("makeSLDProfileXY", &makeSLDProfileXY, docsMakeSLDProfileXY.c_str(), py::arg("bulk_in"), py::arg("bulk_out"), py::arg("ssub"), py::arg("layers"), py::arg("number_of_repeats") = DEFAULT_NREPEATS); diff --git a/tests/conftest.py b/tests/conftest.py index 7d987a9f..50fbc11c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3984,7 +3984,6 @@ def dream_bayes(): bayes.dreamOutput.outlierChains = np.array([[0.0, 0.0]]) bayes.dreamOutput.runtime = 2.6e-06 bayes.dreamOutput.iteration = 2.0 - bayes.dreamOutput.modelOutput = 0.0 bayes.dreamOutput.AR = np.array([[1.0, np.nan]]) bayes.dreamOutput.R_stat = np.array( [ @@ -6463,7 +6462,6 @@ def dream_results(): outlierChains=np.array([[0.0, 0.0]]), runtime=2.6e-06, iteration=2.0, - modelOutput=0.0, AR=np.array([[1.0, np.nan]]), R_stat=np.array( [ diff --git a/tests/test_inputs.py b/tests/test_inputs.py index 38911ef2..2874a888 100644 --- a/tests/test_inputs.py +++ b/tests/test_inputs.py @@ -397,7 +397,7 @@ def custom_xy_controls(): controls = Control() controls.procedure = Procedures.Calculate controls.parallel = Parallel.Single - controls.calcSldDuringFit = True + controls.calcSldDuringFit = False controls.resampleMinAngle = 0.9 controls.resampleNPoints = 50.0 controls.display = Display.Iter diff --git a/tests/test_outputs.py b/tests/test_outputs.py index a0f91af9..37a4c631 100644 --- a/tests/test_outputs.py +++ b/tests/test_outputs.py @@ -119,7 +119,6 @@ def dream_str(): "\toutlierChains = Data array: [1 x 2],\n" "\truntime = 2.6e-06,\n" "\titeration = 2.0,\n" - "\tmodelOutput = 0.0,\n" "\tAR = Data array: [1 x 2],\n" "\tR_stat = Data array: [1 x 19],\n" "\tCR = Data array: [1 x 4],\n" diff --git a/tests/utils.py b/tests/utils.py index 36805e6d..40524fd0 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -109,7 +109,7 @@ def check_bayes_fields_equal(actual_results, expected_results) -> None: "IO", "storeOutput", ], - "dreamOutput": ["runtime", "iteration", "modelOutput"], + "dreamOutput": ["runtime", "iteration"], "nestedSamplerOutput": ["logZ"], } From 111f739db794b8b28d8a387fef027bc1700f165d Mon Sep 17 00:00:00 2001 From: Paul Sharp <44529197+DrPaulSharp@users.noreply.github.com> Date: Thu, 27 Mar 2025 15:35:08 +0000 Subject: [PATCH 4/5] Updates submodule --- cpp/RAT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/RAT b/cpp/RAT index b33f77a0..df626113 160000 --- a/cpp/RAT +++ b/cpp/RAT @@ -1 +1 @@ -Subproject commit b33f77a0cbab9c9493cfe06120e3e1ac97d3e8f8 +Subproject commit df626113d7a930cfa23c1ab47fdf9b1111b52123 From b1d1f2480eca5a2b6a878a8cd98e9e02d62908de Mon Sep 17 00:00:00 2001 From: Paul Sharp <44529197+DrPaulSharp@users.noreply.github.com> Date: Thu, 27 Mar 2025 15:56:10 +0000 Subject: [PATCH 5/5] Updates defines.h --- cpp/includes/defines.h | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/cpp/includes/defines.h b/cpp/includes/defines.h index 90e6e544..67b0fda7 100644 --- a/cpp/includes/defines.h +++ b/cpp/includes/defines.h @@ -383,37 +383,6 @@ struct OutputResult { py::list fitNames; }; -const std::string docsLimits = R"(The Python binding for the C++ limit struct which contains -Min and max values for each parameter defined in the project. - -Parameters ----------- -params : np.ndarray[np.float] - Limits for params in the problem definition. -backgroundParams : np.ndarray[np.float] - Limits for backgroundParams in the problem definition. -scalefactors : np.ndarray[np.float] - Limits for scalefactors in the problem definition. -bulkIns : np.ndarray[np.float] - Limits for bulkIns in the problem definition. -bulkOuts : np.ndarray[np.float] - Limits for bulkOuts in the problem definition. -resolutionParams : np.ndarray[np.float] - Limits for resolutionParams in the problem definition. -domainRatios : np.ndarray[np.float] - Limits for domainRatios in the problem definition. -)"; - -struct Limits { - py::array_t params; - py::array_t backgroundParams; - py::array_t scalefactors; - py::array_t bulkIns; - py::array_t bulkOuts; - py::array_t resolutionParams; - py::array_t domainRatios; -}; - const std::string docsNameStore = R"(The Python binding for the C++ names struct which contains names of all parameters in the project.