From 8e356a77ce2625bfdad3554f5b3e04c333bcb5ed Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de>
Date: Wed, 18 May 2022 11:18:33 +0200
Subject: [PATCH] rm unused Swig getters

---
 Wrap/Swig/libBornAgainDevice.i        |  8 ---
 auto/Wrap/libBornAgainDevice.py       |  8 ---
 auto/Wrap/libBornAgainDevice_wrap.cpp | 80 ---------------------------
 3 files changed, 96 deletions(-)

diff --git a/Wrap/Swig/libBornAgainDevice.i b/Wrap/Swig/libBornAgainDevice.i
index 90fcabd39ac..63334b70a75 100644
--- a/Wrap/Swig/libBornAgainDevice.i
+++ b/Wrap/Swig/libBornAgainDevice.i
@@ -99,11 +99,3 @@
 %include "Device/Histo/Histogram2D.h"
 %include "Device/Histo/IOFactory.h"
 %include "Device/Histo/SimulationResult.h"
-
-%extend Powerfield<double> {
-    double __getitem__(unsigned int i) { return (*($self))[i]; }
-};
-
-%extend SimulationResult {
-    double __getitem__(unsigned int i) { return (*($self))[i]; }
-};
diff --git a/auto/Wrap/libBornAgainDevice.py b/auto/Wrap/libBornAgainDevice.py
index c960400478c..d438f0f7c93 100644
--- a/auto/Wrap/libBornAgainDevice.py
+++ b/auto/Wrap/libBornAgainDevice.py
@@ -2448,10 +2448,6 @@ class IntensityData(object):
         """
         return _libBornAgainDevice.IntensityData_normalizedToMaximum(self)
 
-    def __getitem__(self, i):
-        r"""__getitem__(IntensityData self, unsigned int i) -> double"""
-        return _libBornAgainDevice.IntensityData___getitem__(self, i)
-
 # Register IntensityData in _libBornAgainDevice:
 _libBornAgainDevice.IntensityData_swigregister(IntensityData)
 
@@ -5503,10 +5499,6 @@ class SimulationResult(object):
         """
         return _libBornAgainDevice.SimulationResult_title(self)
 
-    def __getitem__(self, i):
-        r"""__getitem__(SimulationResult self, unsigned int i) -> double"""
-        return _libBornAgainDevice.SimulationResult___getitem__(self, i)
-
 # Register SimulationResult in _libBornAgainDevice:
 _libBornAgainDevice.SimulationResult_swigregister(SimulationResult)
 
diff --git a/auto/Wrap/libBornAgainDevice_wrap.cpp b/auto/Wrap/libBornAgainDevice_wrap.cpp
index c7af9cde68f..d16f80f89d0 100644
--- a/auto/Wrap/libBornAgainDevice_wrap.cpp
+++ b/auto/Wrap/libBornAgainDevice_wrap.cpp
@@ -6829,23 +6829,6 @@ SWIGINTERN std::vector< Vec3< double > >::iterator std_vector_Sl_Vec3_Sl_double_
 SWIGINTERN std::vector< Vec3< double > >::iterator std_vector_Sl_Vec3_Sl_double_Sg__Sg__insert__SWIG_0(std::vector< Vec3< double > > *self,std::vector< Vec3< double > >::iterator pos,std::vector< Vec3< double > >::value_type const &x){ return self->insert(pos, x); }
 SWIGINTERN void std_vector_Sl_Vec3_Sl_double_Sg__Sg__insert__SWIG_1(std::vector< Vec3< double > > *self,std::vector< Vec3< double > >::iterator pos,std::vector< Vec3< double > >::size_type n,std::vector< Vec3< double > >::value_type const &x){ self->insert(pos, n, x); }
 
-SWIGINTERN int
-SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
-{
-  unsigned long v;
-  int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
-  if (SWIG_IsOK(res)) {
-    if ((v > UINT_MAX)) {
-      return SWIG_OverflowError;
-    } else {
-      if (val) *val = static_cast< unsigned int >(v);
-    }
-  }  
-  return res;
-}
-
-SWIGINTERN double Powerfield_Sl_double_Sg____getitem__(Powerfield< double > *self,unsigned int i){ return (*(self))[i]; }
-
 SWIGINTERN int
 SWIG_AsVal_bool (PyObject *obj, bool *val)
 {
@@ -6859,7 +6842,6 @@ SWIG_AsVal_bool (PyObject *obj, bool *val)
   return SWIG_OK;
 }
 
-SWIGINTERN double SimulationResult___getitem__(SimulationResult *self,unsigned int i){ return (*(self))[i]; }
 
 
 /* ---------------------------------------------------
@@ -28607,36 +28589,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_IntensityData___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  Powerfield< double > *arg1 = (Powerfield< double > *) 0 ;
-  unsigned int arg2 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  unsigned int val2 ;
-  int ecode2 = 0 ;
-  PyObject *swig_obj[2] ;
-  double result;
-  
-  if (!SWIG_Python_UnpackTuple(args, "IntensityData___getitem__", 2, 2, swig_obj)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PowerfieldT_double_t, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntensityData___getitem__" "', argument " "1"" of type '" "Powerfield< double > *""'"); 
-  }
-  arg1 = reinterpret_cast< Powerfield< double > * >(argp1);
-  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntensityData___getitem__" "', argument " "2"" of type '" "unsigned int""'");
-  } 
-  arg2 = static_cast< unsigned int >(val2);
-  result = (double)Powerfield_Sl_double_Sg____getitem__(arg1,arg2);
-  resultobj = SWIG_From_double(static_cast< double >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *IntensityData_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *obj;
   if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
@@ -42063,36 +42015,6 @@ fail:
 }
 
 
-SWIGINTERN PyObject *_wrap_SimulationResult___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
-  PyObject *resultobj = 0;
-  SimulationResult *arg1 = (SimulationResult *) 0 ;
-  unsigned int arg2 ;
-  void *argp1 = 0 ;
-  int res1 = 0 ;
-  unsigned int val2 ;
-  int ecode2 = 0 ;
-  PyObject *swig_obj[2] ;
-  double result;
-  
-  if (!SWIG_Python_UnpackTuple(args, "SimulationResult___getitem__", 2, 2, swig_obj)) SWIG_fail;
-  res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SimulationResult, 0 |  0 );
-  if (!SWIG_IsOK(res1)) {
-    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SimulationResult___getitem__" "', argument " "1"" of type '" "SimulationResult *""'"); 
-  }
-  arg1 = reinterpret_cast< SimulationResult * >(argp1);
-  ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
-  if (!SWIG_IsOK(ecode2)) {
-    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SimulationResult___getitem__" "', argument " "2"" of type '" "unsigned int""'");
-  } 
-  arg2 = static_cast< unsigned int >(val2);
-  result = (double)SimulationResult___getitem__(arg1,arg2);
-  resultobj = SWIG_From_double(static_cast< double >(result));
-  return resultobj;
-fail:
-  return NULL;
-}
-
-
 SWIGINTERN PyObject *SimulationResult_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
   PyObject *obj;
   if (!SWIG_Python_UnpackTuple(args, "swigregister", 1, 1, &obj)) return NULL;
@@ -43085,7 +43007,6 @@ static PyMethodDef SwigMethods[] = {
 		"const Powerfield< double > & Powerfield< double >::normalizedToMaximum()\n"
 		"\n"
 		""},
-	 { "IntensityData___getitem__", _wrap_IntensityData___getitem__, METH_VARARGS, "IntensityData___getitem__(IntensityData self, unsigned int i) -> double"},
 	 { "IntensityData_swigregister", IntensityData_swigregister, METH_O, NULL},
 	 { "IntensityData_swiginit", IntensityData_swiginit, METH_VARARGS, NULL},
 	 { "relativeDataDifference", _wrap_relativeDataDifference, METH_VARARGS, "\n"
@@ -44902,7 +44823,6 @@ static PyMethodDef SwigMethods[] = {
 		"std::string SimulationResult::title()\n"
 		"\n"
 		""},
-	 { "SimulationResult___getitem__", _wrap_SimulationResult___getitem__, METH_VARARGS, "SimulationResult___getitem__(SimulationResult self, unsigned int i) -> double"},
 	 { "SimulationResult_swigregister", SimulationResult_swigregister, METH_O, NULL},
 	 { "SimulationResult_swiginit", SimulationResult_swiginit, METH_VARARGS, NULL},
 	 { NULL, NULL, 0, NULL }
-- 
GitLab