Skip to content
Snippets Groups Projects
Select Git revision
  • 2e5e6bc0ef17678c122595154b772a80ae7972e9
  • master default protected
  • Dawit
  • maike-patrick-first-pipeline
  • Jonas
  • Kamal
  • Maike
  • Patrick
  • Uni-Bremen
  • update-setup
10 results

test_classifier.py

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    AmptekHardwareInterface.i 1.05 KiB
    %module AmptekHardwareInterface
    
    %{
        #define SWIG_FILE_WITH_INIT
        #include "AmptekHardwareInterface.h"
    %}
    
    %include "numpy.i"
    %include "std_string.i"
    %init %{
        import_array();
    %}
    %numpy_typemaps(unsigned int      , NPY_UINT     , int)
    
    %include "stdint.i"
    %include "std_vector.i"
    %include "std_pair.i"
    
    %include exception.i       
    namespace std {
       %template(IntVector) vector<int>;
       %template(StringVector) vector<std::string>;
       %template(DoubleVector) vector<double>;
       %template(UIntVector) vector<unsigned int>;
    }
    %except {
    	try {
    		$function
    	} catch(RangeError) {
    		SWIG_exception(SWIG_ValueError, "Range Error");
    	} catch(DivisionByZero) {
    		SWIG_exception(SWIG_DivisionByZero, "Division by zero");
    	} catch(OutOfMemory) {
    		SWIG_exception(SWIG_MemoryError, "Out of memory");
    	} catch(AmptekException) {
    		SWIG_exception(SWIG_RuntimeError, "Amptek Error");
    	} catch(...) {
    		SWIG_exception(SWIG_RuntimeError,"Unknown exception");
    	}
    }
    
    %include "include/AmptekHardwareInterface.h"
    %include "include/AmptekStatus.h"
    %include "include/AmptekSpectrum.h"