diff --git a/swig/gridpp.i.bkp b/swig/gridpp.i.bkp deleted file mode 100644 index 8be183b..0000000 --- a/swig/gridpp.i.bkp +++ /dev/null @@ -1,90 +0,0 @@ -%module gridpp -%init %{ -#if defined(SWIGPYTHON) - import_array(); -#endif - gridpp::initialize_omp(); -%} -%include exception.i -/* - SWIG_MemoryError - SWIG_IOError - SWIG_RuntimeError - SWIG_IndexError - SWIG_TypeError - SWIG_DivisionByZero - SWIG_OverflowError - SWIG_SyntaxError - SWIG_ValueError - SWIG_SystemError -*/ -%exception { - try { - $action - } - catch (std::invalid_argument &e) { - std::string s(e.what()); - SWIG_exception(SWIG_ValueError, s.c_str()); - } - catch (gridpp::not_implemented_exception &e) { - std::string s(e.what()); - SWIG_exception(SWIG_RuntimeError, s.c_str()); - } - catch (std::exception &e) { - std::string s(e.what()); - SWIG_exception(SWIG_RuntimeError, s.c_str()); - } - catch (...) { - SWIG_exception(SWIG_RuntimeError, "Unknown exception"); - } -} -/* This is needed to make sure that functions returning smart pointers - * can be accessed properly in python. E.g. calling .corr on a structure function - * smart pointer -*/ -%include -%shared_ptr(gridpp::StructureFunction) -%shared_ptr(gridpp::MultipleStructure) -%shared_ptr(gridpp::BarnesStructure) -%shared_ptr(gridpp::SoarStructure) -%shared_ptr(gridpp::ToarStructure) -%shared_ptr(gridpp::PowerlawStructure) -%shared_ptr(gridpp::LinearStructure) -%shared_ptr(gridpp::CressmanStructure) -%shared_ptr(gridpp::CrossValidation) - -%include "vector.i" -%apply std::vector >& OUTPUT { std::vector >& output }; -%apply std::vector >& OUTPUT { std::vector >& count }; -%apply std::vector >& OUTPUT { std::vector >& y_coord }; -%apply std::vector >& OUTPUT { std::vector >& x_coord }; -%apply std::vector& OUTPUT { std::vector& x_coords }; -%apply std::vector& OUTPUT { std::vector& y_coords }; -%apply std::vector& OUTPUT { std::vector& z_coords }; -%apply float& OUTPUT { float& x_coord }; -%apply float& OUTPUT { float& y_coord }; -%apply float& OUTPUT { float& z_coord }; -%apply std::vector& OUTPUT { std::vector& distances }; -%apply std::vector& OUTPUT { std::vector& standard_error }; -%apply std::vector& OUTPUT { std::vector& analysis_variance }; -%apply std::vector& OUTPUT { std::vector& output_fcst }; -%apply std::vector >& OUTPUT { std::vector >& analysis_variance }; -%apply std::vector >& OUTPUT { std::vector >& distances }; -%apply int& OUTPUT { int& X1_out }; -%apply int& OUTPUT { int& Y1_out }; -%apply int& OUTPUT { int& X2_out }; -%apply int& OUTPUT { int& Y2_out }; -%apply std::vector > >& OUTPUT { std::vector > >& output }; -// This turns on automatic description of function arguments in the python package. The -// problem is that it doesn't fetch any of the comments in the header file describing each -// parameter, so only the type is shown. -// A different approach is to use -doxygen with swig -%feature("autodoc", "2"); - -%{ -#include "gridpp.h" -%} -// This is how you add description in the docstring in python. The problem is -// that the comment is added at the end (after the description of function parameters) -// %feature("docstring") gridpp::nearest "Nearest neighbour interpolation" -%include "gridpp.h"