From ecb26d2f52219cf361ebc8552a013a775b27008d Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Fri, 16 Feb 2024 14:05:18 +0100 Subject: [PATCH] rm obsolete BeamScan::setAnalyzer(3 args) --- Sim/Scan/BeamScan.cpp | 10 --- Sim/Scan/BeamScan.h | 1 - auto/Wrap/libBornAgainSim.py | 5 +- auto/Wrap/libBornAgainSim_wrap.cpp | 100 ++--------------------------- 4 files changed, 5 insertions(+), 111 deletions(-) diff --git a/Sim/Scan/BeamScan.cpp b/Sim/Scan/BeamScan.cpp index 1305c4384cb..d6a75a95cf0 100644 --- a/Sim/Scan/BeamScan.cpp +++ b/Sim/Scan/BeamScan.cpp @@ -21,7 +21,6 @@ #include "Device/Beam/IFootprint.h" #include "Device/Pol/PolFilter.h" #include "Resample/Slice/KzComputation.h" -#include <iostream> BeamScan::BeamScan(Scale* axis) : m_axis(axis) @@ -50,15 +49,6 @@ void BeamScan::setAnalyzer(R3 Bloch_vector, double mean_transmission) m_pol_analyzer = std::make_unique<PolFilter>(Bloch_vector, mean_transmission); } -void BeamScan::setAnalyzer(R3 direction, double efficiency, double mean_transmission) -{ - std::cout - << "Function setAnalyzer(direction, efficiency, transmission) is obsolete since " - "BornAgain v21,\n" - "and will eventually be removed. Use setAnalyzer(Bloch_vector, transmission) instead.\n"; - setAnalyzer(direction * efficiency, mean_transmission); -} - size_t BeamScan::nScan() const { return m_axis->size(); diff --git a/Sim/Scan/BeamScan.h b/Sim/Scan/BeamScan.h index f2b122321fe..2a5cc1b72f2 100644 --- a/Sim/Scan/BeamScan.h +++ b/Sim/Scan/BeamScan.h @@ -56,7 +56,6 @@ public: //! Sets the polarization analyzer characteristics of the detector void setAnalyzer(R3 Bloch_vector = {}, double mean_transmission = 0.5); - void setAnalyzer(R3 direction, double efficiency, double transmission); // OBSOLETE since v21 #ifndef SWIG double intensity() const; diff --git a/auto/Wrap/libBornAgainSim.py b/auto/Wrap/libBornAgainSim.py index 8cb94dd9ec1..4008a1499d9 100644 --- a/auto/Wrap/libBornAgainSim.py +++ b/auto/Wrap/libBornAgainSim.py @@ -2532,10 +2532,7 @@ class BeamScan(libBornAgainBase.ICloneable, libBornAgainParam.INode): return _libBornAgainSim.BeamScan_setFootprintAt(self, i, footprint) def setAnalyzer(self, *args): - r""" - setAnalyzer(BeamScan self, R3 Bloch_vector={}, double mean_transmission=0.5) - setAnalyzer(BeamScan self, R3 direction, double efficiency, double transmission) - """ + r"""setAnalyzer(BeamScan self, R3 Bloch_vector={}, double mean_transmission=0.5)""" return _libBornAgainSim.BeamScan_setAnalyzer(self, *args) # Register BeamScan in _libBornAgainSim: diff --git a/auto/Wrap/libBornAgainSim_wrap.cpp b/auto/Wrap/libBornAgainSim_wrap.cpp index 3a72518aeb1..29506b5e1f9 100644 --- a/auto/Wrap/libBornAgainSim_wrap.cpp +++ b/auto/Wrap/libBornAgainSim_wrap.cpp @@ -34397,76 +34397,13 @@ fail: } -SWIGINTERN PyObject *_wrap_BeamScan_setAnalyzer__SWIG_3(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { - PyObject *resultobj = 0; - BeamScan *arg1 = (BeamScan *) 0 ; - R3 arg2 ; - double arg3 ; - double arg4 ; - void *argp1 = 0 ; - int res1 = 0 ; - void *argp2 ; - int res2 = 0 ; - double val3 ; - int ecode3 = 0 ; - double val4 ; - int ecode4 = 0 ; - - (void)self; - if ((nobjs < 4) || (nobjs > 4)) SWIG_fail; - res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BeamScan, 0 | 0 ); - if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BeamScan_setAnalyzer" "', argument " "1"" of type '" "BeamScan *""'"); - } - arg1 = reinterpret_cast< BeamScan * >(argp1); - { - res2 = SWIG_ConvertPtr(swig_obj[1], &argp2, SWIGTYPE_p_Vec3T_double_t, 0 | 0); - if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "BeamScan_setAnalyzer" "', argument " "2"" of type '" "R3""'"); - } - if (!argp2) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "BeamScan_setAnalyzer" "', argument " "2"" of type '" "R3""'"); - } else { - R3 * temp = reinterpret_cast< R3 * >(argp2); - arg2 = *temp; - if (SWIG_IsNewObj(res2)) delete temp; - } - } - ecode3 = SWIG_AsVal_double(swig_obj[2], &val3); - if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "BeamScan_setAnalyzer" "', argument " "3"" of type '" "double""'"); - } - arg3 = static_cast< double >(val3); - ecode4 = SWIG_AsVal_double(swig_obj[3], &val4); - if (!SWIG_IsOK(ecode4)) { - SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "BeamScan_setAnalyzer" "', argument " "4"" of type '" "double""'"); - } - arg4 = static_cast< double >(val4); - { - try { - (arg1)->setAnalyzer(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_BeamScan_setAnalyzer(PyObject *self, PyObject *args) { Py_ssize_t argc; - PyObject *argv[5] = { + PyObject *argv[4] = { 0 }; - if (!(argc = SWIG_Python_UnpackTuple(args, "BeamScan_setAnalyzer", 0, 4, argv))) SWIG_fail; + if (!(argc = SWIG_Python_UnpackTuple(args, "BeamScan_setAnalyzer", 0, 3, argv))) SWIG_fail; --argc; if (argc == 1) { int _v = 0; @@ -34509,39 +34446,13 @@ SWIGINTERN PyObject *_wrap_BeamScan_setAnalyzer(PyObject *self, PyObject *args) } } } - if (argc == 4) { - int _v = 0; - void *vptr = 0; - int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_BeamScan, 0); - _v = SWIG_CheckState(res); - if (_v) { - int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_Vec3T_double_t, SWIG_POINTER_NO_NULL | 0); - _v = SWIG_CheckState(res); - if (_v) { - { - int res = SWIG_AsVal_double(argv[2], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - { - int res = SWIG_AsVal_double(argv[3], NULL); - _v = SWIG_CheckState(res); - } - if (_v) { - return _wrap_BeamScan_setAnalyzer__SWIG_3(self, argc, argv); - } - } - } - } - } fail: SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'BeamScan_setAnalyzer'.\n" " Possible C/C++ prototypes are:\n" " BeamScan::setAnalyzer(R3,double)\n" " BeamScan::setAnalyzer(R3)\n" - " BeamScan::setAnalyzer()\n" - " BeamScan::setAnalyzer(R3,double,double)\n"); + " BeamScan::setAnalyzer()\n"); return 0; } @@ -40070,10 +39981,7 @@ static PyMethodDef SwigMethods[] = { { "BeamScan_setPolarizationAt", _wrap_BeamScan_setPolarizationAt, METH_VARARGS, "BeamScan_setPolarizationAt(BeamScan self, size_t i, R3 bloch_vector)"}, { "BeamScan_setFootprint", _wrap_BeamScan_setFootprint, METH_VARARGS, "BeamScan_setFootprint(BeamScan self, IFootprint const * footprint)"}, { "BeamScan_setFootprintAt", _wrap_BeamScan_setFootprintAt, METH_VARARGS, "BeamScan_setFootprintAt(BeamScan self, size_t i, IFootprint const * footprint)"}, - { "BeamScan_setAnalyzer", _wrap_BeamScan_setAnalyzer, METH_VARARGS, "\n" - "BeamScan_setAnalyzer(BeamScan self, R3 Bloch_vector={}, double mean_transmission=0.5)\n" - "BeamScan_setAnalyzer(BeamScan self, R3 direction, double efficiency, double transmission)\n" - ""}, + { "BeamScan_setAnalyzer", _wrap_BeamScan_setAnalyzer, METH_VARARGS, "BeamScan_setAnalyzer(BeamScan self, R3 Bloch_vector={}, double mean_transmission=0.5)"}, { "BeamScan_swigregister", BeamScan_swigregister, METH_O, NULL}, { "delete_PhysicalScan", _wrap_delete_PhysicalScan, METH_O, "delete_PhysicalScan(PhysicalScan self)"}, { "PhysicalScan_clone", _wrap_PhysicalScan_clone, METH_O, "PhysicalScan_clone(PhysicalScan self) -> PhysicalScan"}, -- GitLab