@@ -301,21 +301,6 @@ RAT::b_ProblemDefinition createProblemDefinitionStruct(const ProblemDefinition&
301301}
302302
303303
304- RAT::ProblemLimits createProblemLimitsStruct (const Limits& limits)
305- {
306- RAT::ProblemLimits limits_struct;
307- limits_struct.params = customCaller (" Limits.params" , pyArrayToRatArray2d, limits.params );
308- limits_struct.backgroundParams = customCaller (" Limits.backgroundParams" , pyArrayToRatArray2d, limits.backgroundParams );
309- limits_struct.scalefactors = customCaller (" Limits.scalefactors" , pyArrayToRatArray2d, limits.scalefactors );
310- limits_struct.bulkIns = customCaller (" Limits.bulkIns" , pyArrayToRatArray2d, limits.bulkIns );
311- limits_struct.bulkOuts = customCaller (" Limits.bulkOuts" , pyArrayToRatArray2d, limits.bulkOuts );
312- limits_struct.resolutionParams = customCaller (" Limits.resolutionParams" , pyArrayToRatArray2d, limits.resolutionParams );
313- limits_struct.domainRatios = customCaller (" Limits.domainRatios" , pyArrayToRatArray2d, limits.domainRatios );
314-
315- return limits_struct;
316- }
317-
318-
319304RAT::Controls createControlsStruct (const Control& control)
320305{
321306 RAT::Controls control_struct;
@@ -391,26 +376,26 @@ OutputResult OutputResultFromStruct(const RAT::Results result)
391376 output_result.resolutions .append (array);
392377 }
393378
394- for (int32_T idx0{0 }; idx0 < result.layerSlds .size (0 ); idx0++) {
379+ for (int32_T idx0{0 }; idx0 < result.sldProfiles .size (0 ); idx0++) {
395380 py::list inner_list;
396- for (int32_T idx1{0 }; idx1 < result.layerSlds .size (1 ); idx1++) {
397- auto tmp = result.layerSlds [idx0 + result.layerSlds .size (0 ) * idx1];
381+ for (int32_T idx1{0 }; idx1 < result.sldProfiles .size (1 ); idx1++) {
382+ auto tmp = result.sldProfiles [idx0 + result.sldProfiles .size (0 ) * idx1];
398383 auto array = py::array_t <real_T, py::array::f_style>({tmp.f1 .size (0 ), tmp.f1 .size (1 )});
399384 std::memcpy (array.request ().ptr , tmp.f1 .data (), array.nbytes ());
400385 inner_list.append (array);
401386 }
402- output_result.layerSlds .append (inner_list);
387+ output_result.sldProfiles .append (inner_list);
403388 }
404389
405- for (int32_T idx0{0 }; idx0 < result.sldProfiles .size (0 ); idx0++) {
390+ for (int32_T idx0{0 }; idx0 < result.layers .size (0 ); idx0++) {
406391 py::list inner_list;
407- for (int32_T idx1{0 }; idx1 < result.sldProfiles .size (1 ); idx1++) {
408- auto tmp = result.sldProfiles [idx0 + result.sldProfiles .size (0 ) * idx1];
392+ for (int32_T idx1{0 }; idx1 < result.layers .size (1 ); idx1++) {
393+ auto tmp = result.layers [idx0 + result.layers .size (0 ) * idx1];
409394 auto array = py::array_t <real_T, py::array::f_style>({tmp.f1 .size (0 ), tmp.f1 .size (1 )});
410395 std::memcpy (array.request ().ptr , tmp.f1 .data (), array.nbytes ());
411396 inner_list.append (array);
412397 }
413- output_result.sldProfiles .append (inner_list);
398+ output_result.layers .append (inner_list);
414399 }
415400
416401 for (int32_T idx0{0 }; idx0 < result.resampledLayers .size (0 ); idx0++) {
@@ -548,7 +533,6 @@ BayesResults bayesResultsFromStruct(const RAT::BayesResults results)
548533 bayesResults.dreamOutput .outlierChains = pyArray2dFromBoundedArray<coder::bounded_array<real_T, 2000U , 2U >>(results.dreamOutput .outlierChains );
549534 bayesResults.dreamOutput .runtime = results.dreamOutput .runtime ;
550535 bayesResults.dreamOutput .iteration = results.dreamOutput .iteration ;
551- bayesResults.dreamOutput .modelOutput = results.dreamOutput .modelOutput ;
552536 bayesResults.dreamOutput .R_stat = pyArrayFromRatArray2d (results.dreamOutput .R_stat );
553537 bayesResults.dreamOutput .CR = pyArrayFromRatArray2d (results.dreamOutput .CR );
554538 bayesResults.dreamOutput .AR = pyArray2dFromBoundedArray<coder::bounded_array<real_T, 2000U , 2U >>(results.dreamOutput .AR );
@@ -582,8 +566,6 @@ Parameters
582566----------
583567problem_def : Rat.rat_core.ProblemDefinition
584568 The project input for the RAT calculation.
585- limits : RATapi.rat_core.Limits
586- Min and max values for each parameter defined in the problem definition.
587569control : RATapi.rat_core.Control
588570 The controls object for the RAT calculation.
589571
@@ -597,16 +579,15 @@ bayes_result : Rat.rat_core.BayesResults
597579 The extra results if RAT calculation is Bayesian.
598580)" ;
599581
600- py::tuple RATMain (const ProblemDefinition& problem_def, const Limits& limits, const Control& control)
582+ py::tuple RATMain (const ProblemDefinition& problem_def, const Control& control)
601583{
602584 RAT::b_ProblemDefinition problem_def_struct = createProblemDefinitionStruct (problem_def);
603- RAT::ProblemLimits limits_struct = createProblemLimitsStruct (limits);
604585 RAT::Controls control_struct = createControlsStruct (control);
605586 // Output
606587 RAT::Results results;
607588 RAT::BayesResults bayesResults;
608589 // Call the entry-point
609- RAT::RATMain (&problem_def_struct, &limits_struct, & control_struct, &results, &bayesResults);
590+ RAT::RATMain (&problem_def_struct, &control_struct, &results, &bayesResults);
610591 // Copy result to output
611592 auto out_problem_def = problemDefinitionFromStruct (problem_def_struct);
612593 out_problem_def.customFiles = problem_def.customFiles .attr (" copy" )();
@@ -802,7 +783,6 @@ PYBIND11_MODULE(rat_core, m) {
802783 .def_readwrite (" outlierChains" , &DreamOutput::outlierChains)
803784 .def_readwrite (" runtime" , &DreamOutput::runtime)
804785 .def_readwrite (" iteration" , &DreamOutput::iteration)
805- .def_readwrite (" modelOutput" , &DreamOutput::modelOutput)
806786 .def_readwrite (" AR" , &DreamOutput::AR)
807787 .def_readwrite (" R_stat" , &DreamOutput::R_stat)
808788 .def_readwrite (" CR" , &DreamOutput::CR);
@@ -836,8 +816,8 @@ PYBIND11_MODULE(rat_core, m) {
836816 .def_readwrite (" shiftedData" , &OutputResult::shiftedData)
837817 .def_readwrite (" backgrounds" , &OutputResult::backgrounds)
838818 .def_readwrite (" resolutions" , &OutputResult::resolutions)
839- .def_readwrite (" layerSlds" , &OutputResult::layerSlds)
840819 .def_readwrite (" sldProfiles" , &OutputResult::sldProfiles)
820+ .def_readwrite (" layers" , &OutputResult::layers)
841821 .def_readwrite (" resampledLayers" , &OutputResult::resampledLayers)
842822 .def_readwrite (" calculationResults" , &OutputResult::calculationResults)
843823 .def_readwrite (" contrastParams" , &OutputResult::contrastParams)
@@ -912,39 +892,6 @@ PYBIND11_MODULE(rat_core, m) {
912892 return chk;
913893 }));
914894
915- py::class_<Limits>(m, " Limits" , docsLimits.c_str ())
916- .def (py::init<>())
917- .def_readwrite (" params" , &Limits::params)
918- .def_readwrite (" backgroundParams" , &Limits::backgroundParams)
919- .def_readwrite (" scalefactors" , &Limits::scalefactors)
920- .def_readwrite (" bulkIns" , &Limits::bulkIns)
921- .def_readwrite (" bulkOuts" , &Limits::bulkOuts)
922- .def_readwrite (" resolutionParams" , &Limits::resolutionParams)
923- .def_readwrite (" domainRatios" , &Limits::domainRatios)
924- .def (py::pickle (
925- [](const Limits &lim) { // __getstate__
926- /* Return a tuple that fully encodes the state of the object */
927- return py::make_tuple (lim.params , lim.backgroundParams , lim.scalefactors , lim.bulkIns , lim.bulkOuts ,
928- lim.resolutionParams , lim.domainRatios );
929- },
930- [](py::tuple t) { // __setstate__
931- if (t.size () != 7 )
932- throw std::runtime_error (" Encountered invalid state unpickling Limits object!" );
933-
934- /* Create a new C++ instance */
935- Limits lim;
936-
937- lim.params = t[0 ].cast <py::array_t <real_T>>();
938- lim.backgroundParams = t[1 ].cast <py::array_t <real_T>>();
939- lim.scalefactors = t[2 ].cast <py::array_t <real_T>>();
940- lim.bulkIns = t[3 ].cast <py::array_t <real_T>>();
941- lim.bulkOuts = t[4 ].cast <py::array_t <real_T>>();
942- lim.resolutionParams = t[5 ].cast <py::array_t <real_T>>();
943- lim.domainRatios = t[6 ].cast <py::array_t <real_T>>();
944-
945- return lim;
946- }));
947-
948895 py::class_<Control>(m, " Control" , docsControl.c_str ())
949896 .def (py::init<>())
950897 .def_readwrite (" parallel" , &Control::parallel)
@@ -1150,7 +1097,7 @@ PYBIND11_MODULE(rat_core, m) {
11501097 return p;
11511098 }));
11521099
1153- m.def (" RATMain" , &RATMain, docsRATMain.c_str (), py::arg (" problem_def" ), py::arg (" limits " ), py::arg ( " control" ));
1100+ m.def (" RATMain" , &RATMain, docsRATMain.c_str (), py::arg (" problem_def" ), py::arg (" control" ));
11541101
11551102 m.def (" makeSLDProfileXY" , &makeSLDProfileXY, docsMakeSLDProfileXY.c_str (),
11561103 py::arg (" bulk_in" ), py::arg (" bulk_out" ), py::arg (" ssub" ), py::arg (" layers" ), py::arg (" number_of_repeats" ) = DEFAULT_NREPEATS);
0 commit comments