diff --git a/Device/Data/Datafield.h b/Device/Data/Datafield.h index 739d2a2b892822d223f005c648c2e3dd6647116d..1fbfb4675d347f2fb494b0fb9e5bf2cc6b512f25 100644 --- a/Device/Data/Datafield.h +++ b/Device/Data/Datafield.h @@ -130,6 +130,9 @@ public: //! @param xup upper edje on x-axis Datafield* yProjection(double xlow, double xup) const; + //! Sets content of output data to specific value. + void setAllTo(const double& value); // Py: test only; rm when possible + #ifndef SWIG double& operator[](size_t i); const double& operator[](size_t i) const; @@ -141,9 +144,6 @@ public: const std::vector<double>& errorSigmas() const; std::vector<double>& errorSigmas(); - //! Sets content of output data to specific value. - void setAllTo(const double& value); - private: std::string m_title; std::unique_ptr<const Frame> m_frame; diff --git a/Device/Detector/IDetector.h b/Device/Detector/IDetector.h index e0a8d925f423644f4f4a4f530a43bebedbe48643..d75b652a0b2e3c44e75c97bf1f8f5b3f3842bbbf 100644 --- a/Device/Detector/IDetector.h +++ b/Device/Detector/IDetector.h @@ -84,6 +84,10 @@ public: //! Sets rectangular region of interest with lower left and upper right corners defined. void setRegionOfInterest(double xlow, double ylow, double xup, double yup); + //! Returns a Frame clipped to the region of interest. If no region of interest is explicitly + //! defined, then the whole detector is taken as "region of interest". + Frame clippedFrame() const; + #ifndef SWIG //! Returns total number of pixels. //! Any region of interest is not taken into account. @@ -133,10 +137,6 @@ public: //! defined, then the whole detector is taken as "region of interest". std::pair<double, double> regionOfInterestBounds(size_t iAxis) const; - //! Returns a Frame clipped to the region of interest. If no region of interest is explicitly - //! defined, then the whole detector is taken as "region of interest". - Frame clippedFrame() const; - //! Returns empty detector map in given axes units. //! This map is a data array limited to the size of the "Region of interest" Datafield createDetectorMap() const; diff --git a/Device/IO/ImportSettings.h b/Device/IO/ImportSettings.h index 045dbe41e9131f92bd3b0c3bb37a5f10f231a775..245ebeafb90d5dcb28ff78d447480476f8f78b9d 100644 --- a/Device/IO/ImportSettings.h +++ b/Device/IO/ImportSettings.h @@ -24,14 +24,31 @@ enum QUnit { over_nm, over_angstrom }; //! Therefore, exceptionally, indices are counting from 1, not from 0. struct ImportSettings1D { + ImportSettings1D(std::string _prefix, std::string _skip, size_t __Q, size_t __R, + size_t __sR = 0, size_t __dQ = 0, size_t __lambda = 0, QUnit _unit = over_nm, + bool _sort = true, bool _rm_neg = true, bool _rm_dup = true) + : headerPrefix(_prefix) + , linesToSkip(_skip) + , col_Q(__Q) + , col_R(__R) + , col_sR(__sR) + , col_dQ(__dQ) + , col_lambda(__lambda) + , qUnit(_unit) + , sort(_sort) + , rm_negative(_rm_neg) + , rm_duplications(_rm_dup) + { + } + std::string headerPrefix; //!< prefix of header lines (usually a single character like "#") std::string linesToSkip; //!< pattern denoting line to skip (i.e. '1,10-12,42') size_t col_Q; //!< column number of Q (counting from 1!) size_t col_R; //!< column number of R - size_t col_sR; //!< column number of sigma R, or 0 - size_t col_dQ; //!< column number of delta Q, or 0 - size_t col_lambda; //!< column number of wavelength, or 0 - QUnit qUnit{over_nm}; + size_t col_sR = 0; //!< column number of sigma R, or 0 + size_t col_dQ = 0; //!< column number of delta Q, or 0 + size_t col_lambda = 0; //!< column number of wavelength, or 0 + QUnit qUnit = over_nm; bool sort = true; //!< sort lines by argument bool rm_negative = true; //!< discard lines with negative arguments bool rm_duplications = true; //!< discard lines with duplicated arguments diff --git a/Sim/Fitting/FitObjective.cpp b/Sim/Fitting/FitObjective.cpp index e43dc091659aaadb6035637a1a6bf9f5508f819c..2f3ed1d1e77eab1fb2841fc659aa61e636a5da3f 100644 --- a/Sim/Fitting/FitObjective.cpp +++ b/Sim/Fitting/FitObjective.cpp @@ -177,6 +177,11 @@ void FitObjective::addSimulationAndData(const PyBuilderCallback& callback, *DataUtil::Array::createPField1D(data, stdv), weight); } +void FitObjective::addFitPair(const PyBuilderCallback& callback, Datafield expData, double weight) +{ + execAddSimulationAndData(simulationBuilder(callback), expData, weight); +} + double FitObjective::evaluate(const mumufit::Parameters& params) { execSimulations(params); diff --git a/Sim/Fitting/FitObjective.h b/Sim/Fitting/FitObjective.h index ac6074eb27d9bdcd97d17991cc5cd218adc43176..f3d8d3a9e7c06908ed35d4b144d9cbe63dd48e53 100644 --- a/Sim/Fitting/FitObjective.h +++ b/Sim/Fitting/FitObjective.h @@ -69,6 +69,8 @@ public: void addSimulationAndData(const PyBuilderCallback& callback, const std::vector<double>& data, const std::vector<double>& stdv, double weight = 1.0); + void addFitPair(const PyBuilderCallback& callback, Datafield expData, double weight = 1.0); + virtual double evaluate(const mumufit::Parameters& params); virtual std::vector<double> evaluate_residuals(const mumufit::Parameters& params); diff --git a/Tests/Py/Fit/fitobjective_api.py b/Tests/Py/Fit/fitobjective_api.py index 50d3ba35e7dc98d641dc0b5f6421461279398f33..9016f8603765391b04e69738bae64a53956836ec 100644 --- a/Tests/Py/Fit/fitobjective_api.py +++ b/Tests/Py/Fit/fitobjective_api.py @@ -13,6 +13,9 @@ class SimulationBuilder: self.m_pars = None self.m_nrow = 3 self.m_ncol = 4 + self.beam = ba.Beam(1., 1., 0) + self.detector = ba.FlatDetector(self.m_ncol, self.m_nrow, 150, 150, + self.beam, ba.FlatDetector.X, 2000) def size(self): return self.m_nrow * self.m_ncol @@ -26,15 +29,14 @@ class SimulationBuilder: sample.addLayer(ba.Layer(material)) sample.addLayer(ba.Layer(material)) - beam = ba.Beam(1., 1., 0) - detector = ba.FlatDetector(self.m_ncol, self.m_nrow, 150, 150, - beam, ba.FlatDetector.X, 2000) - simulation = ba.ScatteringSimulation(beam, sample, detector) + simulation = ba.ScatteringSimulation(self.beam, sample, self.detector) return simulation def create_data(self): - return np.ones(shape=(self.m_nrow, self.m_ncol), dtype=np.float64) + result = ba.Datafield(self.detector.clippedFrame().clone()) + result.setAllTo(1.) + return result class FitObserver: @@ -64,7 +66,7 @@ class FitObjectiveAPITest(unittest.TestCase): # adding simulation callback and experimental data objective = ba.FitObjective() - objective.addSimulationAndData(builder.build_simulation, data, 1) + objective.addFitPair(builder.build_simulation, data, 1) self.assertEqual(builder.m_ncalls, 0) # running objective function @@ -94,7 +96,7 @@ class FitObjectiveAPITest(unittest.TestCase): builder = SimulationBuilder() data = builder.create_data() objective = ba.FitObjective() - objective.addSimulationAndData(builder.build_simulation, data, 1) + objective.addFitPair(builder.build_simulation, data, 1) # adding observer observer = FitObserver() diff --git a/Wrap/Swig/libBornAgainDevice.i b/Wrap/Swig/libBornAgainDevice.i index e54b4a1cde8c354c4887d0f72977febb5340fe6a..78bb21c673fee20af955151e9073087af784c1a6 100644 --- a/Wrap/Swig/libBornAgainDevice.i +++ b/Wrap/Swig/libBornAgainDevice.i @@ -30,6 +30,7 @@ #include "Device/Detector/FlatDetector.h" #include "Device/Detector/SphericalDetector.h" #include "Device/IO/DiffUtil.h" +#include "Device/IO/ImportSettings.h" #include "Device/IO/IOFactory.h" #include "Device/Mask/DetectorMask.h" #include "Device/Mask/Ellipse.h" @@ -75,4 +76,5 @@ %include "Device/Detector/SphericalDetector.h" %include "Device/IO/DiffUtil.h" +%include "Device/IO/ImportSettings.h" %include "Device/IO/IOFactory.h" diff --git a/Wrap/Swig/libBornAgainSim.i b/Wrap/Swig/libBornAgainSim.i index be08a16266f4e2ab3f9d61c3026c300f7ed11f79..d4f7a3f74046a414e35d9e6a53e6439c073ba22d 100644 --- a/Wrap/Swig/libBornAgainSim.i +++ b/Wrap/Swig/libBornAgainSim.i @@ -23,6 +23,7 @@ %import(module="libBornAgainFit") "" %rename(addSimulationAndData_cpp) FitObjective::addSimulationAndData; +%rename(addFitPair_cpp) FitObjective::addFitPair; %rename(evaluate_residuals_cpp) FitObjective::evaluate_residuals; %rename(evaluate_cpp) FitObjective::evaluate; %rename(finalize_cpp) FitObjective::finalize; @@ -188,6 +189,27 @@ class ObserverCallbackWrapper(PyObserverCallback): self.callback_container.append(wrp) return self.addSimulationAndData_cpp(wrp, data, *args, **kwargs) + def addFitPair(self, callback, expData, *args): + """ + Sets simulation and experimental data to the fit objective. + Optionally accepts experimental data uncertainties and + user-defined dataset weight. + + Arguments: + + callback -- user-defined function returning fully-defined bornagain.ISimulation object. + The function must use fit parameter dictionary as its input. + + expData -- Datafield containing experimental data. + + weight -- user-defined weight of the dataset. If not specified, defaults to 1.0. + """ + if not hasattr(self, 'callback_container'): + self.callback_container = [] + wrp = SimulationBuilderWrapper(callback) + self.callback_container.append(wrp) # needed ??? + return self.addFitPair_cpp(wrp, expData, *args) + def convert_params(self, params): """ Converts parameters to what FitObjective::evaluate expects diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py index fcd2b4c12bdf9cf099433bbc6a984ea2c08555c0..f4ee7229eda8294eab7be599dbb159d49a16e127 100644 --- a/auto/Wrap/libBornAgainDevice.py +++ b/auto/Wrap/libBornAgainDevice.py @@ -2175,6 +2175,10 @@ class Datafield(object): """ return _libBornAgainDevice.Datafield_yProjection(self, *args) + def setAllTo(self, value): + r"""setAllTo(Datafield self, double const & value)""" + return _libBornAgainDevice.Datafield_setAllTo(self, value) + # Register Datafield in _libBornAgainDevice: _libBornAgainDevice.Datafield_swigregister(Datafield) class Beam(libBornAgainBase.ICloneable, libBornAgainParam.INode): @@ -2722,6 +2726,10 @@ class IDetector(libBornAgainBase.ICloneable, libBornAgainParam.INode): r"""setRegionOfInterest(IDetector self, double xlow, double ylow, double xup, double yup)""" return _libBornAgainDevice.IDetector_setRegionOfInterest(self, xlow, ylow, xup, yup) + def clippedFrame(self): + r"""clippedFrame(IDetector self) -> Frame""" + return _libBornAgainDevice.IDetector_clippedFrame(self) + # Register IDetector in _libBornAgainDevice: _libBornAgainDevice.IDetector_swigregister(IDetector) class FlatDetector(IDetector): @@ -2899,6 +2907,34 @@ def meanRelativeDifference(dat, ref): def checkRelativeDifference(dat, ref, threshold): r"""checkRelativeDifference(vdouble1d_t dat, vdouble1d_t ref, double threshold) -> bool""" return _libBornAgainDevice.checkRelativeDifference(dat, ref, threshold) +over_nm = _libBornAgainDevice.over_nm + +over_angstrom = _libBornAgainDevice.over_angstrom + +class ImportSettings1D(object): + r"""Proxy of C++ ImportSettings1D class.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def __init__(self, _prefix, _skip, __Q, __R, __sR=0, __dQ=0, __lambda=0, _unit=over_nm, _sort=True, _rm_neg=True, _rm_dup=True): + r"""__init__(ImportSettings1D self, std::string _prefix, std::string _skip, size_t __Q, size_t __R, size_t __sR=0, size_t __dQ=0, size_t __lambda=0, QUnit _unit=over_nm, bool _sort=True, bool _rm_neg=True, bool _rm_dup=True) -> ImportSettings1D""" + _libBornAgainDevice.ImportSettings1D_swiginit(self, _libBornAgainDevice.new_ImportSettings1D(_prefix, _skip, __Q, __R, __sR, __dQ, __lambda, _unit, _sort, _rm_neg, _rm_dup)) + headerPrefix = property(_libBornAgainDevice.ImportSettings1D_headerPrefix_get, _libBornAgainDevice.ImportSettings1D_headerPrefix_set, doc=r"""headerPrefix : std::string""") + linesToSkip = property(_libBornAgainDevice.ImportSettings1D_linesToSkip_get, _libBornAgainDevice.ImportSettings1D_linesToSkip_set, doc=r"""linesToSkip : std::string""") + col_Q = property(_libBornAgainDevice.ImportSettings1D_col_Q_get, _libBornAgainDevice.ImportSettings1D_col_Q_set, doc=r"""col_Q : size_t""") + col_R = property(_libBornAgainDevice.ImportSettings1D_col_R_get, _libBornAgainDevice.ImportSettings1D_col_R_set, doc=r"""col_R : size_t""") + col_sR = property(_libBornAgainDevice.ImportSettings1D_col_sR_get, _libBornAgainDevice.ImportSettings1D_col_sR_set, doc=r"""col_sR : size_t""") + col_dQ = property(_libBornAgainDevice.ImportSettings1D_col_dQ_get, _libBornAgainDevice.ImportSettings1D_col_dQ_set, doc=r"""col_dQ : size_t""") + col_lambda = property(_libBornAgainDevice.ImportSettings1D_col_lambda_get, _libBornAgainDevice.ImportSettings1D_col_lambda_set, doc=r"""col_lambda : size_t""") + qUnit = property(_libBornAgainDevice.ImportSettings1D_qUnit_get, _libBornAgainDevice.ImportSettings1D_qUnit_set, doc=r"""qUnit : QUnit""") + sort = property(_libBornAgainDevice.ImportSettings1D_sort_get, _libBornAgainDevice.ImportSettings1D_sort_set, doc=r"""sort : bool""") + rm_negative = property(_libBornAgainDevice.ImportSettings1D_rm_negative_get, _libBornAgainDevice.ImportSettings1D_rm_negative_set, doc=r"""rm_negative : bool""") + rm_duplications = property(_libBornAgainDevice.ImportSettings1D_rm_duplications_get, _libBornAgainDevice.ImportSettings1D_rm_duplications_set, doc=r"""rm_duplications : bool""") + __swig_destroy__ = _libBornAgainDevice.delete_ImportSettings1D + +# Register ImportSettings1D in _libBornAgainDevice: +_libBornAgainDevice.ImportSettings1D_swigregister(ImportSettings1D) unknown1D = _libBornAgainDevice.unknown1D csv1D = _libBornAgainDevice.csv1D @@ -2922,7 +2958,7 @@ refsans2D = _libBornAgainDevice.refsans2D def readData1D(*args): r""" - readData1D(std::string const & fname, IO::Filetype1D ftype, ImportSettings1D const * importSettings=None) -> Datafield + readData1D(std::string const & fname, IO::Filetype1D ftype, ImportSettings1D importSettings=None) -> Datafield readData1D(std::string const & fname) -> Datafield """ return _libBornAgainDevice.readData1D(*args) diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp index e8cd0ec2047165f0c788cc6ccf8921bcd372668b..b9fe28cfe47e09f0d61fdfc3606d54ceded8ae4e 100644 --- a/auto/Wrap/libBornAgainDevice_wrap.cpp +++ b/auto/Wrap/libBornAgainDevice_wrap.cpp @@ -7025,6 +7025,7 @@ SWIGINTERN void std_vector_Sl_std_pair_Sl_double_Sc_double_Sg__Sg__insert__SWIG_ #include "Device/Detector/FlatDetector.h" #include "Device/Detector/SphericalDetector.h" #include "Device/IO/DiffUtil.h" +#include "Device/IO/ImportSettings.h" #include "Device/IO/IOFactory.h" #include "Device/Mask/DetectorMask.h" #include "Device/Mask/Ellipse.h" @@ -30865,6 +30866,47 @@ fail: } +SWIGINTERN PyObject *_wrap_Datafield_setAllTo(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + Datafield *arg1 = (Datafield *) 0 ; + double *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + double temp2 ; + double val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "Datafield_setAllTo", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_Datafield, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Datafield_setAllTo" "', argument " "1"" of type '" "Datafield *""'"); + } + arg1 = reinterpret_cast< Datafield * >(argp1); + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Datafield_setAllTo" "', argument " "2"" of type '" "double""'"); + } + temp2 = static_cast< double >(val2); + arg2 = &temp2; + { + try { + (arg1)->setAllTo((double const &)*arg2); + } catch (const std::exception& ex) { + // message shown in the Python interpreter + const std::string msg { + "BornAgain C++ Exception: " + std::string(ex.what()) + }; + SWIG_exception(SWIG_RuntimeError, msg.c_str()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *Datafield_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; @@ -36811,6 +36853,39 @@ fail: } +SWIGINTERN PyObject *_wrap_IDetector_clippedFrame(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + IDetector *arg1 = (IDetector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + SwigValueWrapper< Frame > result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_IDetector, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IDetector_clippedFrame" "', argument " "1"" of type '" "IDetector const *""'"); + } + arg1 = reinterpret_cast< IDetector * >(argp1); + { + try { + result = ((IDetector const *)arg1)->clippedFrame(); + } catch (const std::exception& ex) { + // message shown in the Python interpreter + const std::string msg { + "BornAgain C++ Exception: " + std::string(ex.what()) + }; + SWIG_exception(SWIG_RuntimeError, msg.c_str()); + } + } + resultobj = SWIG_NewPointerObj((new Frame(result)), SWIGTYPE_p_Frame, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + SWIGINTERN PyObject *IDetector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *obj; if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; @@ -39786,6 +39861,1715 @@ fail: } +SWIGINTERN PyObject *_wrap_new_ImportSettings1D__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::string arg1 ; + std::string arg2 ; + size_t arg3 ; + size_t arg4 ; + size_t arg5 ; + size_t arg6 ; + size_t arg7 ; + QUnit arg8 ; + bool arg9 ; + bool arg10 ; + bool arg11 ; + size_t val3 ; + int ecode3 = 0 ; + size_t val4 ; + int ecode4 = 0 ; + size_t val5 ; + int ecode5 = 0 ; + size_t val6 ; + int ecode6 = 0 ; + size_t val7 ; + int ecode7 = 0 ; + int val8 ; + int ecode8 = 0 ; + bool val9 ; + int ecode9 = 0 ; + bool val10 ; + int ecode10 = 0 ; + bool val11 ; + int ecode11 = 0 ; + ImportSettings1D *result = 0 ; + + if ((nobjs < 11) || (nobjs > 11)) SWIG_fail; + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[0], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ImportSettings1D" "', argument " "1"" of type '" "std::string""'"); + } + arg1 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[1], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ImportSettings1D" "', argument " "2"" of type '" "std::string""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ImportSettings1D" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_ImportSettings1D" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = static_cast< size_t >(val4); + ecode5 = SWIG_AsVal_size_t(swig_obj[4], &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_ImportSettings1D" "', argument " "5"" of type '" "size_t""'"); + } + arg5 = static_cast< size_t >(val5); + ecode6 = SWIG_AsVal_size_t(swig_obj[5], &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_ImportSettings1D" "', argument " "6"" of type '" "size_t""'"); + } + arg6 = static_cast< size_t >(val6); + ecode7 = SWIG_AsVal_size_t(swig_obj[6], &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "new_ImportSettings1D" "', argument " "7"" of type '" "size_t""'"); + } + arg7 = static_cast< size_t >(val7); + ecode8 = SWIG_AsVal_int(swig_obj[7], &val8); + if (!SWIG_IsOK(ecode8)) { + SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "new_ImportSettings1D" "', argument " "8"" of type '" "QUnit""'"); + } + arg8 = static_cast< QUnit >(val8); + ecode9 = SWIG_AsVal_bool(swig_obj[8], &val9); + if (!SWIG_IsOK(ecode9)) { + SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "new_ImportSettings1D" "', argument " "9"" of type '" "bool""'"); + } + arg9 = static_cast< bool >(val9); + ecode10 = SWIG_AsVal_bool(swig_obj[9], &val10); + if (!SWIG_IsOK(ecode10)) { + SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "new_ImportSettings1D" "', argument " "10"" of type '" "bool""'"); + } + arg10 = static_cast< bool >(val10); + ecode11 = SWIG_AsVal_bool(swig_obj[10], &val11); + if (!SWIG_IsOK(ecode11)) { + SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "new_ImportSettings1D" "', argument " "11"" of type '" "bool""'"); + } + arg11 = static_cast< bool >(val11); + { + try { + result = (ImportSettings1D *)new ImportSettings1D(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); + } catch (const std::exception& ex) { + // message shown in the Python interpreter + const std::string msg { + "BornAgain C++ Exception: " + std::string(ex.what()) + }; + SWIG_exception(SWIG_RuntimeError, msg.c_str()); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ImportSettings1D, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_ImportSettings1D__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::string arg1 ; + std::string arg2 ; + size_t arg3 ; + size_t arg4 ; + size_t arg5 ; + size_t arg6 ; + size_t arg7 ; + QUnit arg8 ; + bool arg9 ; + bool arg10 ; + size_t val3 ; + int ecode3 = 0 ; + size_t val4 ; + int ecode4 = 0 ; + size_t val5 ; + int ecode5 = 0 ; + size_t val6 ; + int ecode6 = 0 ; + size_t val7 ; + int ecode7 = 0 ; + int val8 ; + int ecode8 = 0 ; + bool val9 ; + int ecode9 = 0 ; + bool val10 ; + int ecode10 = 0 ; + ImportSettings1D *result = 0 ; + + if ((nobjs < 10) || (nobjs > 10)) SWIG_fail; + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[0], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ImportSettings1D" "', argument " "1"" of type '" "std::string""'"); + } + arg1 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[1], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ImportSettings1D" "', argument " "2"" of type '" "std::string""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ImportSettings1D" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_ImportSettings1D" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = static_cast< size_t >(val4); + ecode5 = SWIG_AsVal_size_t(swig_obj[4], &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_ImportSettings1D" "', argument " "5"" of type '" "size_t""'"); + } + arg5 = static_cast< size_t >(val5); + ecode6 = SWIG_AsVal_size_t(swig_obj[5], &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_ImportSettings1D" "', argument " "6"" of type '" "size_t""'"); + } + arg6 = static_cast< size_t >(val6); + ecode7 = SWIG_AsVal_size_t(swig_obj[6], &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "new_ImportSettings1D" "', argument " "7"" of type '" "size_t""'"); + } + arg7 = static_cast< size_t >(val7); + ecode8 = SWIG_AsVal_int(swig_obj[7], &val8); + if (!SWIG_IsOK(ecode8)) { + SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "new_ImportSettings1D" "', argument " "8"" of type '" "QUnit""'"); + } + arg8 = static_cast< QUnit >(val8); + ecode9 = SWIG_AsVal_bool(swig_obj[8], &val9); + if (!SWIG_IsOK(ecode9)) { + SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "new_ImportSettings1D" "', argument " "9"" of type '" "bool""'"); + } + arg9 = static_cast< bool >(val9); + ecode10 = SWIG_AsVal_bool(swig_obj[9], &val10); + if (!SWIG_IsOK(ecode10)) { + SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "new_ImportSettings1D" "', argument " "10"" of type '" "bool""'"); + } + arg10 = static_cast< bool >(val10); + { + try { + result = (ImportSettings1D *)new ImportSettings1D(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10); + } catch (const std::exception& ex) { + // message shown in the Python interpreter + const std::string msg { + "BornAgain C++ Exception: " + std::string(ex.what()) + }; + SWIG_exception(SWIG_RuntimeError, msg.c_str()); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ImportSettings1D, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_ImportSettings1D__SWIG_2(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::string arg1 ; + std::string arg2 ; + size_t arg3 ; + size_t arg4 ; + size_t arg5 ; + size_t arg6 ; + size_t arg7 ; + QUnit arg8 ; + bool arg9 ; + size_t val3 ; + int ecode3 = 0 ; + size_t val4 ; + int ecode4 = 0 ; + size_t val5 ; + int ecode5 = 0 ; + size_t val6 ; + int ecode6 = 0 ; + size_t val7 ; + int ecode7 = 0 ; + int val8 ; + int ecode8 = 0 ; + bool val9 ; + int ecode9 = 0 ; + ImportSettings1D *result = 0 ; + + if ((nobjs < 9) || (nobjs > 9)) SWIG_fail; + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[0], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ImportSettings1D" "', argument " "1"" of type '" "std::string""'"); + } + arg1 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[1], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ImportSettings1D" "', argument " "2"" of type '" "std::string""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ImportSettings1D" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_ImportSettings1D" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = static_cast< size_t >(val4); + ecode5 = SWIG_AsVal_size_t(swig_obj[4], &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_ImportSettings1D" "', argument " "5"" of type '" "size_t""'"); + } + arg5 = static_cast< size_t >(val5); + ecode6 = SWIG_AsVal_size_t(swig_obj[5], &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_ImportSettings1D" "', argument " "6"" of type '" "size_t""'"); + } + arg6 = static_cast< size_t >(val6); + ecode7 = SWIG_AsVal_size_t(swig_obj[6], &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "new_ImportSettings1D" "', argument " "7"" of type '" "size_t""'"); + } + arg7 = static_cast< size_t >(val7); + ecode8 = SWIG_AsVal_int(swig_obj[7], &val8); + if (!SWIG_IsOK(ecode8)) { + SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "new_ImportSettings1D" "', argument " "8"" of type '" "QUnit""'"); + } + arg8 = static_cast< QUnit >(val8); + ecode9 = SWIG_AsVal_bool(swig_obj[8], &val9); + if (!SWIG_IsOK(ecode9)) { + SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "new_ImportSettings1D" "', argument " "9"" of type '" "bool""'"); + } + arg9 = static_cast< bool >(val9); + { + try { + result = (ImportSettings1D *)new ImportSettings1D(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + } catch (const std::exception& ex) { + // message shown in the Python interpreter + const std::string msg { + "BornAgain C++ Exception: " + std::string(ex.what()) + }; + SWIG_exception(SWIG_RuntimeError, msg.c_str()); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ImportSettings1D, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_ImportSettings1D__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::string arg1 ; + std::string arg2 ; + size_t arg3 ; + size_t arg4 ; + size_t arg5 ; + size_t arg6 ; + size_t arg7 ; + QUnit arg8 ; + size_t val3 ; + int ecode3 = 0 ; + size_t val4 ; + int ecode4 = 0 ; + size_t val5 ; + int ecode5 = 0 ; + size_t val6 ; + int ecode6 = 0 ; + size_t val7 ; + int ecode7 = 0 ; + int val8 ; + int ecode8 = 0 ; + ImportSettings1D *result = 0 ; + + if ((nobjs < 8) || (nobjs > 8)) SWIG_fail; + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[0], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ImportSettings1D" "', argument " "1"" of type '" "std::string""'"); + } + arg1 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[1], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ImportSettings1D" "', argument " "2"" of type '" "std::string""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ImportSettings1D" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_ImportSettings1D" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = static_cast< size_t >(val4); + ecode5 = SWIG_AsVal_size_t(swig_obj[4], &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_ImportSettings1D" "', argument " "5"" of type '" "size_t""'"); + } + arg5 = static_cast< size_t >(val5); + ecode6 = SWIG_AsVal_size_t(swig_obj[5], &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_ImportSettings1D" "', argument " "6"" of type '" "size_t""'"); + } + arg6 = static_cast< size_t >(val6); + ecode7 = SWIG_AsVal_size_t(swig_obj[6], &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "new_ImportSettings1D" "', argument " "7"" of type '" "size_t""'"); + } + arg7 = static_cast< size_t >(val7); + ecode8 = SWIG_AsVal_int(swig_obj[7], &val8); + if (!SWIG_IsOK(ecode8)) { + SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "new_ImportSettings1D" "', argument " "8"" of type '" "QUnit""'"); + } + arg8 = static_cast< QUnit >(val8); + { + try { + result = (ImportSettings1D *)new ImportSettings1D(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8); + } catch (const std::exception& ex) { + // message shown in the Python interpreter + const std::string msg { + "BornAgain C++ Exception: " + std::string(ex.what()) + }; + SWIG_exception(SWIG_RuntimeError, msg.c_str()); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ImportSettings1D, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_ImportSettings1D__SWIG_4(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::string arg1 ; + std::string arg2 ; + size_t arg3 ; + size_t arg4 ; + size_t arg5 ; + size_t arg6 ; + size_t arg7 ; + size_t val3 ; + int ecode3 = 0 ; + size_t val4 ; + int ecode4 = 0 ; + size_t val5 ; + int ecode5 = 0 ; + size_t val6 ; + int ecode6 = 0 ; + size_t val7 ; + int ecode7 = 0 ; + ImportSettings1D *result = 0 ; + + if ((nobjs < 7) || (nobjs > 7)) SWIG_fail; + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[0], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ImportSettings1D" "', argument " "1"" of type '" "std::string""'"); + } + arg1 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[1], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ImportSettings1D" "', argument " "2"" of type '" "std::string""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ImportSettings1D" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_ImportSettings1D" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = static_cast< size_t >(val4); + ecode5 = SWIG_AsVal_size_t(swig_obj[4], &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_ImportSettings1D" "', argument " "5"" of type '" "size_t""'"); + } + arg5 = static_cast< size_t >(val5); + ecode6 = SWIG_AsVal_size_t(swig_obj[5], &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_ImportSettings1D" "', argument " "6"" of type '" "size_t""'"); + } + arg6 = static_cast< size_t >(val6); + ecode7 = SWIG_AsVal_size_t(swig_obj[6], &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "new_ImportSettings1D" "', argument " "7"" of type '" "size_t""'"); + } + arg7 = static_cast< size_t >(val7); + { + try { + result = (ImportSettings1D *)new ImportSettings1D(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + } catch (const std::exception& ex) { + // message shown in the Python interpreter + const std::string msg { + "BornAgain C++ Exception: " + std::string(ex.what()) + }; + SWIG_exception(SWIG_RuntimeError, msg.c_str()); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ImportSettings1D, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_ImportSettings1D__SWIG_5(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::string arg1 ; + std::string arg2 ; + size_t arg3 ; + size_t arg4 ; + size_t arg5 ; + size_t arg6 ; + size_t val3 ; + int ecode3 = 0 ; + size_t val4 ; + int ecode4 = 0 ; + size_t val5 ; + int ecode5 = 0 ; + size_t val6 ; + int ecode6 = 0 ; + ImportSettings1D *result = 0 ; + + if ((nobjs < 6) || (nobjs > 6)) SWIG_fail; + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[0], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ImportSettings1D" "', argument " "1"" of type '" "std::string""'"); + } + arg1 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[1], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ImportSettings1D" "', argument " "2"" of type '" "std::string""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ImportSettings1D" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_ImportSettings1D" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = static_cast< size_t >(val4); + ecode5 = SWIG_AsVal_size_t(swig_obj[4], &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_ImportSettings1D" "', argument " "5"" of type '" "size_t""'"); + } + arg5 = static_cast< size_t >(val5); + ecode6 = SWIG_AsVal_size_t(swig_obj[5], &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "new_ImportSettings1D" "', argument " "6"" of type '" "size_t""'"); + } + arg6 = static_cast< size_t >(val6); + { + try { + result = (ImportSettings1D *)new ImportSettings1D(arg1,arg2,arg3,arg4,arg5,arg6); + } catch (const std::exception& ex) { + // message shown in the Python interpreter + const std::string msg { + "BornAgain C++ Exception: " + std::string(ex.what()) + }; + SWIG_exception(SWIG_RuntimeError, msg.c_str()); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ImportSettings1D, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_ImportSettings1D__SWIG_6(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::string arg1 ; + std::string arg2 ; + size_t arg3 ; + size_t arg4 ; + size_t arg5 ; + size_t val3 ; + int ecode3 = 0 ; + size_t val4 ; + int ecode4 = 0 ; + size_t val5 ; + int ecode5 = 0 ; + ImportSettings1D *result = 0 ; + + if ((nobjs < 5) || (nobjs > 5)) SWIG_fail; + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[0], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ImportSettings1D" "', argument " "1"" of type '" "std::string""'"); + } + arg1 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[1], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ImportSettings1D" "', argument " "2"" of type '" "std::string""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ImportSettings1D" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_ImportSettings1D" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = static_cast< size_t >(val4); + ecode5 = SWIG_AsVal_size_t(swig_obj[4], &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "new_ImportSettings1D" "', argument " "5"" of type '" "size_t""'"); + } + arg5 = static_cast< size_t >(val5); + { + try { + result = (ImportSettings1D *)new ImportSettings1D(arg1,arg2,arg3,arg4,arg5); + } catch (const std::exception& ex) { + // message shown in the Python interpreter + const std::string msg { + "BornAgain C++ Exception: " + std::string(ex.what()) + }; + SWIG_exception(SWIG_RuntimeError, msg.c_str()); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ImportSettings1D, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_ImportSettings1D__SWIG_7(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + std::string arg1 ; + std::string arg2 ; + size_t arg3 ; + size_t arg4 ; + size_t val3 ; + int ecode3 = 0 ; + size_t val4 ; + int ecode4 = 0 ; + ImportSettings1D *result = 0 ; + + if ((nobjs < 4) || (nobjs > 4)) SWIG_fail; + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[0], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ImportSettings1D" "', argument " "1"" of type '" "std::string""'"); + } + arg1 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::string *ptr = (std::string *)0; + int res = SWIG_AsPtr_std_string(swig_obj[1], &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "new_ImportSettings1D" "', argument " "2"" of type '" "std::string""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + ecode3 = SWIG_AsVal_size_t(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_ImportSettings1D" "', argument " "3"" of type '" "size_t""'"); + } + arg3 = static_cast< size_t >(val3); + ecode4 = SWIG_AsVal_size_t(swig_obj[3], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_ImportSettings1D" "', argument " "4"" of type '" "size_t""'"); + } + arg4 = static_cast< size_t >(val4); + { + try { + result = (ImportSettings1D *)new ImportSettings1D(arg1,arg2,arg3,arg4); + } catch (const std::exception& ex) { + // message shown in the Python interpreter + const std::string msg { + "BornAgain C++ Exception: " + std::string(ex.what()) + }; + SWIG_exception(SWIG_RuntimeError, msg.c_str()); + } + } + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ImportSettings1D, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_ImportSettings1D(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[12] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "new_ImportSettings1D", 0, 11, argv))) SWIG_fail; + --argc; + if (argc == 4) { + int _v = 0; + int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_ImportSettings1D__SWIG_7(self, argc, argv); + } + } + } + } + } + if (argc == 5) { + int _v = 0; + int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[4], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_ImportSettings1D__SWIG_6(self, argc, argv); + } + } + } + } + } + } + if (argc == 6) { + int _v = 0; + int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[4], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[5], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_ImportSettings1D__SWIG_5(self, argc, argv); + } + } + } + } + } + } + } + if (argc == 7) { + int _v = 0; + int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[4], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[5], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[6], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_ImportSettings1D__SWIG_4(self, argc, argv); + } + } + } + } + } + } + } + } + if (argc == 8) { + int _v = 0; + int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[4], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[5], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[6], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[7], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_ImportSettings1D__SWIG_3(self, argc, argv); + } + } + } + } + } + } + } + } + } + if (argc == 9) { + int _v = 0; + int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[4], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[5], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[6], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[7], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_bool(argv[8], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_ImportSettings1D__SWIG_2(self, argc, argv); + } + } + } + } + } + } + } + } + } + } + if (argc == 10) { + int _v = 0; + int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[4], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[5], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[6], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[7], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_bool(argv[8], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_bool(argv[9], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_ImportSettings1D__SWIG_1(self, argc, argv); + } + } + } + } + } + } + } + } + } + } + } + if (argc == 11) { + int _v = 0; + int res = SWIG_AsPtr_std_string(argv[0], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[4], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[5], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[6], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[7], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_bool(argv[8], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_bool(argv[9], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_bool(argv[10], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_ImportSettings1D__SWIG_0(self, argc, argv); + } + } + } + } + } + } + } + } + } + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'new_ImportSettings1D'.\n" + " Possible C/C++ prototypes are:\n" + " ImportSettings1D::ImportSettings1D(std::string,std::string,size_t,size_t,size_t,size_t,size_t,QUnit,bool,bool,bool)\n" + " ImportSettings1D::ImportSettings1D(std::string,std::string,size_t,size_t,size_t,size_t,size_t,QUnit,bool,bool)\n" + " ImportSettings1D::ImportSettings1D(std::string,std::string,size_t,size_t,size_t,size_t,size_t,QUnit,bool)\n" + " ImportSettings1D::ImportSettings1D(std::string,std::string,size_t,size_t,size_t,size_t,size_t,QUnit)\n" + " ImportSettings1D::ImportSettings1D(std::string,std::string,size_t,size_t,size_t,size_t,size_t)\n" + " ImportSettings1D::ImportSettings1D(std::string,std::string,size_t,size_t,size_t,size_t)\n" + " ImportSettings1D::ImportSettings1D(std::string,std::string,size_t,size_t,size_t)\n" + " ImportSettings1D::ImportSettings1D(std::string,std::string,size_t,size_t)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_headerPrefix_set(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + std::string *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 = SWIG_OLDOBJ ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "ImportSettings1D_headerPrefix_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_headerPrefix_set" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + { + std::string *ptr = (std::string *)0; + res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ImportSettings1D_headerPrefix_set" "', argument " "2"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ImportSettings1D_headerPrefix_set" "', argument " "2"" of type '" "std::string const &""'"); + } + arg2 = ptr; + } + if (arg1) (arg1)->headerPrefix = *arg2; + resultobj = SWIG_Py_Void(); + if (SWIG_IsNewObj(res2)) delete arg2; + return resultobj; +fail: + if (SWIG_IsNewObj(res2)) delete arg2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_headerPrefix_get(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + std::string *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_headerPrefix_get" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + result = (std::string *) & ((arg1)->headerPrefix); + resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_linesToSkip_set(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + std::string *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 = SWIG_OLDOBJ ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "ImportSettings1D_linesToSkip_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_linesToSkip_set" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + { + std::string *ptr = (std::string *)0; + res2 = SWIG_AsPtr_std_string(swig_obj[1], &ptr); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ImportSettings1D_linesToSkip_set" "', argument " "2"" of type '" "std::string const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ImportSettings1D_linesToSkip_set" "', argument " "2"" of type '" "std::string const &""'"); + } + arg2 = ptr; + } + if (arg1) (arg1)->linesToSkip = *arg2; + resultobj = SWIG_Py_Void(); + if (SWIG_IsNewObj(res2)) delete arg2; + return resultobj; +fail: + if (SWIG_IsNewObj(res2)) delete arg2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_linesToSkip_get(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + std::string *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_linesToSkip_get" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + result = (std::string *) & ((arg1)->linesToSkip); + resultobj = SWIG_From_std_string(static_cast< std::string >(*result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_col_Q_set(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "ImportSettings1D_col_Q_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_col_Q_set" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ImportSettings1D_col_Q_set" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = static_cast< size_t >(val2); + if (arg1) (arg1)->col_Q = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_col_Q_get(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + size_t result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_col_Q_get" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + result = ((arg1)->col_Q); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_col_R_set(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "ImportSettings1D_col_R_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_col_R_set" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ImportSettings1D_col_R_set" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = static_cast< size_t >(val2); + if (arg1) (arg1)->col_R = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_col_R_get(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + size_t result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_col_R_get" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + result = ((arg1)->col_R); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_col_sR_set(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "ImportSettings1D_col_sR_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_col_sR_set" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ImportSettings1D_col_sR_set" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = static_cast< size_t >(val2); + if (arg1) (arg1)->col_sR = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_col_sR_get(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + size_t result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_col_sR_get" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + result = ((arg1)->col_sR); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_col_dQ_set(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "ImportSettings1D_col_dQ_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_col_dQ_set" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ImportSettings1D_col_dQ_set" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = static_cast< size_t >(val2); + if (arg1) (arg1)->col_dQ = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_col_dQ_get(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + size_t result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_col_dQ_get" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + result = ((arg1)->col_dQ); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_col_lambda_set(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "ImportSettings1D_col_lambda_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_col_lambda_set" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ImportSettings1D_col_lambda_set" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = static_cast< size_t >(val2); + if (arg1) (arg1)->col_lambda = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_col_lambda_get(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + size_t result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_col_lambda_get" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + result = ((arg1)->col_lambda); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_qUnit_set(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + QUnit arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "ImportSettings1D_qUnit_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_qUnit_set" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ImportSettings1D_qUnit_set" "', argument " "2"" of type '" "QUnit""'"); + } + arg2 = static_cast< QUnit >(val2); + if (arg1) (arg1)->qUnit = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_qUnit_get(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + QUnit result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_qUnit_get" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + result = (QUnit) ((arg1)->qUnit); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_sort_set(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + bool arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "ImportSettings1D_sort_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_sort_set" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ImportSettings1D_sort_set" "', argument " "2"" of type '" "bool""'"); + } + arg2 = static_cast< bool >(val2); + if (arg1) (arg1)->sort = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_sort_get(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + bool result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_sort_get" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + result = (bool) ((arg1)->sort); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_rm_negative_set(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + bool arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "ImportSettings1D_rm_negative_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_rm_negative_set" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ImportSettings1D_rm_negative_set" "', argument " "2"" of type '" "bool""'"); + } + arg2 = static_cast< bool >(val2); + if (arg1) (arg1)->rm_negative = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_rm_negative_get(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + bool result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_rm_negative_get" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + result = (bool) ((arg1)->rm_negative); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_rm_duplications_set(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + bool arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "ImportSettings1D_rm_duplications_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_rm_duplications_set" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + ecode2 = SWIG_AsVal_bool(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ImportSettings1D_rm_duplications_set" "', argument " "2"" of type '" "bool""'"); + } + arg2 = static_cast< bool >(val2); + if (arg1) (arg1)->rm_duplications = arg2; + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_ImportSettings1D_rm_duplications_get(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + bool result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ImportSettings1D_rm_duplications_get" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + result = (bool) ((arg1)->rm_duplications); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_ImportSettings1D(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + ImportSettings1D *arg1 = (ImportSettings1D *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ImportSettings1D, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ImportSettings1D" "', argument " "1"" of type '" "ImportSettings1D *""'"); + } + arg1 = reinterpret_cast< ImportSettings1D * >(argp1); + { + try { + delete arg1; + } catch (const std::exception& ex) { + // message shown in the Python interpreter + const std::string msg { + "BornAgain C++ Exception: " + std::string(ex.what()) + }; + SWIG_exception(SWIG_RuntimeError, msg.c_str()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *ImportSettings1D_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_ImportSettings1D, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *ImportSettings1D_swiginit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + return SWIG_Python_InitShadowInstance(args); +} + SWIGINTERN PyObject *_wrap_readData1D__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; std::string *arg1 = 0 ; @@ -40959,6 +42743,7 @@ static PyMethodDef SwigMethods[] = { "Datafield_yProjection(Datafield self, double xvalue) -> Datafield\n" "Datafield_yProjection(Datafield self, double xlow, double xup) -> Datafield\n" ""}, + { "Datafield_setAllTo", _wrap_Datafield_setAllTo, METH_VARARGS, "Datafield_setAllTo(Datafield self, double const & value)"}, { "Datafield_swigregister", Datafield_swigregister, METH_O, NULL}, { "Datafield_swiginit", Datafield_swiginit, METH_VARARGS, NULL}, { "new_Beam", _wrap_new_Beam, METH_VARARGS, "Beam(double intensity, double wavelength, double alpha, double phi=0)"}, @@ -41132,6 +42917,7 @@ static PyMethodDef SwigMethods[] = { { "IDetector_maskAll", _wrap_IDetector_maskAll, METH_O, "IDetector_maskAll(IDetector self)"}, { "IDetector_axis", _wrap_IDetector_axis, METH_VARARGS, "IDetector_axis(IDetector self, size_t i) -> Scale"}, { "IDetector_setRegionOfInterest", _wrap_IDetector_setRegionOfInterest, METH_VARARGS, "IDetector_setRegionOfInterest(IDetector self, double xlow, double ylow, double xup, double yup)"}, + { "IDetector_clippedFrame", _wrap_IDetector_clippedFrame, METH_O, "IDetector_clippedFrame(IDetector self) -> Frame"}, { "IDetector_swigregister", IDetector_swigregister, METH_O, NULL}, { "new_FlatDetector", _wrap_new_FlatDetector, METH_VARARGS, "\n" "FlatDetector(size_t nxbins, size_t nybins, double width, double height, Beam beam, FlatDetector::NominalNormal nominalNormal, double distance, double offcenter_w=0, double offcenter_h=0, double pitch=0, double yaw=0, double roll=0)\n" @@ -41188,8 +42974,34 @@ static PyMethodDef SwigMethods[] = { { "relativeDifferenceField", _wrap_relativeDifferenceField, METH_VARARGS, "relativeDifferenceField(Datafield dat, Datafield ref) -> Datafield"}, { "meanRelativeDifference", _wrap_meanRelativeDifference, METH_VARARGS, "meanRelativeDifference(Datafield dat, Datafield ref) -> double"}, { "checkRelativeDifference", _wrap_checkRelativeDifference, METH_VARARGS, "checkRelativeDifference(vdouble1d_t dat, vdouble1d_t ref, double threshold) -> bool"}, + { "new_ImportSettings1D", _wrap_new_ImportSettings1D, METH_VARARGS, "ImportSettings1D(std::string _prefix, std::string _skip, size_t __Q, size_t __R, size_t __sR=0, size_t __dQ=0, size_t __lambda=0, QUnit _unit=over_nm, bool _sort=True, bool _rm_neg=True, bool _rm_dup=True)"}, + { "ImportSettings1D_headerPrefix_set", _wrap_ImportSettings1D_headerPrefix_set, METH_VARARGS, "ImportSettings1D_headerPrefix_set(ImportSettings1D self, std::string const & headerPrefix)"}, + { "ImportSettings1D_headerPrefix_get", _wrap_ImportSettings1D_headerPrefix_get, METH_O, "ImportSettings1D_headerPrefix_get(ImportSettings1D self) -> std::string const &"}, + { "ImportSettings1D_linesToSkip_set", _wrap_ImportSettings1D_linesToSkip_set, METH_VARARGS, "ImportSettings1D_linesToSkip_set(ImportSettings1D self, std::string const & linesToSkip)"}, + { "ImportSettings1D_linesToSkip_get", _wrap_ImportSettings1D_linesToSkip_get, METH_O, "ImportSettings1D_linesToSkip_get(ImportSettings1D self) -> std::string const &"}, + { "ImportSettings1D_col_Q_set", _wrap_ImportSettings1D_col_Q_set, METH_VARARGS, "ImportSettings1D_col_Q_set(ImportSettings1D self, size_t col_Q)"}, + { "ImportSettings1D_col_Q_get", _wrap_ImportSettings1D_col_Q_get, METH_O, "ImportSettings1D_col_Q_get(ImportSettings1D self) -> size_t"}, + { "ImportSettings1D_col_R_set", _wrap_ImportSettings1D_col_R_set, METH_VARARGS, "ImportSettings1D_col_R_set(ImportSettings1D self, size_t col_R)"}, + { "ImportSettings1D_col_R_get", _wrap_ImportSettings1D_col_R_get, METH_O, "ImportSettings1D_col_R_get(ImportSettings1D self) -> size_t"}, + { "ImportSettings1D_col_sR_set", _wrap_ImportSettings1D_col_sR_set, METH_VARARGS, "ImportSettings1D_col_sR_set(ImportSettings1D self, size_t col_sR)"}, + { "ImportSettings1D_col_sR_get", _wrap_ImportSettings1D_col_sR_get, METH_O, "ImportSettings1D_col_sR_get(ImportSettings1D self) -> size_t"}, + { "ImportSettings1D_col_dQ_set", _wrap_ImportSettings1D_col_dQ_set, METH_VARARGS, "ImportSettings1D_col_dQ_set(ImportSettings1D self, size_t col_dQ)"}, + { "ImportSettings1D_col_dQ_get", _wrap_ImportSettings1D_col_dQ_get, METH_O, "ImportSettings1D_col_dQ_get(ImportSettings1D self) -> size_t"}, + { "ImportSettings1D_col_lambda_set", _wrap_ImportSettings1D_col_lambda_set, METH_VARARGS, "ImportSettings1D_col_lambda_set(ImportSettings1D self, size_t col_lambda)"}, + { "ImportSettings1D_col_lambda_get", _wrap_ImportSettings1D_col_lambda_get, METH_O, "ImportSettings1D_col_lambda_get(ImportSettings1D self) -> size_t"}, + { "ImportSettings1D_qUnit_set", _wrap_ImportSettings1D_qUnit_set, METH_VARARGS, "ImportSettings1D_qUnit_set(ImportSettings1D self, QUnit qUnit)"}, + { "ImportSettings1D_qUnit_get", _wrap_ImportSettings1D_qUnit_get, METH_O, "ImportSettings1D_qUnit_get(ImportSettings1D self) -> QUnit"}, + { "ImportSettings1D_sort_set", _wrap_ImportSettings1D_sort_set, METH_VARARGS, "ImportSettings1D_sort_set(ImportSettings1D self, bool sort)"}, + { "ImportSettings1D_sort_get", _wrap_ImportSettings1D_sort_get, METH_O, "ImportSettings1D_sort_get(ImportSettings1D self) -> bool"}, + { "ImportSettings1D_rm_negative_set", _wrap_ImportSettings1D_rm_negative_set, METH_VARARGS, "ImportSettings1D_rm_negative_set(ImportSettings1D self, bool rm_negative)"}, + { "ImportSettings1D_rm_negative_get", _wrap_ImportSettings1D_rm_negative_get, METH_O, "ImportSettings1D_rm_negative_get(ImportSettings1D self) -> bool"}, + { "ImportSettings1D_rm_duplications_set", _wrap_ImportSettings1D_rm_duplications_set, METH_VARARGS, "ImportSettings1D_rm_duplications_set(ImportSettings1D self, bool rm_duplications)"}, + { "ImportSettings1D_rm_duplications_get", _wrap_ImportSettings1D_rm_duplications_get, METH_O, "ImportSettings1D_rm_duplications_get(ImportSettings1D self) -> bool"}, + { "delete_ImportSettings1D", _wrap_delete_ImportSettings1D, METH_O, "delete_ImportSettings1D(ImportSettings1D self)"}, + { "ImportSettings1D_swigregister", ImportSettings1D_swigregister, METH_O, NULL}, + { "ImportSettings1D_swiginit", ImportSettings1D_swiginit, METH_VARARGS, NULL}, { "readData1D", _wrap_readData1D, METH_VARARGS, "\n" - "readData1D(std::string const & fname, IO::Filetype1D ftype, ImportSettings1D const * importSettings=None) -> Datafield\n" + "readData1D(std::string const & fname, IO::Filetype1D ftype, ImportSettings1D importSettings=None) -> Datafield\n" "readData1D(std::string const & fname) -> Datafield\n" ""}, { "readData2D", _wrap_readData2D, METH_VARARGS, "\n" @@ -42154,6 +43966,8 @@ SWIG_init(void) { SWIG_Python_SetConstant(d, "FlatDetector_X",SWIG_From_int(static_cast< int >(FlatDetector::X))); SWIG_Python_SetConstant(d, "FlatDetector_T",SWIG_From_int(static_cast< int >(FlatDetector::T))); SWIG_Python_SetConstant(d, "FlatDetector_R",SWIG_From_int(static_cast< int >(FlatDetector::R))); + SWIG_Python_SetConstant(d, "over_nm",SWIG_From_int(static_cast< int >(over_nm))); + SWIG_Python_SetConstant(d, "over_angstrom",SWIG_From_int(static_cast< int >(over_angstrom))); SWIG_Python_SetConstant(d, "unknown1D",SWIG_From_int(static_cast< int >(IO::unknown1D))); SWIG_Python_SetConstant(d, "csv1D",SWIG_From_int(static_cast< int >(IO::csv1D))); SWIG_Python_SetConstant(d, "bornagain1D",SWIG_From_int(static_cast< int >(IO::bornagain1D))); diff --git a/auto/Wrap/libBornAgainSim.py b/auto/Wrap/libBornAgainSim.py index 362d2f641d680809c21cb8e35930e66a0317014d..de2be706a50b0c0128456a2d4906acc43f0dc2bb 100644 --- a/auto/Wrap/libBornAgainSim.py +++ b/auto/Wrap/libBornAgainSim.py @@ -2344,6 +2344,10 @@ class FitObjective(object): """ return _libBornAgainSim.FitObjective_addSimulationAndData_cpp(self, *args) + def addFitPair_cpp(self, callback, expData, weight=1.0): + r"""addFitPair_cpp(FitObjective self, PyBuilderCallback callback, Datafield expData, double weight=1.0)""" + return _libBornAgainSim.FitObjective_addFitPair_cpp(self, callback, expData, weight) + def evaluate_cpp(self, params): r"""evaluate_cpp(FitObjective self, mumufit::Parameters const & params) -> double""" return _libBornAgainSim.FitObjective_evaluate_cpp(self, params) @@ -2447,6 +2451,27 @@ class FitObjective(object): self.callback_container.append(wrp) return self.addSimulationAndData_cpp(wrp, data, *args, **kwargs) + def addFitPair(self, callback, expData, *args): + """ + Sets simulation and experimental data to the fit objective. + Optionally accepts experimental data uncertainties and + user-defined dataset weight. + + Arguments: + + callback -- user-defined function returning fully-defined bornagain.ISimulation object. + The function must use fit parameter dictionary as its input. + + expData -- Datafield containing experimental data. + + weight -- user-defined weight of the dataset. If not specified, defaults to 1.0. + """ + if not hasattr(self, 'callback_container'): + self.callback_container = [] + wrp = SimulationBuilderWrapper(callback) + self.callback_container.append(wrp) # needed ??? + return self.addFitPair_cpp(wrp, expData, *args) + def convert_params(self, params): """ Converts parameters to what FitObjective::evaluate expects diff --git a/auto/Wrap/libBornAgainSim_wrap.cpp b/auto/Wrap/libBornAgainSim_wrap.cpp index 9b24701c98c2578ea2d2fc75afe8561a62b02a22..8a354da36c7850c8e26798eddb04c2b066f7f7a4 100644 --- a/auto/Wrap/libBornAgainSim_wrap.cpp +++ b/auto/Wrap/libBornAgainSim_wrap.cpp @@ -32568,6 +32568,186 @@ fail: } +SWIGINTERN PyObject *_wrap_FitObjective_addFitPair_cpp__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + FitObjective *arg1 = (FitObjective *) 0 ; + PyBuilderCallback *arg2 = 0 ; + SwigValueWrapper< Datafield > arg3 ; + double arg4 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 ; + int res3 = 0 ; + double val4 ; + int ecode4 = 0 ; + + if ((nobjs < 4) || (nobjs > 4)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_FitObjective, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FitObjective_addFitPair_cpp" "', argument " "1"" of type '" "FitObjective *""'"); + } + arg1 = reinterpret_cast< FitObjective * >(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_PyBuilderCallback, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FitObjective_addFitPair_cpp" "', argument " "2"" of type '" "PyBuilderCallback const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "FitObjective_addFitPair_cpp" "', argument " "2"" of type '" "PyBuilderCallback const &""'"); + } + arg2 = reinterpret_cast< PyBuilderCallback * >(argp2); + { + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_Datafield, 0 | 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "FitObjective_addFitPair_cpp" "', argument " "3"" of type '" "Datafield""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "FitObjective_addFitPair_cpp" "', argument " "3"" of type '" "Datafield""'"); + } else { + Datafield * temp = reinterpret_cast< Datafield * >(argp3); + arg3 = *temp; + if (SWIG_IsNewObj(res3)) delete temp; + } + } + ecode4 = SWIG_AsVal_double(swig_obj[3], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "FitObjective_addFitPair_cpp" "', argument " "4"" of type '" "double""'"); + } + arg4 = static_cast< double >(val4); + { + try { + (arg1)->addFitPair((PyBuilderCallback const &)*arg2,arg3,arg4); + } catch (const std::exception& ex) { + // message shown in the Python interpreter + const std::string msg { + "BornAgain C++ Exception: " + std::string(ex.what()) + }; + SWIG_exception(SWIG_RuntimeError, msg.c_str()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_FitObjective_addFitPair_cpp__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + FitObjective *arg1 = (FitObjective *) 0 ; + PyBuilderCallback *arg2 = 0 ; + SwigValueWrapper< Datafield > arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 ; + int res3 = 0 ; + + if ((nobjs < 3) || (nobjs > 3)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_FitObjective, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "FitObjective_addFitPair_cpp" "', argument " "1"" of type '" "FitObjective *""'"); + } + arg1 = reinterpret_cast< FitObjective * >(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_PyBuilderCallback, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "FitObjective_addFitPair_cpp" "', argument " "2"" of type '" "PyBuilderCallback const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "FitObjective_addFitPair_cpp" "', argument " "2"" of type '" "PyBuilderCallback const &""'"); + } + arg2 = reinterpret_cast< PyBuilderCallback * >(argp2); + { + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3, SWIGTYPE_p_Datafield, 0 | 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "FitObjective_addFitPair_cpp" "', argument " "3"" of type '" "Datafield""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "FitObjective_addFitPair_cpp" "', argument " "3"" of type '" "Datafield""'"); + } else { + Datafield * temp = reinterpret_cast< Datafield * >(argp3); + arg3 = *temp; + if (SWIG_IsNewObj(res3)) delete temp; + } + } + { + try { + (arg1)->addFitPair((PyBuilderCallback const &)*arg2,arg3); + } catch (const std::exception& ex) { + // message shown in the Python interpreter + const std::string msg { + "BornAgain C++ Exception: " + std::string(ex.what()) + }; + SWIG_exception(SWIG_RuntimeError, msg.c_str()); + } + } + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_FitObjective_addFitPair_cpp(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[5] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "FitObjective_addFitPair_cpp", 0, 4, argv))) SWIG_fail; + --argc; + if (argc == 3) { + int _v = 0; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FitObjective, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_PyBuilderCallback, SWIG_POINTER_NO_NULL | 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_Datafield, SWIG_POINTER_NO_NULL | 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_FitObjective_addFitPair_cpp__SWIG_1(self, argc, argv); + } + } + } + } + if (argc == 4) { + int _v = 0; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_FitObjective, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_PyBuilderCallback, SWIG_POINTER_NO_NULL | 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_Datafield, SWIG_POINTER_NO_NULL | 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_double(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_FitObjective_addFitPair_cpp__SWIG_0(self, argc, argv); + } + } + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'FitObjective_addFitPair_cpp'.\n" + " Possible C/C++ prototypes are:\n" + " FitObjective::addFitPair(PyBuilderCallback const &,Datafield,double)\n" + " FitObjective::addFitPair(PyBuilderCallback const &,Datafield)\n"); + return 0; +} + + SWIGINTERN PyObject *_wrap_FitObjective_evaluate_cpp(PyObject *self, PyObject *args) { PyObject *resultobj = 0; FitObjective *arg1 = (FitObjective *) 0 ; @@ -39805,6 +39985,7 @@ static PyMethodDef SwigMethods[] = { "FitObjective_addSimulationAndData_cpp(FitObjective self, PyBuilderCallback callback, vdouble2d_t data, vdouble2d_t stdv, double weight=1.0)\n" "FitObjective_addSimulationAndData_cpp(FitObjective self, PyBuilderCallback callback, vdouble1d_t data, vdouble1d_t stdv, double weight=1.0)\n" ""}, + { "FitObjective_addFitPair_cpp", _wrap_FitObjective_addFitPair_cpp, METH_VARARGS, "FitObjective_addFitPair_cpp(FitObjective self, PyBuilderCallback callback, Datafield expData, double weight=1.0)"}, { "FitObjective_evaluate_cpp", _wrap_FitObjective_evaluate_cpp, METH_VARARGS, "FitObjective_evaluate_cpp(FitObjective self, mumufit::Parameters const & params) -> double"}, { "FitObjective_evaluate_residuals_cpp", _wrap_FitObjective_evaluate_residuals_cpp, METH_VARARGS, "FitObjective_evaluate_residuals_cpp(FitObjective self, mumufit::Parameters const & params) -> vdouble1d_t"}, { "FitObjective_simulationResult", _wrap_FitObjective_simulationResult, METH_VARARGS, "FitObjective_simulationResult(FitObjective self, size_t i_item=0) -> Datafield"},