@@ -16,7 +16,7 @@ setup_pybind11(cfg)
1616#include " RAT/RATMain_initialize.h"
1717#include " RAT/RATMain_terminate.h"
1818#include " RAT/RATMain_types.h"
19- #include " RAT/makeSLDProfileXY .h"
19+ #include " RAT/makeSLDProfile .h"
2020#include " RAT/dylib.hpp"
2121#include " RAT/events/eventManager.h"
2222#include " includes/defines.h"
@@ -263,7 +263,7 @@ RAT::b_ProblemDefinition createProblemDefinitionStruct(const ProblemDefinition&
263263 problem_struct.numberOfContrasts = problem.numberOfContrasts ;
264264 stringToRatBoundedArray (problem.geometry , problem_struct.geometry .data , problem_struct.geometry .size );
265265 problem_struct.useImaginary = problem.useImaginary ;
266- problem_struct.repeatLayers = customCaller (" Problem.repeatLayers" , pyListToRatCellWrap2 , problem.repeatLayers );
266+ problem_struct.repeatLayers = customCaller (" Problem.repeatLayers" , pyArrayToRatRowArray1d , problem.repeatLayers );
267267 problem_struct.contrastBackgroundParams = customCaller (" Problem.contrastBackgroundParams" , pyListToRatCellWrap3, problem.contrastBackgroundParams );
268268 problem_struct.contrastBackgroundTypes = customCaller (" Problem.contrastBackgroundTypes" , pyListToRatCellWrap02d, problem.contrastBackgroundTypes );
269269 problem_struct.contrastBackgroundActions = customCaller (" Problem.contrastBackgroundActions" , pyListToRatCellWrap02d, problem.contrastBackgroundActions );
@@ -460,7 +460,7 @@ ProblemDefinition problemDefinitionFromStruct(const RAT::b_ProblemDefinition pro
460460 problem_def.numberOfContrasts = problem.numberOfContrasts ;
461461 stringFromRatBoundedArray (problem.geometry .data , problem.geometry .size , problem_def.geometry );
462462 problem_def.useImaginary = problem.useImaginary ;
463- problem_def.repeatLayers = pyListFromRatCellWrap2 (problem.repeatLayers );
463+ problem_def.repeatLayers = pyArrayFromRatArray1d<coder::array<real_T, 2U >> (problem.repeatLayers );
464464 problem_def.contrastBackgroundParams = pyListFromBoundedCellWrap<coder::array<RAT::cell_wrap_3, 2U >>(problem.contrastBackgroundParams );
465465 problem_def.contrastBackgroundTypes = pyListFromRatCellWrap02d (problem.contrastBackgroundTypes );
466466 problem_def.contrastBackgroundActions = pyListFromRatCellWrap02d (problem.contrastBackgroundActions );
@@ -596,18 +596,18 @@ py::tuple RATMain(const ProblemDefinition& problem_def, const Control& control)
596596 OutputBayesResultsFromStruct (bayesResults));
597597}
598598
599- const std::string docsMakeSLDProfileXY = R"( Creates the profiles for the SLD plots
599+ const std::string docsMakeSLDProfile = R"( Creates the profiles for the SLD plots
600600
601601Parameters
602602----------
603603bulk_in : float
604604 Bulk in value for contrast.
605605bulk_out : float
606606 Bulk out value for contrast.
607- ssub : float
608- Substrate roughness.
609607layers : np.ndarray[np.float]
610608 Array of parameters for each layer in the contrast.
609+ ssub : float
610+ Substrate roughness.
611611number_of_repeats : int, default: 1
612612 Number of times the layers are repeated.
613613
@@ -617,22 +617,20 @@ sld_profile : np.ndarray[np.float]
617617 Computed SLD profile
618618)" ;
619619
620- py::array_t <real_T> makeSLDProfileXY (real_T bulk_in,
621- real_T bulk_out,
622- real_T ssub ,
623- const py:: array_t < real_T> &layers ,
624- int number_of_repeats=DEFAULT_NREPEATS)
620+ py::array_t <real_T> makeSLDProfile (real_T bulk_in,
621+ real_T bulk_out,
622+ const py:: array_t < real_T> &layers ,
623+ real_T ssub ,
624+ int number_of_repeats=DEFAULT_NREPEATS)
625625{
626626 coder::array<real_T, 2U > out;
627627 coder::array<real_T, 2U > layers_array = pyArrayToRatArray2d (layers);
628- py::buffer_info buffer_info = layers.request ();
629- RAT::makeSLDProfileXY (bulk_in,
630- bulk_out,
631- ssub,
632- layers_array,
633- buffer_info.shape [0 ],
634- number_of_repeats,
635- out);
628+ RAT::makeSLDProfile (bulk_in,
629+ bulk_out,
630+ layers_array,
631+ ssub,
632+ number_of_repeats,
633+ out);
636634
637635 return pyArrayFromRatArray2d (out);
638636
@@ -1047,7 +1045,7 @@ PYBIND11_MODULE(rat_core, m) {
10471045 p.numberOfContrasts = t[6 ].cast <real_T>();
10481046 p.geometry = t[7 ].cast <std::string>();
10491047 p.useImaginary = t[8 ].cast <bool >();
1050- p.repeatLayers = t[9 ].cast <py::list >();
1048+ p.repeatLayers = t[9 ].cast <py::array_t <real_T> >();
10511049 p.contrastBackgroundParams = t[10 ].cast <py::list>();
10521050 p.contrastBackgroundTypes = t[11 ].cast <py::list>();
10531051 p.contrastBackgroundActions = t[12 ].cast <py::list>();
@@ -1099,6 +1097,6 @@ PYBIND11_MODULE(rat_core, m) {
10991097
11001098 m.def (" RATMain" , &RATMain, docsRATMain.c_str (), py::arg (" problem_def" ), py::arg (" control" ));
11011099
1102- m.def (" makeSLDProfileXY " , &makeSLDProfileXY, docsMakeSLDProfileXY .c_str (),
1103- py::arg (" bulk_in" ), py::arg (" bulk_out" ), py::arg (" ssub " ), py::arg (" layers " ), py::arg (" number_of_repeats" ) = DEFAULT_NREPEATS);
1100+ m.def (" makeSLDProfile " , &makeSLDProfile, docsMakeSLDProfile .c_str (),
1101+ py::arg (" bulk_in" ), py::arg (" bulk_out" ), py::arg (" layers " ), py::arg (" ssub " ), py::arg (" number_of_repeats" ) = DEFAULT_NREPEATS);
11041102}
0 commit comments