[magics] 14/63: merge latest to dev-python3 branch

Alastair McKinstry mckinstry at moszumanska.debian.org
Fri Mar 24 10:41:49 UTC 2017


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch debian/master
in repository magics.

commit aaf26e2e301be862a0ffb1e0d165ede8abd0e47b
Merge: f38e675 d63bc95
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Mon Jun 13 19:26:16 2016 +0100

    merge latest to dev-python3 branch

 CMakeLists.txt                                     |  420 +--
 INSTALL                                            |  229 +-
 NOTICE                                             |   63 +
 VERSION.cmake                                      |    7 +-
 apps/MagMLInterpretor/CMakeLists.txt               |    4 +-
 apps/metgram/CMakeLists.txt                        |   13 +-
 bin/ecbuild                                        |  442 +++
 cmake/CMakeLists.txt                               |    5 -
 cmake/CheckFortranSourceCompiles.cmake             |    2 +-
 cmake/FindADSM.cmake                               |    2 +-
 cmake/FindAEC.cmake                                |    4 +-
 cmake/FindAIO.cmake                                |    2 +-
 cmake/FindArmadillo.cmake                          |   35 +-
 cmake/FindCMath.cmake                              |    2 +-
 cmake/FindDl.cmake                                 |    2 +-
 cmake/FindEMOS.cmake                               |    4 +-
 cmake/FindEcLib.cmake                              |   49 -
 cmake/FindEcregrid.cmake                           |   48 -
 cmake/FindFDB.cmake                                |    2 +-
 cmake/FindHPSS.cmake                               |    2 +-
 cmake/FindLEX.cmake                                |    2 +-
 cmake/FindLegacyFDB.cmake                          |    2 +-
 cmake/FindLibGFortran.cmake                        |   16 +-
 cmake/FindLibIFort.cmake                           |   47 +
 cmake/FindMKL.cmake                                |   77 +
 cmake/FindNDBM.cmake                               |    2 +-
 cmake/FindNetCDF.cmake                             |  147 +-
 cmake/FindNetCDF3.cmake                            |   67 +-
 cmake/FindODB.cmake                                |    2 +-
 cmake/FindOpenCL.cmake                             |   67 +
 cmake/FindOpenJPEG.cmake                           |    5 +-
 cmake/FindPGIFortran.cmake                         |    2 +-
 cmake/FindPango.cmake                              |   18 +-
 cmake/FindPangoCairo.cmake                         |   23 +-
 cmake/FindProj4.cmake                              |   20 +-
 cmake/FindREADLINE.cmake                           |    6 +-
 cmake/FindRPCGEN.cmake                             |    2 +-
 cmake/FindRealtime.cmake                           |    2 +-
 cmake/FindSZip.cmake                               |    4 +-
 cmake/FindScin.cmake                               |   48 -
 cmake/FindTrilinos.cmake                           |    5 +-
 cmake/FindViennaCL.cmake                           |   38 +
 cmake/FindXLFortranLibs.cmake                      |    2 +-
 cmake/FindYACC.cmake                               |    2 +-
 cmake/Findgrib_api.cmake                           |   46 +-
 cmake/Findodb_api.cmake                            |    4 +-
 cmake/Findspot.cmake                               |    4 +-
 cmake/VERSION.cmake                                |    6 +-
 cmake/compiler_flags/Clang_C.cmake                 |   13 +
 cmake/compiler_flags/Clang_CXX.cmake               |   13 +
 cmake/compiler_flags/Cray_C.cmake                  |   14 +
 cmake/compiler_flags/Cray_CXX.cmake                |   14 +
 cmake/compiler_flags/Cray_Fortran.cmake            |   15 +
 cmake/compiler_flags/GNU_C.cmake                   |   18 +
 cmake/compiler_flags/GNU_CXX.cmake                 |   18 +
 cmake/compiler_flags/GNU_Fortran.cmake             |   21 +
 cmake/compiler_flags/Intel_C.cmake                 |   13 +
 cmake/compiler_flags/Intel_CXX.cmake               |   13 +
 cmake/compiler_flags/Intel_Fortran.cmake           |   14 +
 .../PGI_C.cmake}                                   |   10 +-
 .../PGI_CXX.cmake}                                 |   10 +-
 .../PGI_Fortran.cmake}                             |   10 +-
 cmake/contrib/FindEigen3.cmake                     |   10 +-
 cmake/contrib/FindFFTW.cmake                       |  235 +-
 cmake/contrib/FindNetCDF4.cmake                    |   44 +-
 cmake/contrib/GetGitRevisionDescription.cmake.in   |    6 +-
 .../contrib/GreatCMakeCookOff/tests/CMakeLists.txt |   12 -
 .../GreatCMakeCookOff/tests/cpp11/CMakeLists.txt   |    3 -
 cmake/ecbuild-config-version.cmake                 |   12 +
 cmake/ecbuild-config.cmake                         |   97 +
 cmake/ecbuild_add_c_flags.cmake                    |   92 +
 cmake/ecbuild_add_cxx11_flags.cmake                |   22 +-
 cmake/ecbuild_add_cxx_flags.cmake                  |   92 +
 cmake/ecbuild_add_executable.cmake                 |  518 ++-
 cmake/ecbuild_add_extra_search_paths.cmake         |   25 +-
 cmake/ecbuild_add_fortran_flags.cmake              |   98 +
 cmake/ecbuild_add_library.cmake                    |  835 +++--
 cmake/ecbuild_add_option.cmake                     |  236 +-
 cmake/ecbuild_add_persistent.cmake                 |  100 +-
 cmake/ecbuild_add_resources.cmake                  |   97 +-
 cmake/ecbuild_add_test.cmake                       |  622 ++--
 cmake/ecbuild_append_to_rpath.cmake                |   37 +-
 cmake/ecbuild_bundle.cmake                         |  354 +-
 cmake/ecbuild_cache.cmake                          |   36 +-
 ...e.cmake => ecbuild_check_c_source_return.cmake} |   95 +-
 cmake/ecbuild_check_compiler.cmake                 |   53 +-
 cmake/ecbuild_check_cxx11.cmake                    |   78 +-
 ...cmake => ecbuild_check_cxx_source_return.cmake} |  123 +-
 ...e => ecbuild_check_fortran_source_return.cmake} |   88 +-
 cmake/ecbuild_check_functions.cmake                |   77 +-
 cmake/ecbuild_check_os.cmake                       |  128 +-
 cmake/ecbuild_compiler_flags.cmake                 |   97 +
 cmake/ecbuild_config.h.in                          |   27 +-
 cmake/ecbuild_debug_var.cmake                      |   35 -
 cmake/ecbuild_declare_project.cmake                |  244 +-
 cmake/ecbuild_define_build_types.cmake             |   65 +-
 cmake/ecbuild_define_libs_and_execs_target.cmake   |   29 +
 ...get.cmake => ecbuild_define_links_target.cmake} |   10 +-
 cmake/ecbuild_define_options.cmake                 |   22 +-
 cmake/ecbuild_define_paths.cmake                   |    2 +-
 cmake/ecbuild_define_uninstall.cmake               |    7 +
 cmake/ecbuild_dont_pack.cmake                      |   82 +
 cmake/ecbuild_download_resource.cmake              |   47 +
 cmake/ecbuild_echo_targets.cmake                   |   71 +-
 cmake/ecbuild_enable_fortran.cmake                 |   87 +-
 cmake/ecbuild_features.cmake                       |   98 +
 cmake/ecbuild_find_fortranlibs.cmake               |  210 +-
 cmake/ecbuild_find_lexyacc.cmake                   |  106 +-
 cmake/ecbuild_find_mpi.cmake                       |  128 +-
 cmake/ecbuild_find_omp.cmake                       |   81 +-
 cmake/ecbuild_find_package.cmake                   |  401 ++-
 cmake/ecbuild_find_perl.cmake                      |   78 +-
 cmake/ecbuild_find_python.cmake                    |  174 +-
 cmake/ecbuild_generate_config_headers.cmake        |   64 +-
 cmake/ecbuild_generate_fortran_interfaces.cmake    |  115 +
 cmake/ecbuild_generate_rpc.cmake                   |   33 +-
 cmake/ecbuild_generate_yy.cmake                    |  236 +-
 cmake/ecbuild_get_cxx11_flags.cmake                |   71 +
 cmake/ecbuild_get_date.cmake                       |   30 +-
 cmake/ecbuild_get_resources.cmake                  |   16 +-
 cmake/ecbuild_get_test_data.cmake                  |  277 +-
 cmake/ecbuild_git.cmake                            |  307 ++
 ...package.cmake => ecbuild_install_project.cmake} |  228 +-
 cmake/ecbuild_list_add_pattern.cmake               |  102 +
 cmake/ecbuild_list_exclude_pattern.cmake           |   88 +
 cmake/ecbuild_list_extra_search_paths.cmake        |   61 +-
 cmake/ecbuild_list_macros.cmake                    |    9 +-
 cmake/ecbuild_log.cmake                            |  207 ++
 cmake/ecbuild_pkgconfig.cmake                      |  178 +-
 cmake/ecbuild_policies.cmake                       |   67 +
 cmake/ecbuild_print_summary.cmake                  |  177 +-
 cmake/ecbuild_project_files.cmake                  |   68 +-
 cmake/ecbuild_remove_fortran_flags.cmake           |   61 +
 cmake/ecbuild_requires_macro_version.cmake         |   14 +-
 cmake/ecbuild_separate_sources.cmake               |   42 +-
 cmake/ecbuild_setup_test_framework.cmake           |   53 +-
 cmake/ecbuild_source_flags.cmake                   |   30 +
 cmake/ecbuild_system.cmake                         |  413 ++-
 cmake/ecbuild_uninstall.cmake.in                   |   21 +
 cmake/ecbuild_use_package.cmake                    |  355 +-
 cmake/ecbuild_version.h.in                         |    2 +-
 cmake/ecbuild_warn_unused_files.cmake              |   31 +-
 cmake/gen_source_flags.py                          |   84 +
 cmake/include/ecbuild/boost_test_framework.h       |    2 +-
 cmake/pkg-config.pc.in                             |    8 +-
 cmake/project-config.cmake.in                      |   55 +-
 cmake/pymain.c                                     |    5 +
 cmake/sg.pl                                        |    2 +-
 debian/changelog                                   |   66 +-
 debian/libmagics++-dev.install                     |    1 -
 debian/patches/cmake-config.patch                  |   12 +-
 debian/patches/compile-fixes.patch                 |   20 +
 debian/patches/cve-2010-3393.patch                 |   31 -
 debian/patches/fix-headers.patch                   |   31 -
 debian/patches/g++-6.patch                         |  100 +
 debian/patches/gcc-4.7.patch                       |  144 -
 debian/patches/geotiff.patch                       |   13 -
 debian/patches/grib-cmake.patch                    |   22 -
 debian/patches/magics-config.patch                 |  117 -
 debian/patches/numpy-fixes.patch                   | 2673 ++++++++++++++
 debian/patches/pkgconfig-fix.patch                 |   39 +
 debian/patches/python3.patch                       |   14 +-
 debian/patches/qt5.patch                           |  116 -
 debian/patches/reproducibility.patch               |   71 +-
 debian/patches/series                              |   12 +-
 debian/patches/soname-version.patch                |   53 +-
 debian/patches/terralib.patch                      |   24 +-
 debian/patches/unique-ptr.patch                    |  338 ++
 debian/rules                                       |   12 +-
 magics-config.in                                   |  323 --
 magics-import.cmake.in                             |    7 +
 project_summary.cmake                              |    6 +-
 python/Magics/CMakeLists.txt                       |   18 +-
 python/Magics/Magics_interface.cc                  |   15 +-
 python/Magics/macro.py                             |    4 +
 share/ecbuild/toolchains/ecmwf-XC30-Cray.cmake     |   45 +
 share/ecbuild/toolchains/ecmwf-XC30-GNU.cmake      |   41 +
 share/ecbuild/toolchains/ecmwf-XC30-Intel.cmake    |   56 +
 .../magics/10m/10m_admin_0_boundary_lines_land.dbf |  Bin 12752 -> 0 bytes
 .../magics/10m/10m_admin_0_boundary_lines_land.shp |  Bin 1195564 -> 0 bytes
 .../magics/10m/10m_admin_0_boundary_lines_land.shx |  Bin 2836 -> 0 bytes
 .../10m/10m_admin_1_states_provinces_shp.dbf       |  Bin 4553698 -> 0 bytes
 .../10m/10m_admin_1_states_provinces_shp.shp       |  Bin 15598952 -> 0 bytes
 .../10m/10m_admin_1_states_provinces_shp.shx       |  Bin 15644 -> 0 bytes
 share/magics/10m/10m_lakes.dbf                     |  Bin 540735 -> 0 bytes
 share/magics/10m/10m_lakes.prj                     |    1 -
 share/magics/10m/10m_lakes.shp                     |  Bin 1253556 -> 0 bytes
 share/magics/10m/10m_lakes.shx                     |  Bin 3452 -> 0 bytes
 share/magics/10m/10m_land.prj                      |    1 -
 share/magics/10m/10m_land.shp                      |  Bin 6248904 -> 0 bytes
 share/magics/10m/10m_land.shx                      |  Bin 16228 -> 0 bytes
 share/magics/10m/10m_populated_places_simple.dbf   |  Bin 32124176 -> 0 bytes
 share/magics/10m/10m_populated_places_simple.shp   |  Bin 204752 -> 0 bytes
 share/magics/10m/10m_rivers_lake_centerlines.dbf   |  Bin 163625 -> 0 bytes
 share/magics/10m/10m_rivers_lake_centerlines.prj   |    1 -
 share/magics/10m/10m_rivers_lake_centerlines.shp   |  Bin 1950380 -> 0 bytes
 share/magics/10m/10m_rivers_lake_centerlines.shx   |  Bin 3900 -> 0 bytes
 .../ne_10m_admin_0_boundary_lines_land.VERSION.txt |    1 +
 .../10m/ne_10m_admin_0_boundary_lines_land.dbf     |  Bin 0 -> 260057 bytes
 ....prj => ne_10m_admin_0_boundary_lines_land.prj} |    0
 .../10m/ne_10m_admin_0_boundary_lines_land.shp     |  Bin 0 -> 1299780 bytes
 .../10m/ne_10m_admin_0_boundary_lines_land.shx     |  Bin 0 -> 3788 bytes
 .../ne_10m_admin_1_states_provinces.VERSION.txt    |    1 +
 .../magics/10m/ne_10m_admin_1_states_provinces.dbf |  Bin 0 -> 15267317 bytes
 .../ne_10m_admin_1_states_provinces.prj}           |    0
 .../ne_10m_admin_1_states_provinces.shp}           |  Bin 19936848 -> 21612568 bytes
 .../magics/10m/ne_10m_admin_1_states_provinces.shx |  Bin 0 -> 37276 bytes
 share/magics/10m/ne_10m_land.VERSION.txt           |    1 +
 share/magics/10m/ne_10m_land.dbf                   |  Bin 0 -> 702401 bytes
 .../{10m_full/10m_land.prj => 10m/ne_10m_land.prj} |    0
 share/magics/10m/ne_10m_land.qpj                   |    1 +
 share/magics/10m/ne_10m_land.shp                   |  Bin 0 -> 10064204 bytes
 share/magics/10m/ne_10m_land.shx                   |  Bin 0 -> 63940 bytes
 share/magics/10m/ne_10m_ocean.VERSION.txt          |    1 +
 .../10m_lakes.dbf => 10m/ne_10m_ocean.dbf}         |  Bin 1724955 -> 1516917 bytes
 .../ne_10m_ocean.prj}                              |    0
 share/magics/10m/ne_10m_ocean.qpj                  |    1 +
 share/magics/10m/ne_10m_ocean.shp                  |  Bin 0 -> 9460720 bytes
 share/magics/10m/ne_10m_ocean.shx                  |  Bin 0 -> 10884 bytes
 share/magics/10m/ne_10m_ocean_orig.VERSION.txt     |    1 +
 .../10m/ne_10m_populated_places_simple.VERSION.txt |    1 +
 .../magics/10m/ne_10m_populated_places_simple.dbf  |  Bin 0 -> 13136853 bytes
 ..._shp.prj => ne_10m_populated_places_simple.prj} |    0
 .../magics/10m/ne_10m_populated_places_simple.shp  |  Bin 0 -> 205116 bytes
 ...mple.shx => ne_10m_populated_places_simple.shx} |  Bin 58572 -> 58676 bytes
 .../10m/ne_10m_rivers_lake_centerlines.VERSION.txt |    1 +
 ...land.dbf => ne_10m_rivers_lake_centerlines.dbf} |  Bin 1064577 -> 1265238 bytes
 ..._shp.prj => ne_10m_rivers_lake_centerlines.prj} |    0
 .../magics/10m/ne_10m_rivers_lake_centerlines.shp  |  Bin 0 -> 4186892 bytes
 .../magics/10m/ne_10m_rivers_lake_centerlines.shx  |  Bin 0 -> 11732 bytes
 .../10m_full/10m_admin_0_boundary_lines_land.dbf   |  Bin 12752 -> 0 bytes
 .../10m_full/10m_admin_0_boundary_lines_land.shp   |  Bin 1195564 -> 0 bytes
 .../10m_full/10m_admin_0_boundary_lines_land.shx   |  Bin 2836 -> 0 bytes
 .../10m_full/10m_admin_1_states_provinces_shp.dbf  |  Bin 8354045 -> 0 bytes
 .../10m_full/10m_admin_1_states_provinces_shp.shx  |  Bin 28620 -> 0 bytes
 share/magics/10m_full/10m_lakes.prj                |    1 -
 share/magics/10m_full/10m_lakes.shp                |  Bin 2252300 -> 0 bytes
 share/magics/10m_full/10m_lakes.shx                |  Bin 10796 -> 0 bytes
 share/magics/10m_full/10m_land.dbf                 |  Bin 293905 -> 0 bytes
 share/magics/10m_full/10m_land.shp                 |  Bin 6945784 -> 0 bytes
 share/magics/10m_full/10m_land.shx                 |  Bin 31436 -> 0 bytes
 .../10m_full/10m_rivers_lake_centerlines.dbf       |  Bin 481138 -> 0 bytes
 .../10m_full/10m_rivers_lake_centerlines.shp       |  Bin 4130540 -> 0 bytes
 .../10m_full/10m_rivers_lake_centerlines.shx       |  Bin 11284 -> 0 bytes
 .../110m/110m_admin_0_boundary_lines_land.dbf      |  Bin 9168 -> 0 bytes
 .../110m/110m_admin_0_boundary_lines_land.prj      |    1 -
 .../110m/110m_admin_0_boundary_lines_land.shx      |  Bin 1364 -> 0 bytes
 .../110m/110m_admin_1_states_provinces_shp.prj     |    1 -
 share/magics/110m/110m_lakes.prj                   |    1 -
 share/magics/110m/110m_lakes.shp                   |  Bin 9324 -> 0 bytes
 share/magics/110m/110m_lakes.shx                   |  Bin 300 -> 0 bytes
 share/magics/110m/110m_land.dbf                    |  Bin 3400 -> 0 bytes
 share/magics/110m/110m_land.prj                    |    1 -
 share/magics/110m/110m_land.sbx                    |  Bin 268 -> 0 bytes
 share/magics/110m/110m_land.shp.xml                |    3 -
 ...ne_110m_admin_0_boundary_lines_land.VERSION.txt |    1 +
 .../110m/ne_110m_admin_0_boundary_lines_land.dbf   |  Bin 0 -> 29946 bytes
 .../ne_110m_admin_0_boundary_lines_land.prj}       |    0
 ...shp => ne_110m_admin_0_boundary_lines_land.shp} |  Bin 53188 -> 55692 bytes
 .../110m/ne_110m_admin_0_boundary_lines_land.shx   |  Bin 0 -> 1580 bytes
 .../ne_110m_admin_1_states_provinces.VERSION.txt   |    1 +
 ...hp.dbf => ne_110m_admin_1_states_provinces.dbf} |  Bin 102605 -> 110913 bytes
 .../ne_110m_admin_1_states_provinces.prj}          |    0
 .../110m/ne_110m_admin_1_states_provinces.sbn      |  Bin 0 -> 596 bytes
 .../110m/ne_110m_admin_1_states_provinces.sbx      |  Bin 0 -> 148 bytes
 ...hp.shp => ne_110m_admin_1_states_provinces.shp} |  Bin 39132 -> 39132 bytes
 ...hp.shx => ne_110m_admin_1_states_provinces.shx} |  Bin 508 -> 508 bytes
 share/magics/110m/ne_110m_land.VERSION.txt         |    1 +
 share/magics/110m/ne_110m_land.dbf                 |  Bin 0 -> 2637 bytes
 .../ne_110m_land.prj}                              |    0
 share/magics/110m/ne_110m_land.qpj                 |    1 +
 .../110m/{110m_land.shp => ne_110m_land.shp}       |  Bin 89504 -> 97152 bytes
 .../110m/{110m_land.shx => ne_110m_land.shx}       |  Bin 1116 -> 1116 bytes
 share/magics/110m/ne_110m_ocean.VERSION.txt        |    1 +
 .../110m/{110m_lakes.dbf => ne_110m_ocean.dbf}     |  Bin 19711 -> 17402 bytes
 .../10m_land.prj => 110m/ne_110m_ocean.prj}        |    0
 share/magics/110m/ne_110m_ocean.qpj                |    1 +
 share/magics/110m/ne_110m_ocean.shp                |  Bin 0 -> 94028 bytes
 share/magics/110m/ne_110m_ocean.shx                |  Bin 0 -> 316 bytes
 .../ne_110m_rivers_lake_centerlines.VERSION.txt    |    1 +
 ...nes.dbf => ne_110m_rivers_lake_centerlines.dbf} |  Bin 7876 -> 7875 bytes
 .../ne_110m_rivers_lake_centerlines.prj}           |    0
 ...nes.shp => ne_110m_rivers_lake_centerlines.shp} |  Bin 19268 -> 19268 bytes
 ...nes.shx => ne_110m_rivers_lake_centerlines.shx} |  Bin 212 -> 212 bytes
 .../magics/50m/50m_admin_0_boundary_lines_land.shx |  Bin 2924 -> 0 bytes
 .../50m/50m_admin_1_states_provinces_shp.dbf       |  Bin 36546 -> 0 bytes
 .../50m/50m_admin_1_states_provinces_shp.prj       |    1 -
 .../50m/50m_admin_1_states_provinces_shp.shp       |  Bin 409604 -> 0 bytes
 .../50m/50m_admin_1_states_provinces_shp.shx       |  Bin 612 -> 0 bytes
 share/magics/50m/50m_lakes.prj                     |    1 -
 share/magics/50m/50m_lakes.shp                     |  Bin 330436 -> 0 bytes
 share/magics/50m/50m_lakes.shx                     |  Bin 3268 -> 0 bytes
 share/magics/50m/50m_land.dbf                      |  Bin 782582 -> 0 bytes
 share/magics/50m/50m_land.prj                      |    1 -
 share/magics/50m/50m_land.shp                      |  Bin 1050812 -> 0 bytes
 share/magics/50m/50m_land.shx                      |  Bin 11460 -> 0 bytes
 share/magics/50m/50m_rivers_lake_centerlines.dbf   |  Bin 154476 -> 0 bytes
 share/magics/50m/50m_rivers_lake_centerlines.prj   |    1 -
 share/magics/50m/50m_rivers_lake_centerlines.shp   |  Bin 433660 -> 0 bytes
 .../magics/50m/50m_rivers_lake_centerlines.shp.xml |    3 -
 share/magics/50m/50m_rivers_lake_centerlines.shx   |  Bin 3764 -> 0 bytes
 .../ne_50m_admin_0_boundary_lines_land.VERSION.txt |    1 +
 ....dbf => ne_50m_admin_0_boundary_lines_land.dbf} |  Bin 102853 -> 107049 bytes
 .../ne_50m_admin_0_boundary_lines_land.prj}        |    0
 ....shp => ne_50m_admin_0_boundary_lines_land.shp} |  Bin 334300 -> 336788 bytes
 .../50m/ne_50m_admin_0_boundary_lines_land.shx     |  Bin 0 -> 2980 bytes
 ..._admin_1_states_provinces_lines_shp.VERSION.txt |    1 +
 .../ne_50m_admin_1_states_provinces_lines_shp.dbf  |  Bin 0 -> 8852 bytes
 .../ne_50m_admin_1_states_provinces_lines_shp.prj  |    1 +
 .../ne_50m_admin_1_states_provinces_lines_shp.shp  |  Bin 0 -> 73788 bytes
 .../ne_50m_admin_1_states_provinces_lines_shp.shx  |  Bin 0 -> 1244 bytes
 share/magics/50m/ne_50m_land.VERSION.txt           |    1 +
 share/magics/50m/ne_50m_land.dbf                   |  Bin 0 -> 61157 bytes
 .../{10m_full/10m_land.prj => 50m/ne_50m_land.prj} |    0
 share/magics/50m/ne_50m_land.qpj                   |    1 +
 share/magics/50m/ne_50m_land.shp                   |  Bin 0 -> 1336536 bytes
 share/magics/50m/ne_50m_land.shx                   |  Bin 0 -> 11460 bytes
 share/magics/50m/ne_50m_ocean.VERSION.txt          |    1 +
 .../magics/50m/{50m_lakes.dbf => ne_50m_ocean.dbf} |  Bin 410449 -> 297489 bytes
 .../10m_land.prj => 50m/ne_50m_ocean.prj}          |    0
 share/magics/50m/ne_50m_ocean.qpj                  |    1 +
 share/magics/50m/ne_50m_ocean.shp                  |  Bin 0 -> 1306048 bytes
 share/magics/50m/ne_50m_ocean.shx                  |  Bin 0 -> 3300 bytes
 share/magics/50m/ne_50m_ocean_orig.VERSION.txt     |    1 +
 .../50m/ne_50m_rivers_lake_centerlines.VERSION.txt |    1 +
 .../magics/50m/ne_50m_rivers_lake_centerlines.dbf  |  Bin 0 -> 200262 bytes
 .../ne_50m_rivers_lake_centerlines.prj}            |    0
 .../magics/50m/ne_50m_rivers_lake_centerlines.shp  |  Bin 0 -> 437660 bytes
 .../magics/50m/ne_50m_rivers_lake_centerlines.shx  |  Bin 0 -> 3780 bytes
 share/magics/Fonts.dat                             |    8 +-
 share/magics/contour_ids.json                      |  186 +-
 share/magics/contours.json                         | 1318 ++++++-
 share/magics/default.json                          |  113 +-
 share/magics/ecmwf_logo_2014.svg                   |   10 +
 share/magics/epsg.json                             |  428 ++-
 share/magics/layer_contours.json                   |  606 +++-
 share/magics/layer_ids.json                        |  109 +-
 share/magics/layers.json                           | 1275 ++++++-
 share/magics/level.json                            |  203 +-
 share/magics/marsClass.json                        |   94 +-
 share/magics/marsStream.json                       |  140 +-
 share/magics/marsType.json                         |  145 +-
 share/magics/number.json                           |  132 +-
 share/magics/obs.xml                               |    2 +-
 share/magics/paramId.json                          |  348 +-
 share/magics/shortName.json                        |  347 +-
 share/magics/stepRange.json                        |  136 +-
 share/magics/symbols.svg                           | 1543 ++++----
 share/magics/title_template.xml                    |    4 +
 share/magics/typeOfLevel.json                      |  126 +-
 share/magics/units.json                            |  178 +-
 src/CMakeLists.txt                                 |   95 +-
 src/basic/BasicGraphicsObject.cc                   |    1 -
 src/basic/BasicGraphicsObject.h                    |   21 +-
 src/basic/BasicSceneObject.cc                      |    2 +-
 src/basic/BasicSceneObject.h                       |   40 +-
 src/basic/CMakeLists.txt                           |    2 +-
 src/basic/FortranMagics.cc                         |  233 +-
 src/basic/FortranMagics.h                          |    6 +-
 src/basic/Layer.cc                                 |   22 +-
 src/basic/Layer.h                                  |    2 +-
 src/basic/LegendVisitor.cc                         |    7 +-
 src/basic/LegendVisitor.h                          |   10 +-
 src/basic/MagnifierVisitor.cc                      |    2 +-
 src/basic/MultiVisdef.cc                           |    2 +-
 src/basic/RootSceneNode.cc                         |    4 +-
 src/basic/SceneNode.cc                             |    5 +-
 src/basic/SceneVisitor.cc                          |   16 +-
 src/basic/SceneVisitor.h                           |   47 +-
 src/basic/TagHandler.cc                            |    3 +-
 src/basic/TextVisitor.cc                           |   11 +-
 src/basic/ViewNode.cc                              |   56 +-
 src/basic/ViewNode.h                               |   15 +-
 src/basic/Visdef.h                                 |    2 +-
 src/basic/VisualAction.cc                          |    2 +-
 src/basic/VisualAction.h                           |    2 +-
 src/basic/XmlMagics.cc                             |  182 +-
 src/basic/XmlMagics.h                              |    2 +-
 .../extensions/gis/io/shapelib/shape_creator.hpp   |    1 +
 src/common/AnimationRules.cc                       |    2 +-
 src/common/AutoLocker.cc                           |   24 +-
 src/common/BaseParameter.h                         |   18 +-
 src/common/BasePointsHandler.h                     |    9 +-
 src/common/CMakeLists.txt                          |    4 +-
 src/common/Colour.cc                               |    1 +
 src/common/Coordinate.h                            |   12 +-
 src/common/Data.h                                  |    7 +-
 src/common/Factory.cc                              |    2 +-
 src/common/GeoRectangularProjection.cc             |   50 +-
 src/common/{Matrix.cc => GribInterpretor.h}        |    9 +-
 src/common/Layout.cc                               |   45 +-
 src/common/Layout.h                                |    8 +-
 src/common/LogoPlotting.cc                         |   16 +-
 src/common/MagException.h                          |   30 +-
 src/common/MagExceptions.h                         |   16 +-
 src/common/MagTranslator.h                         |   37 +-
 src/common/MagicsCalls.cc                          |   91 +-
 src/common/MagicsSingleton.h                       |    6 +-
 src/common/Matrix.cc                               |    8 +-
 src/common/Matrix.h                                |    2 +-
 src/common/MatrixHandler.h                         |    7 +-
 src/common/Node.cc                                 |    2 +-
 src/common/OutputFactory.cc                        |   15 +-
 src/common/OutputFactory.h                         |   15 +-
 src/common/OutputHandler.cc                        |   11 +-
 src/common/ParameterManager.h                      |   33 +-
 src/common/PolarStereographicProjection.cc         |   72 +-
 src/common/PolarStereographicProjection.h          |    1 +
 src/common/Polyline.cc                             |   20 +-
 src/common/Proj4Projection.cc                      |  128 +-
 src/common/Proj4Projection.h                       |    1 +
 src/common/TableDefinition.h                       |   14 +-
 src/common/TaylorProjection.cc                     |    2 +-
 src/common/ThreadControler.cc                      |    2 +-
 src/common/Transformation.h                        |   17 +-
 src/common/UserPoint.h                             |   26 +-
 src/common/magics_api.h                            |    6 +-
 src/decoders/BinningObject.cc                      |    2 +-
 src/decoders/BoxPlotDecoder.h                      |    2 +-
 src/decoders/CMakeLists.txt                        |   11 +-
 src/decoders/ClassicMtgDecoder.cc                  |    2 +-
 src/decoders/ClassicMtgDecoder.h                   |    2 +-
 src/decoders/EpsBufr.cc                            |   55 +-
 src/decoders/EpsXmlInput.h                         |    2 +-
 src/decoders/EpsgramDecoder.cc                     |    2 +-
 src/decoders/EpsgramDecoder.h                      |    2 +-
 src/decoders/GeoPointsDecoder.cc                   |   33 +-
 src/decoders/GribAddressMode.h                     |   30 +-
 src/decoders/GribDecoder.cc                        | 3681 ++++++++++----------
 src/decoders/GribDecoder.h                         |  133 +-
 src/decoders/GribInterpretor.h                     |   31 +
 src/decoders/GribRegularInterpretor.cc             | 3272 +++++++++--------
 src/decoders/GribRegularInterpretor.h              |    6 +
 src/decoders/GribSatelliteInterpretor.cc           |   12 +-
 src/decoders/ImportAction.h                        |    2 +-
 src/decoders/InputData.cc                          |   21 +-
 src/decoders/InputMatrix.cc                        |   12 +-
 src/decoders/InputMatrix.h                         |    3 +-
 src/decoders/InputMatrixInterpretor.cc             |   27 +-
 src/decoders/LandgramDecoder.cc                    |    2 +-
 src/decoders/MatrixTestDecoder.cc                  |    2 +-
 src/decoders/MatrixTestDecoder.h                   |   27 +-
 src/decoders/Netcdf.cc                             |    4 +-
 src/decoders/NetcdfDecoder.h                       |    3 +-
 src/decoders/NetcdfGeoMatrixInterpretor.cc         |    8 +-
 src/decoders/NetcdfGeoMatrixInterpretor.h          |    2 +-
 src/decoders/NetcdfGeopointsInterpretor.cc         |    2 +-
 src/decoders/NetcdfGeopointsInterpretor.h          |   80 +-
 src/decoders/NetcdfInterpretor.cc                  |   18 +-
 src/decoders/NetcdfInterpretor.h                   |    2 +-
 src/decoders/NetcdfMatrixInterpretor.cc            |   35 +-
 src/decoders/NetcdfMatrixInterpretor.h             |    1 +
 src/decoders/NetcdfOrcaInterpretor.cc              |   36 +-
 src/decoders/NetcdfOrcaInterpretor.h               |    3 +-
 src/decoders/NetcdfVectorInterpretor.cc            |   62 +-
 src/decoders/NetcdfVectorInterpretor.h             |    4 +-
 src/decoders/ObsDecoder.cc                         |    2 +-
 src/decoders/ShapeDecoder.cc                       |  149 +-
 src/decoders/ShapeDecoder.h                        |   23 +-
 src/decoders/TitleTemplate.h                       |    2 +-
 src/decoders/dbfopen.c                             | 1480 ++++++--
 src/decoders/safileio.c                            |  286 ++
 src/decoders/shapefil.h                            |  315 +-
 src/decoders/shpopen.c                             | 1013 ++++--
 src/drivers/BaseDriver.cc                          |  233 +-
 src/drivers/BaseDriverSymbols.h                    |   91 +-
 src/drivers/BaseDriverWind.h                       |   32 +-
 src/drivers/BinaryDriver.cc                        |    2 +-
 src/drivers/CMakeLists.txt                         |  113 +-
 src/drivers/CairoDriver.cc                         |  241 +-
 src/drivers/CairoDriver.h                          |    7 +-
 src/drivers/GeoJsonDriver.cc                       |  654 ++++
 src/drivers/GeoJsonDriver.h                        |  142 +
 src/drivers/KMLDriver.cc                           |   16 +-
 src/drivers/MgQ/MgQLayoutItem.cc                   |   15 +-
 src/drivers/MgQ/MgQLayoutItem.h                    |    5 +-
 src/drivers/MgQ/MgQPolylineSetItem.cc              |    2 +-
 src/drivers/MgQ/MgQScene.cc                        |   33 +-
 src/drivers/MgQ/MgQSceneItem.cc                    |    2 +-
 src/drivers/PostScriptDriver.cc                    |   13 +-
 src/drivers/QtDriver.cc                            |  136 +-
 src/drivers/SVGDriver.cc                           |  124 +-
 src/drivers/libimagequant/CHANGELOG                |  130 +
 src/drivers/libimagequant/COPYRIGHT                |   36 +
 src/drivers/libimagequant/MANUAL.md                |  511 +++
 src/drivers/libimagequant/Makefile                 |   63 +
 src/drivers/libimagequant/blur.c                   |  119 +
 src/drivers/libimagequant/blur.h                   |    4 +
 src/drivers/libimagequant/configure                |  216 ++
 src/drivers/libimagequant/libimagequant.c          | 1752 ++++++++++
 src/drivers/libimagequant/libimagequant.h          |  118 +
 src/drivers/libimagequant/mediancut.c              |  507 +++
 src/drivers/libimagequant/mediancut.h              |    2 +
 src/drivers/libimagequant/mempool.c                |   68 +
 src/drivers/libimagequant/mempool.h                |   13 +
 src/drivers/libimagequant/nearest.c                |  193 +
 src/drivers/libimagequant/nearest.h                |    8 +
 src/drivers/libimagequant/pam.c                    |  273 ++
 src/drivers/libimagequant/pam.h                    |  273 ++
 src/drivers/libimagequant/pngquant.c               |  295 ++
 src/drivers/libimagequant/pngquant.h               |   71 +
 src/drivers/libimagequant/rwpng.c                  |  620 ++++
 src/drivers/libimagequant/rwpng.h                  |  125 +
 src/drivers/libimagequant/viter.c                  |   96 +
 src/drivers/libimagequant/viter.h                  |   19 +
 src/drivers/minizip/zip.c                          |    4 +-
 src/eckit_readers/CMakeLists.txt                   |    2 +-
 src/eckit_readers/MvPrepBufrPrep.cc                |    2 +-
 src/eckit_readers/TableReader.cc                   |    2 +-
 src/libMagWrapper/MagPlus.cc                       |  427 ++-
 src/libMagWrapper/MagPlus.h                        |    6 +-
 src/libMagWrapper/MagRequest.h                     |    4 +-
 src/magics.h                                       |    7 +-
 src/magics.pc.in                                   |   13 -
 src/magics_config.h.in                             |   20 +-
 src/oda/OdaDecoder.cc                              |   14 +-
 src/params/BaseDriver.xml                          |   43 +-
 src/params/CMakeLists.txt                          |   12 +-
 src/params/CairoDriver.xml                         |    8 +-
 src/params/EpsGraph.xml                            |   12 +-
 src/params/FortranViewNode.xml                     |    4 +
 src/params/GeoJSon.xml                             |   15 +
 src/params/GeoJsonDriver.xml                       |   28 +
 src/params/GeoPointsDecoder.xml                    |    3 +
 src/params/GribDecoder.xml                         |    8 +-
 src/params/GribLoop.xml                            |   19 +-
 src/params/InputMatrix.xml                         |    4 +
 src/params/LabelPlotting.xml                       |   19 +-
 src/params/LegendVisitor.xml                       |    6 +-
 src/params/MarkerShadingTechnique.xml              |   13 +-
 src/params/NetcdfInterpretor.xml                   |    8 +-
 src/params/ObsPlotting.xml                         |    6 +-
 src/params/OutputHandler.xml                       |    8 +-
 src/params/PageID.xml                              |   52 +-
 src/params/SVGDriver.xml                           |    4 +-
 src/params/Streamlines.xml                         |   38 +-
 src/params/SymbolAdvancedTableMode.xml             |    5 +-
 src/params/SymbolIndividualMode.xml                |    4 +-
 src/params/SymbolPlotting.xml                      |   23 +-
 src/params/TextVisitor.xml                         |    4 +-
 src/params/WrepJSon.xml                            |    5 +-
 src/terralib/kernel/TeCentroid.cpp                 |    2 +-
 src/terralib/kernel/TeDatabase.cpp                 |    9 +-
 src/terralib/kernel/TeDecoderDatabase.cpp          |    4 +-
 src/terralib/kernel/TeDecoderDatabase.h            |    2 +-
 src/terralib/kernel/TeDecoderMemoryMap.cpp         |    2 +-
 src/terralib/kernel/TeProjection.cpp               |    1 +
 src/terralib/kernel/TeProxMatrixImplementation.cpp |   14 +-
 src/terralib/kernel/TeRaster.cpp                   |    4 +-
 src/terralib/kernel/TeStdFile.h                    |    2 +-
 src/terralib/kernel/TeTin.cpp                      |    2 +-
 src/terralib/kernel/TeUtils.cpp                    |    4 +-
 src/terralib/kernel/yyTemporal.cpp                 |    4 +-
 src/visualisers/AxisMethod.h                       |    2 +-
 src/visualisers/Boundaries.cc                      |    8 +-
 src/visualisers/CMakeLists.txt                     |    2 +-
 src/visualisers/CalcStreamlines.cc                 |   12 +-
 src/visualisers/CalcStreamlines.h                  |    2 +
 src/visualisers/Cities.cc                          |    4 +-
 src/visualisers/CoastPlotting.cc                   |  206 +-
 src/visualisers/CoastPlotting.h                    |   24 +-
 src/visualisers/Coastlines.cc                      |    2 +-
 src/visualisers/Contour.cc                         |    3 +
 src/visualisers/ContourLibrary.cc                  |   30 +-
 src/visualisers/ContourLibrary.h                   |   18 +-
 src/visualisers/CountSelectionType.cc              |   13 +-
 src/visualisers/EpsGraph.cc                        |  201 +-
 src/visualisers/EpsGraph.h                         |    2 +-
 src/visualisers/Filter.h                           |   20 +-
 src/visualisers/HeightTechnique.cc                 |    2 +-
 src/visualisers/Histogram.h                        |    2 +-
 src/visualisers/IsoHelper.cc                       |    2 +-
 src/visualisers/IsoHighlight.h                     |    2 +-
 src/visualisers/IsoPlot.cc                         |  104 +-
 src/visualisers/IsoPlot.h                          |    4 +-
 src/visualisers/LabelPlotting.h                    |    5 +-
 src/visualisers/LevelSelection.cc                  |   11 +-
 src/visualisers/MarkerShadingTechnique.cc          |   22 +-
 src/visualisers/MetgramStyle.cc                    |    8 +-
 src/visualisers/ObsItem.h                          |   22 +-
 src/visualisers/ObsItemFamily.cc                   |  402 ++-
 src/visualisers/ObsItemFamily.h                    |   34 +-
 src/visualisers/ObsPlotting.cc                     |    3 +
 src/visualisers/ObsTable.cc                        |    3 +-
 src/visualisers/SegmentJoiner.cc                   |    4 +-
 src/visualisers/SegmentJoiner.h                    |    3 +-
 src/visualisers/ShadingTechnique.h                 |    2 +-
 src/visualisers/Streamlines.cc                     |   97 +-
 src/visualisers/SymbolAdvancedTableMode.cc         |   44 +-
 src/visualisers/SymbolMode.cc                      |    5 +-
 src/visualisers/SymbolPlotting.cc                  |    6 +-
 src/visualisers/SymbolPlotting.h                   |    2 +-
 src/visualisers/Wind.cc                            |    4 +-
 src/visualisers/WindPlotting.h                     |    4 +-
 src/web/CMakeLists.txt                             |    1 +
 src/web/GeoJSon.cc                                 |  135 +
 src/{decoders/BoxPlotDecoder.h => web/GeoJSon.h}   |   73 +-
 src/web/MagJSon.cc                                 |   54 +-
 src/web/MagJSon.h                                  |   11 +
 src/web/ObsJSon.cc                                 |    8 +-
 src/web/ObsJSon.h                                  |    2 +-
 src/web/WrepJSon.cc                                |  117 +-
 src/web/WrepJSon.h                                 |   11 +-
 test/CMakeLists.txt                                |  160 +-
 test/Testing/Temporary/CTestCostData.txt           |    1 -
 tools/xml2cc_new.pl                                |    5 +-
 tools/xml2mv.pl                                    |    3 +
 utils/GRA01130000012300001                         |  Bin 0 -> 19200 bytes
 utils/bufrgram.py                                  |  324 ++
 utils/epsgrams.py                                  |  424 +++
 utils/plumes.py                                    |  676 ++++
 611 files changed, 35809 insertions(+), 12238 deletions(-)

diff --cc debian/changelog
index d27686f,1e3089d..01cd8de
--- a/debian/changelog
+++ b/debian/changelog
@@@ -1,6 -1,61 +1,68 @@@
 -magics++ (2.28.0-3) UNRELEASED; urgency=medium
++magics++ (2.28.0-4) experimental; urgency=medium
++
++  * Add Python3 support.
++  * Update numpy.i from numpy.git for python3
++
++ -- Alastair McKinstry <mckinstry at debian.org>  Tue, 14 Jun 2016 08:57:36 +0100
++
++magics++ (2.28.0-3) unstable; urgency=medium
+ 
+   * Transition to openjpeg2. Closes: #826820
+   * g++6, unique_ptr compilation fixes
+ 
+  -- Alastair McKinstry <mckinstry at debian.org>  Thu, 09 Jun 2016 15:05:00 +0100
+ 
+ magics++ (2.28.0-2) unstable; urgency=medium
+ 
+   * Standards-Version: 3.9.8
+   * Fix incorrect libgfortran path shipped in cmake files.	
+ 
+  -- Alastair McKinstry <mckinstry at debian.org>  Wed, 25 May 2016 17:46:52 +0100
+ 
+ magics++ (2.28.0-1) unstable; urgency=medium
+ 
+   * New upstream release.
+   * Refresh patches:
+     - compile-fixes.patch: fixed upstream
+ 
+  -- Alastair McKinstry <mckinstry at debian.org>  Tue, 29 Mar 2016 07:44:16 +0000
+ 
+ magics++ (2.26.2-3) unstable; urgency=medium
+ 
+   * Build against openjpeg, not jasper, as jasper is being dropped
+     from Debian (long-dead, insecure).
+   * Link against grib-api >= 1.14.5-2 to pick up its jasper change.
+   * Standards-Version: 3.9.7
+ 
+  -- Alastair McKinstry <mckinstry at debian.org>  Mon, 29 Feb 2016 09:42:13 +0000
+ 
+ magics++ (2.26.2-2) unstable; urgency=medium
+ 
+   * Depend on libgrib-api-dev >= 1.14.4-5 to pull in its
+     Build-dependencies.
+ 
+  -- Alastair McKinstry <mckinstry at debian.org>  Thu, 14 Jan 2016 06:58:14 +0000
+ 
+ magics++ (2.26.2-1) unstable; urgency=medium
+ 
+   * New upstream release.
+   * Patches merged upstream / obsoleted:
+     magics-config.patch
+     qt5.patch
+     cve-2010-3393.patch
+     grib-cmake.patch
+   * reproducibility: set LC_ALL=C.UTF-8 when sorting in build
+   * B-D on libgrib-api-dev >= 1.14.4-2 for cmake config files.
+   * B-D on libaec-dev now needed for this, too
+   * Enable GEOTIFF support
+   * Enable tests
+   * Enable parallel builds.
+ 
+  -- Alastair McKinstry <mckinstry at debian.org>  Sun, 10 Jan 2016 02:01:33 +0000
+ 
  magics++ (2.24.7-7) unstable; urgency=medium
  
-   * ABI transition needed for libstdc++ v5, to libmagplusv5. Closes: #797981. 
+   * ABI transition needed for libstdc++ v5, to libmagplusv5. Closes: #797981.
  
   -- Alastair McKinstry <mckinstry at debian.org>  Sun, 06 Sep 2015 08:07:24 +0100
  
diff --cc debian/patches/numpy-fixes.patch
index 0000000,0000000..32982ac
new file mode 100644
--- /dev/null
+++ b/debian/patches/numpy-fixes.patch
@@@ -1,0 -1,0 +1,2673 @@@
++Author: Alastair McKinstry <mckinstry at debian.org>
++Description: Update the numpy.i from a copy in numpy.git to add
++ python3 support
++Last-Updated: 2016-06-14
++Forwarded: no
++
++Index: magics++-2.28.0/python/Magics/numpy.i
++===================================================================
++--- magics++-2.28.0/python/Magics/numpy.i
+++++ magics++-2.28.0/python/Magics/numpy.i
++@@ -1,11 +1,46 @@
++ /* -*- C -*-  (not really, but good for syntax highlighting) */
+++
+++/*
+++ * Copyright (c) 2005-2015, NumPy Developers.
+++ * All rights reserved.
+++ *
+++ * Redistribution and use in source and binary forms, with or without
+++ * modification, are permitted provided that the following conditions are
+++ * met:
+++ *
+++ *     * Redistributions of source code must retain the above copyright
+++ *        notice, this list of conditions and the following disclaimer.
+++ *
+++ *     * Redistributions in binary form must reproduce the above
+++ *        copyright notice, this list of conditions and the following
+++ *        disclaimer in the documentation and/or other materials provided
+++ *        with the distribution.
+++ *
+++ *     * Neither the name of the NumPy Developers nor the names of any
+++ *        contributors may be used to endorse or promote products derived
+++ *        from this software without specific prior written permission.
+++ *
+++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+++ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+++ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+++ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+++ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+++ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+++ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+++ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+++ */
+++
++ #ifdef SWIGPYTHON
++ 
++ %{
++ #ifndef SWIG_FILE_WITH_INIT
++-#  define NO_IMPORT_ARRAY
+++#define NO_IMPORT_ARRAY
++ #endif
++ #include "stdio.h"
+++#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
++ #include <numpy/arrayobject.h>
++ %}
++ 
++@@ -13,56 +48,10 @@
++ 
++ %fragment("NumPy_Backward_Compatibility", "header")
++ {
++-/* Support older NumPy data type names
++-*/
++-%#if NDARRAY_VERSION < 0x01000000
++-%#define NPY_BOOL          PyArray_BOOL
++-%#define NPY_BYTE          PyArray_BYTE
++-%#define NPY_UBYTE         PyArray_UBYTE
++-%#define NPY_SHORT         PyArray_SHORT
++-%#define NPY_USHORT        PyArray_USHORT
++-%#define NPY_INT           PyArray_INT
++-%#define NPY_UINT          PyArray_UINT
++-%#define NPY_LONG          PyArray_LONG
++-%#define NPY_ULONG         PyArray_ULONG
++-%#define NPY_LONGLONG      PyArray_LONGLONG
++-%#define NPY_ULONGLONG     PyArray_ULONGLONG
++-%#define NPY_FLOAT         PyArray_FLOAT
++-%#define NPY_DOUBLE        PyArray_DOUBLE
++-%#define NPY_LONGDOUBLE    PyArray_LONGDOUBLE
++-%#define NPY_CFLOAT        PyArray_CFLOAT
++-%#define NPY_CDOUBLE       PyArray_CDOUBLE
++-%#define NPY_CLONGDOUBLE   PyArray_CLONGDOUBLE
++-%#define NPY_OBJECT        PyArray_OBJECT
++-%#define NPY_STRING        PyArray_STRING
++-%#define NPY_UNICODE       PyArray_UNICODE
++-%#define NPY_VOID          PyArray_VOID
++-%#define NPY_NTYPES        PyArray_NTYPES
++-%#define NPY_NOTYPE        PyArray_NOTYPE
++-%#define NPY_CHAR          PyArray_CHAR
++-%#define NPY_USERDEF       PyArray_USERDEF
++-%#define npy_intp          intp
++-
++-%#define NPY_MAX_BYTE      MAX_BYTE
++-%#define NPY_MIN_BYTE      MIN_BYTE
++-%#define NPY_MAX_UBYTE     MAX_UBYTE
++-%#define NPY_MAX_SHORT     MAX_SHORT
++-%#define NPY_MIN_SHORT     MIN_SHORT
++-%#define NPY_MAX_USHORT    MAX_USHORT
++-%#define NPY_MAX_INT       MAX_INT
++-%#define NPY_MIN_INT       MIN_INT
++-%#define NPY_MAX_UINT      MAX_UINT
++-%#define NPY_MAX_LONG      MAX_LONG
++-%#define NPY_MIN_LONG      MIN_LONG
++-%#define NPY_MAX_ULONG     MAX_ULONG
++-%#define NPY_MAX_LONGLONG  MAX_LONGLONG
++-%#define NPY_MIN_LONGLONG  MIN_LONGLONG
++-%#define NPY_MAX_ULONGLONG MAX_ULONGLONG
++-%#define NPY_MAX_INTP      MAX_INTP
++-%#define NPY_MIN_INTP      MIN_INTP
++-
++-%#define NPY_FARRAY        FARRAY
++-%#define NPY_F_CONTIGUOUS  F_CONTIGUOUS
+++%#if NPY_API_VERSION < 0x00000007
+++%#define NPY_ARRAY_DEFAULT NPY_DEFAULT
+++%#define NPY_ARRAY_FARRAY  NPY_FARRAY
+++%#define NPY_FORTRANORDER  NPY_FORTRAN
++ %#endif
++ }
++ 
++@@ -80,24 +69,45 @@
++ {
++ /* Macros to extract array attributes.
++  */
++-%#define is_array(a)            ((a) && PyArray_Check((PyArrayObject *)a))
++-%#define array_type(a)          (int)(PyArray_TYPE(a))
++-%#define array_numdims(a)       (((PyArrayObject *)a)->nd)
++-%#define array_dimensions(a)    (((PyArrayObject *)a)->dimensions)
++-%#define array_size(a,i)        (((PyArrayObject *)a)->dimensions[i])
++-%#define array_data(a)          (((PyArrayObject *)a)->data)
++-%#define array_is_contiguous(a) (PyArray_ISCONTIGUOUS(a))
++-%#define array_is_native(a)     (PyArray_ISNOTSWAPPED(a))
++-%#define array_is_fortran(a)    (PyArray_ISFORTRAN(a))
+++%#if NPY_API_VERSION < 0x00000007
+++%#define is_array(a)            ((a) && PyArray_Check((PyArrayObject*)a))
+++%#define array_type(a)          (int)(PyArray_TYPE((PyArrayObject*)a))
+++%#define array_numdims(a)       (((PyArrayObject*)a)->nd)
+++%#define array_dimensions(a)    (((PyArrayObject*)a)->dimensions)
+++%#define array_size(a,i)        (((PyArrayObject*)a)->dimensions[i])
+++%#define array_strides(a)       (((PyArrayObject*)a)->strides)
+++%#define array_stride(a,i)      (((PyArrayObject*)a)->strides[i])
+++%#define array_data(a)          (((PyArrayObject*)a)->data)
+++%#define array_descr(a)         (((PyArrayObject*)a)->descr)
+++%#define array_flags(a)         (((PyArrayObject*)a)->flags)
+++%#define array_enableflags(a,f) (((PyArrayObject*)a)->flags) = f
+++%#else
+++%#define is_array(a)            ((a) && PyArray_Check(a))
+++%#define array_type(a)          PyArray_TYPE((PyArrayObject*)a)
+++%#define array_numdims(a)       PyArray_NDIM((PyArrayObject*)a)
+++%#define array_dimensions(a)    PyArray_DIMS((PyArrayObject*)a)
+++%#define array_strides(a)       PyArray_STRIDES((PyArrayObject*)a)
+++%#define array_stride(a,i)      PyArray_STRIDE((PyArrayObject*)a,i)
+++%#define array_size(a,i)        PyArray_DIM((PyArrayObject*)a,i)
+++%#define array_data(a)          PyArray_DATA((PyArrayObject*)a)
+++%#define array_descr(a)         PyArray_DESCR((PyArrayObject*)a)
+++%#define array_flags(a)         PyArray_FLAGS((PyArrayObject*)a)
+++%#define array_enableflags(a,f) PyArray_ENABLEFLAGS((PyArrayObject*)a,f)
+++%#endif
+++%#define array_is_contiguous(a) (PyArray_ISCONTIGUOUS((PyArrayObject*)a))
+++%#define array_is_native(a)     (PyArray_ISNOTSWAPPED((PyArrayObject*)a))
+++%#define array_is_fortran(a)    (PyArray_IS_F_CONTIGUOUS((PyArrayObject*)a))
++ }
++ 
++ /**********************************************************************/
++ 
++-%fragment("NumPy_Utilities", "header")
+++%fragment("NumPy_Utilities",
+++          "header")
++ {
++   /* Given a PyObject, return a string describing its type.
++    */
++-  const char* pytype_string(PyObject* py_obj) {
+++  const char* pytype_string(PyObject* py_obj)
+++  {
++     if (py_obj == NULL          ) return "C NULL value";
++     if (py_obj == Py_None       ) return "Python None" ;
++     if (PyCallable_Check(py_obj)) return "callable"    ;
++@@ -107,40 +117,71 @@
++     if (PyDict_Check(    py_obj)) return "dict"        ;
++     if (PyList_Check(    py_obj)) return "list"        ;
++     if (PyTuple_Check(   py_obj)) return "tuple"       ;
+++%#if PY_MAJOR_VERSION < 3
++     if (PyFile_Check(    py_obj)) return "file"        ;
++     if (PyModule_Check(  py_obj)) return "module"      ;
++     if (PyInstance_Check(py_obj)) return "instance"    ;
+++%#endif
++ 
++     return "unknown type";
++   }
++ 
++   /* Given a NumPy typecode, return a string describing the type.
++    */
++-  const char* typecode_string(int typecode) {
++-    static const char* type_names[25] = {"bool", "byte", "unsigned byte",
++-                                   "short", "unsigned short", "int",
++-                                   "unsigned int", "long", "unsigned long",
++-                                   "long long", "unsigned long long",
++-                                   "float", "double", "long double",
++-                                   "complex float", "complex double",
++-                                   "complex long double", "object",
++-                                   "string", "unicode", "void", "ntypes",
++-                                   "notype", "char", "unknown"};
+++  const char* typecode_string(int typecode)
+++  {
+++    static const char* type_names[25] = {"bool",
+++                                         "byte",
+++                                         "unsigned byte",
+++                                         "short",
+++                                         "unsigned short",
+++                                         "int",
+++                                         "unsigned int",
+++                                         "long",
+++                                         "unsigned long",
+++                                         "long long",
+++                                         "unsigned long long",
+++                                         "float",
+++                                         "double",
+++                                         "long double",
+++                                         "complex float",
+++                                         "complex double",
+++                                         "complex long double",
+++                                         "object",
+++                                         "string",
+++                                         "unicode",
+++                                         "void",
+++                                         "ntypes",
+++                                         "notype",
+++                                         "char",
+++                                         "unknown"};
++     return typecode < 24 ? type_names[typecode] : type_names[24];
++   }
++ 
++-  /* Make sure input has correct numpy type.  Allow character and byte
++-   * to match.  Also allow int and long to match.  This is deprecated.
++-   * You should use PyArray_EquivTypenums() instead.
+++  /* Make sure input has correct numpy type.  This now just calls
+++     PyArray_EquivTypenums().
++    */
++-  int type_match(int actual_type, int desired_type) {
+++  int type_match(int actual_type,
+++                 int desired_type)
+++  {
++     return PyArray_EquivTypenums(actual_type, desired_type);
++   }
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++  void free_cap(PyObject * cap)
+++  {
+++    void* array = (void*) PyCapsule_GetPointer(cap,SWIGPY_CAPSULE_NAME);
+++    if (array != NULL) free(array);
+++  }
+++%#endif
+++
+++
++ }
++ 
++ /**********************************************************************/
++ 
++-%fragment("NumPy_Object_to_Array", "header",
+++%fragment("NumPy_Object_to_Array",
+++          "header",
++           fragment="NumPy_Backward_Compatibility",
++           fragment="NumPy_Macros",
++           fragment="NumPy_Utilities")
++@@ -149,7 +190,8 @@
++    * legal.  If not, set the python error string appropriately and
++    * return NULL.
++    */
++-  PyArrayObject* obj_to_array_no_conversion(PyObject* input, int typecode)
+++  PyArrayObject* obj_to_array_no_conversion(PyObject* input,
+++                                            int        typecode)
++   {
++     PyArrayObject* ary = NULL;
++     if (is_array(input) && (typecode == NPY_NOTYPE ||
++@@ -168,11 +210,12 @@
++     }
++     else
++     {
++-      const char * desired_type = typecode_string(typecode);
++-      const char * actual_type  = pytype_string(input);
+++      const char* desired_type = typecode_string(typecode);
+++      const char* actual_type  = pytype_string(input);
++       PyErr_Format(PyExc_TypeError,
++                    "Array of type '%s' required.  A '%s' was given",
++-                   desired_type, actual_type);
+++                   desired_type,
+++                   actual_type);
++       ary = NULL;
++     }
++     return ary;
++@@ -183,11 +226,12 @@
++    * correct type.  On failure, the python error string will be set and
++    * the routine returns NULL.
++    */
++-  PyArrayObject* obj_to_array_allow_conversion(PyObject* input, int typecode,
++-                                               int* is_new_object)
+++  PyArrayObject* obj_to_array_allow_conversion(PyObject* input,
+++                                               int       typecode,
+++                                               int*      is_new_object)
++   {
++     PyArrayObject* ary = NULL;
++-    PyObject* py_obj;
+++    PyObject*      py_obj;
++     if (is_array(input) && (typecode == NPY_NOTYPE ||
++                             PyArray_EquivTypenums(array_type(input),typecode)))
++     {
++@@ -196,7 +240,7 @@
++     }
++     else
++     {
++-      py_obj = PyArray_FROMANY(input, typecode, 0, 0, NPY_DEFAULT);
+++      py_obj = PyArray_FROMANY(input, typecode, 0, 0, NPY_ARRAY_DEFAULT);
++       /* If NULL, PyArray_FromObject will have set python error value.*/
++       ary = (PyArrayObject*) py_obj;
++       *is_new_object = 1;
++@@ -209,8 +253,10 @@
++    * not contiguous, create a new PyArrayObject using the original data,
++    * flag it as a new object and return the pointer.
++    */
++-  PyArrayObject* make_contiguous(PyArrayObject* ary, int* is_new_object,
++-                                 int min_dims, int max_dims)
+++  PyArrayObject* make_contiguous(PyArrayObject* ary,
+++                                 int*           is_new_object,
+++                                 int            min_dims,
+++                                 int            max_dims)
++   {
++     PyArrayObject* result;
++     if (array_is_contiguous(ary))
++@@ -221,9 +267,9 @@
++     else
++     {
++       result = (PyArrayObject*) PyArray_ContiguousFromObject((PyObject*)ary,
++-                                                             array_type(ary),
++-                                                             min_dims,
++-                                                             max_dims);
+++                                                              array_type(ary),
+++                                                              min_dims,
+++                                                              max_dims);
++       *is_new_object = 1;
++     }
++     return result;
++@@ -235,8 +281,8 @@
++    * PyArrayObject using the original data, flag it as a new object
++    * and return the pointer.
++    */
++-  PyArrayObject* make_fortran(PyArrayObject* ary, int* is_new_object,
++-                              int min_dims, int max_dims)
+++  PyArrayObject* make_fortran(PyArrayObject* ary,
+++                              int*           is_new_object)
++   {
++     PyArrayObject* result;
++     if (array_is_fortran(ary))
++@@ -246,8 +292,10 @@
++     }
++     else
++     {
++-      Py_INCREF(ary->descr);
++-      result = (PyArrayObject*) PyArray_FromArray(ary, ary->descr, NPY_FORTRAN);
+++      Py_INCREF(array_descr(ary));
+++      result = (PyArrayObject*) PyArray_FromArray(ary,
+++                                                  array_descr(ary),
+++                                                  NPY_ARRAY_F_CONTIGUOUS);
++       *is_new_object = 1;
++     }
++     return result;
++@@ -259,13 +307,14 @@
++    * will be set.
++    */
++   PyArrayObject* obj_to_array_contiguous_allow_conversion(PyObject* input,
++-                                                          int typecode,
++-                                                          int* is_new_object)
+++                                                          int       typecode,
+++                                                          int*      is_new_object)
++   {
++     int is_new1 = 0;
++     int is_new2 = 0;
++     PyArrayObject* ary2;
++-    PyArrayObject* ary1 = obj_to_array_allow_conversion(input, typecode,
+++    PyArrayObject* ary1 = obj_to_array_allow_conversion(input,
+++                                                        typecode,
++                                                         &is_new1);
++     if (ary1)
++     {
++@@ -286,17 +335,18 @@
++    * will be set.
++    */
++   PyArrayObject* obj_to_array_fortran_allow_conversion(PyObject* input,
++-                                                       int typecode,
++-                                                       int* is_new_object)
+++                                                       int       typecode,
+++                                                       int*      is_new_object)
++   {
++     int is_new1 = 0;
++     int is_new2 = 0;
++     PyArrayObject* ary2;
++-    PyArrayObject* ary1 = obj_to_array_allow_conversion(input, typecode,
+++    PyArrayObject* ary1 = obj_to_array_allow_conversion(input,
+++                                                        typecode,
++                                                         &is_new1);
++     if (ary1)
++     {
++-      ary2 = make_fortran(ary1, &is_new2, 0, 0);
+++      ary2 = make_fortran(ary1, &is_new2);
++       if (is_new1 && is_new2)
++       {
++         Py_DECREF(ary1);
++@@ -306,13 +356,12 @@
++     *is_new_object = is_new1 || is_new2;
++     return ary1;
++   }
++-
++ } /* end fragment */
++ 
++-
++ /**********************************************************************/
++ 
++-%fragment("NumPy_Array_Requirements", "header",
+++%fragment("NumPy_Array_Requirements",
+++          "header",
++           fragment="NumPy_Backward_Compatibility",
++           fragment="NumPy_Macros")
++ {
++@@ -332,6 +381,22 @@
++     return contiguous;
++   }
++ 
+++  /* Test whether a python object is (C_ or F_) contiguous.  If array is
+++   * contiguous, return 1.  Otherwise, set the python error string and
+++   * return 0.
+++   */
+++  int require_c_or_f_contiguous(PyArrayObject* ary)
+++  {
+++    int contiguous = 1;
+++    if (!(array_is_contiguous(ary) || array_is_fortran(ary)))
+++    {
+++      PyErr_SetString(PyExc_TypeError,
+++                      "Array must be contiguous (C_ or F_).  A non-contiguous array was given");
+++      contiguous = 0;
+++    }
+++    return contiguous;
+++  }
+++
++   /* Require that a numpy array is not byte-swapped.  If the array is
++    * not byte-swapped, return 1.  Otherwise, set the python error string
++    * and return 0.
++@@ -353,14 +418,16 @@
++    * dimensions.  If the array has the specified number of dimensions,
++    * return 1.  Otherwise, set the python error string and return 0.
++    */
++-  int require_dimensions(PyArrayObject* ary, int exact_dimensions)
+++  int require_dimensions(PyArrayObject* ary,
+++                         int            exact_dimensions)
++   {
++     int success = 1;
++     if (array_numdims(ary) != exact_dimensions)
++     {
++       PyErr_Format(PyExc_TypeError,
++                    "Array must have %d dimensions.  Given array has %d dimensions",
++-                   exact_dimensions, array_numdims(ary));
+++                   exact_dimensions,
+++                   array_numdims(ary));
++       success = 0;
++     }
++     return success;
++@@ -371,7 +438,9 @@
++    * of dimensions, return 1.  Otherwise, set the python error string
++    * and return 0.
++    */
++-  int require_dimensions_n(PyArrayObject* ary, int* exact_dimensions, int n)
+++  int require_dimensions_n(PyArrayObject* ary,
+++                           int*           exact_dimensions,
+++                           int            n)
++   {
++     int success = 0;
++     int i;
++@@ -395,7 +464,8 @@
++       strcat(dims_str,s);
++       PyErr_Format(PyExc_TypeError,
++                    "Array must have %s dimensions.  Given array has %d dimensions",
++-                   dims_str, array_numdims(ary));
+++                   dims_str,
+++                   array_numdims(ary));
++     }
++     return success;
++   }
++@@ -404,7 +474,9 @@
++    * array has the specified shape, return 1.  Otherwise, set the python
++    * error string and return 0.
++    */
++-  int require_size(PyArrayObject* ary, npy_intp* size, int n)
+++  int require_size(PyArrayObject* ary,
+++                   npy_intp*      size,
+++                   int            n)
++   {
++     int i;
++     int success = 1;
++@@ -444,104 +516,152 @@
++       actual_dims[len-1] = ']';
++       PyErr_Format(PyExc_TypeError,
++                    "Array must have shape of %s.  Given array has shape of %s",
++-                   desired_dims, actual_dims);
+++                   desired_dims,
+++                   actual_dims);
++     }
++     return success;
++   }
++ 
++-  /* Require the given PyArrayObject to to be FORTRAN ordered.  If the
++-   * the PyArrayObject is already FORTRAN ordered, do nothing.  Else,
++-   * set the FORTRAN ordering flag and recompute the strides.
+++  /* Require the given PyArrayObject to to be Fortran ordered.  If the
+++   * the PyArrayObject is already Fortran ordered, do nothing.  Else,
+++   * set the Fortran ordering flag and recompute the strides.
++    */
++   int require_fortran(PyArrayObject* ary)
++   {
++     int success = 1;
++     int nd = array_numdims(ary);
++     int i;
+++    npy_intp * strides = array_strides(ary);
++     if (array_is_fortran(ary)) return success;
++-    /* Set the FORTRAN ordered flag */
++-    ary->flags = NPY_FARRAY;
+++    /* Set the Fortran ordered flag */
+++    array_enableflags(ary,NPY_ARRAY_FARRAY);
++     /* Recompute the strides */
++-    ary->strides[0] = ary->strides[nd-1];
+++    strides[0] = strides[nd-1];
++     for (i=1; i < nd; ++i)
++-      ary->strides[i] = ary->strides[i-1] * array_size(ary,i-1);
+++      strides[i] = strides[i-1] * array_size(ary,i-1);
++     return success;
++   }
++ }
++ 
++ /* Combine all NumPy fragments into one for convenience */
++-%fragment("NumPy_Fragments", "header",
+++%fragment("NumPy_Fragments",
+++          "header",
++           fragment="NumPy_Backward_Compatibility",
++           fragment="NumPy_Macros",
++           fragment="NumPy_Utilities",
++           fragment="NumPy_Object_to_Array",
++-          fragment="NumPy_Array_Requirements") { }
+++          fragment="NumPy_Array_Requirements")
+++{
+++}
++ 
++ /* End John Hunter translation (with modifications by Bill Spotz)
++  */
++ 
++ /* %numpy_typemaps() macro
++  *
++- * This macro defines a family of 41 typemaps that allow C arguments
+++ * This macro defines a family of 75 typemaps that allow C arguments
++  * of the form
++  *
++- *     (DATA_TYPE IN_ARRAY1[ANY])
++- *     (DATA_TYPE* IN_ARRAY1, DIM_TYPE DIM1)
++- *     (DIM_TYPE DIM1, DATA_TYPE* IN_ARRAY1)
++- *
++- *     (DATA_TYPE IN_ARRAY2[ANY][ANY])
++- *     (DATA_TYPE* IN_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
++- *     (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_ARRAY2)
++- *     (DATA_TYPE* IN_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
++- *     (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_FARRAY2)
++- *
++- *     (DATA_TYPE IN_ARRAY3[ANY][ANY][ANY])
++- *     (DATA_TYPE* IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
++- *     (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_ARRAY3)
++- *     (DATA_TYPE* IN_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
++- *     (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_FARRAY3)
++- *
++- *     (DATA_TYPE INPLACE_ARRAY1[ANY])
++- *     (DATA_TYPE* INPLACE_ARRAY1, DIM_TYPE DIM1)
++- *     (DIM_TYPE DIM1, DATA_TYPE* INPLACE_ARRAY1)
++- *
++- *     (DATA_TYPE INPLACE_ARRAY2[ANY][ANY])
++- *     (DATA_TYPE* INPLACE_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
++- *     (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_ARRAY2)
++- *     (DATA_TYPE* INPLACE_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
++- *     (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_FARRAY2)
++- *
++- *     (DATA_TYPE INPLACE_ARRAY3[ANY][ANY][ANY])
++- *     (DATA_TYPE* INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
++- *     (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_ARRAY3)
++- *     (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
++- *     (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_FARRAY3)
++- *
++- *     (DATA_TYPE ARGOUT_ARRAY1[ANY])
++- *     (DATA_TYPE* ARGOUT_ARRAY1, DIM_TYPE DIM1)
++- *     (DIM_TYPE DIM1, DATA_TYPE* ARGOUT_ARRAY1)
++- *
++- *     (DATA_TYPE ARGOUT_ARRAY2[ANY][ANY])
++- *
++- *     (DATA_TYPE ARGOUT_ARRAY3[ANY][ANY][ANY])
++- *
++- *     (DATA_TYPE** ARGOUTVIEW_ARRAY1, DIM_TYPE* DIM1)
++- *     (DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEW_ARRAY1)
++- *
++- *     (DATA_TYPE** ARGOUTVIEW_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
++- *     (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_ARRAY2)
++- *     (DATA_TYPE** ARGOUTVIEW_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
++- *     (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_FARRAY2)
++- *
++- *     (DATA_TYPE** ARGOUTVIEW_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
++- *     (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_ARRAY3)
++- *     (DATA_TYPE** ARGOUTVIEW_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
++- *     (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_FARRAY3)
+++ *    1. (DATA_TYPE IN_ARRAY1[ANY])
+++ *    2. (DATA_TYPE* IN_ARRAY1, DIM_TYPE DIM1)
+++ *    3. (DIM_TYPE DIM1, DATA_TYPE* IN_ARRAY1)
+++ *
+++ *    4. (DATA_TYPE IN_ARRAY2[ANY][ANY])
+++ *    5. (DATA_TYPE* IN_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
+++ *    6. (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_ARRAY2)
+++ *    7. (DATA_TYPE* IN_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
+++ *    8. (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* IN_FARRAY2)
+++ *
+++ *    9. (DATA_TYPE IN_ARRAY3[ANY][ANY][ANY])
+++ *   10. (DATA_TYPE* IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
+++ *   11. (DATA_TYPE** IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
+++ *   12. (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_ARRAY3)
+++ *   13. (DATA_TYPE* IN_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
+++ *   14. (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* IN_FARRAY3)
+++ *
+++ *   15. (DATA_TYPE IN_ARRAY4[ANY][ANY][ANY][ANY])
+++ *   16. (DATA_TYPE* IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++ *   17. (DATA_TYPE** IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++ *   18. (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, , DIM_TYPE DIM4, DATA_TYPE* IN_ARRAY4)
+++ *   19. (DATA_TYPE* IN_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++ *   20. (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* IN_FARRAY4)
+++ *
+++ *   21. (DATA_TYPE INPLACE_ARRAY1[ANY])
+++ *   22. (DATA_TYPE* INPLACE_ARRAY1, DIM_TYPE DIM1)
+++ *   23. (DIM_TYPE DIM1, DATA_TYPE* INPLACE_ARRAY1)
+++ *
+++ *   24. (DATA_TYPE INPLACE_ARRAY2[ANY][ANY])
+++ *   25. (DATA_TYPE* INPLACE_ARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
+++ *   26. (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_ARRAY2)
+++ *   27. (DATA_TYPE* INPLACE_FARRAY2, DIM_TYPE DIM1, DIM_TYPE DIM2)
+++ *   28. (DIM_TYPE DIM1, DIM_TYPE DIM2, DATA_TYPE* INPLACE_FARRAY2)
+++ *
+++ *   29. (DATA_TYPE INPLACE_ARRAY3[ANY][ANY][ANY])
+++ *   30. (DATA_TYPE* INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
+++ *   31. (DATA_TYPE** INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
+++ *   32. (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_ARRAY3)
+++ *   33. (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
+++ *   34. (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_FARRAY3)
+++ *
+++ *   35. (DATA_TYPE INPLACE_ARRAY4[ANY][ANY][ANY][ANY])
+++ *   36. (DATA_TYPE* INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++ *   37. (DATA_TYPE** INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++ *   38. (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* INPLACE_ARRAY4)
+++ *   39. (DATA_TYPE* INPLACE_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++ *   40. (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* INPLACE_FARRAY4)
+++ *
+++ *   41. (DATA_TYPE ARGOUT_ARRAY1[ANY])
+++ *   42. (DATA_TYPE* ARGOUT_ARRAY1, DIM_TYPE DIM1)
+++ *   43. (DIM_TYPE DIM1, DATA_TYPE* ARGOUT_ARRAY1)
+++ *
+++ *   44. (DATA_TYPE ARGOUT_ARRAY2[ANY][ANY])
+++ *
+++ *   45. (DATA_TYPE ARGOUT_ARRAY3[ANY][ANY][ANY])
+++ *
+++ *   46. (DATA_TYPE ARGOUT_ARRAY4[ANY][ANY][ANY][ANY])
+++ *
+++ *   47. (DATA_TYPE** ARGOUTVIEW_ARRAY1, DIM_TYPE* DIM1)
+++ *   48. (DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEW_ARRAY1)
+++ *
+++ *   49. (DATA_TYPE** ARGOUTVIEW_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
+++ *   50. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_ARRAY2)
+++ *   51. (DATA_TYPE** ARGOUTVIEW_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
+++ *   52. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_FARRAY2)
+++ *
+++ *   53. (DATA_TYPE** ARGOUTVIEW_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
+++ *   54. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_ARRAY3)
+++ *   55. (DATA_TYPE** ARGOUTVIEW_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
+++ *   56. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_FARRAY3)
+++ *
+++ *   57. (DATA_TYPE** ARGOUTVIEW_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4)
+++ *   58. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEW_ARRAY4)
+++ *   59. (DATA_TYPE** ARGOUTVIEW_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4)
+++ *   60. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEW_FARRAY4)
+++ *
+++ *   61. (DATA_TYPE** ARGOUTVIEWM_ARRAY1, DIM_TYPE* DIM1)
+++ *   62. (DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEWM_ARRAY1)
+++ *
+++ *   63. (DATA_TYPE** ARGOUTVIEWM_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
+++ *   64. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEWM_ARRAY2)
+++ *   65. (DATA_TYPE** ARGOUTVIEWM_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
+++ *   66. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEWM_FARRAY2)
+++ *
+++ *   67. (DATA_TYPE** ARGOUTVIEWM_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
+++ *   68. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEWM_ARRAY3)
+++ *   69. (DATA_TYPE** ARGOUTVIEWM_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
+++ *   70. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEWM_FARRAY3)
+++ *
+++ *   71. (DATA_TYPE** ARGOUTVIEWM_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4)
+++ *   72. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_ARRAY4)
+++ *   73. (DATA_TYPE** ARGOUTVIEWM_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4)
+++ *   74. (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_FARRAY4)
+++ *
+++ *   75. (DATA_TYPE* INPLACE_ARRAY_FLAT, DIM_TYPE DIM_FLAT)
++  *
++  * where "DATA_TYPE" is any type supported by the NumPy module, and
++  * "DIM_TYPE" is any int-like type suitable for specifying dimensions.
++  * The difference between "ARRAY" typemaps and "FARRAY" typemaps is
++- * that the "FARRAY" typemaps expect FORTRAN ordering of
+++ * that the "FARRAY" typemaps expect Fortran ordering of
++  * multidimensional arrays.  In python, the dimensions will not need
++  * to be specified (except for the "DATA_TYPE* ARGOUT_ARRAY1"
++  * typemaps).  The IN_ARRAYs can be a numpy array or any sequence that
++@@ -601,7 +721,8 @@
++   (PyArrayObject* array=NULL, int is_new_object=0)
++ {
++   npy_intp size[1] = { $1_dim0 };
++-  array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+++  array = obj_to_array_contiguous_allow_conversion($input,
+++                                                   DATA_TYPECODE,
++                                                    &is_new_object);
++   if (!array || !require_dimensions(array, 1) ||
++       !require_size(array, size, 1)) SWIG_fail;
++@@ -628,7 +749,8 @@
++   (PyArrayObject* array=NULL, int is_new_object=0)
++ {
++   npy_intp size[1] = { -1 };
++-  array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+++  array = obj_to_array_contiguous_allow_conversion($input,
+++                                                   DATA_TYPECODE,
++                                                    &is_new_object);
++   if (!array || !require_dimensions(array, 1) ||
++       !require_size(array, size, 1)) SWIG_fail;
++@@ -656,7 +778,8 @@
++   (PyArrayObject* array=NULL, int is_new_object=0)
++ {
++   npy_intp size[1] = {-1};
++-  array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+++  array = obj_to_array_contiguous_allow_conversion($input,
+++                                                   DATA_TYPECODE,
++                                                    &is_new_object);
++   if (!array || !require_dimensions(array, 1) ||
++       !require_size(array, size, 1)) SWIG_fail;
++@@ -684,7 +807,8 @@
++   (PyArrayObject* array=NULL, int is_new_object=0)
++ {
++   npy_intp size[2] = { $1_dim0, $1_dim1 };
++-  array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+++  array = obj_to_array_contiguous_allow_conversion($input,
+++                                                   DATA_TYPECODE,
++                                                    &is_new_object);
++   if (!array || !require_dimensions(array, 2) ||
++       !require_size(array, size, 2)) SWIG_fail;
++@@ -740,7 +864,8 @@
++   (PyArrayObject* array=NULL, int is_new_object=0)
++ {
++   npy_intp size[2] = { -1, -1 };
++-  array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+++  array = obj_to_array_contiguous_allow_conversion($input,
+++                                                   DATA_TYPECODE,
++                                                    &is_new_object);
++   if (!array || !require_dimensions(array, 2) ||
++       !require_size(array, size, 2)) SWIG_fail;
++@@ -769,7 +894,8 @@
++   (PyArrayObject* array=NULL, int is_new_object=0)
++ {
++   npy_intp size[2] = { -1, -1 };
++-  array = obj_to_array_fortran_allow_conversion($input, DATA_TYPECODE,
+++  array = obj_to_array_fortran_allow_conversion($input,
+++                                                DATA_TYPECODE,
++                                                 &is_new_object);
++   if (!array || !require_dimensions(array, 2) ||
++       !require_size(array, size, 2) || !require_fortran(array)) SWIG_fail;
++@@ -798,7 +924,8 @@
++   (PyArrayObject* array=NULL, int is_new_object=0)
++ {
++   npy_intp size[2] = { -1, -1 };
++-  array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+++  array = obj_to_array_fortran_allow_conversion($input,
+++                                                   DATA_TYPECODE,
++                                                    &is_new_object);
++   if (!array || !require_dimensions(array, 2) ||
++       !require_size(array, size, 2) || !require_fortran(array)) SWIG_fail;
++@@ -827,7 +954,8 @@
++   (PyArrayObject* array=NULL, int is_new_object=0)
++ {
++   npy_intp size[3] = { $1_dim0, $1_dim1, $1_dim2 };
++-  array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+++  array = obj_to_array_contiguous_allow_conversion($input,
+++                                                   DATA_TYPECODE,
++                                                    &is_new_object);
++   if (!array || !require_dimensions(array, 3) ||
++       !require_size(array, size, 3)) SWIG_fail;
++@@ -871,6 +999,88 @@
++     { Py_DECREF(array$argnum); }
++ }
++ 
+++/* Typemap suite for (DATA_TYPE** IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2,
+++ *                    DIM_TYPE DIM3)
+++ */
+++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
+++           fragment="NumPy_Macros")
+++  (DATA_TYPE** IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
+++{
+++  /* for now, only concerned with lists */
+++  $1 = PySequence_Check($input);
+++}
+++%typemap(in,
+++         fragment="NumPy_Fragments")
+++  (DATA_TYPE** IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
+++  (DATA_TYPE** array=NULL, PyArrayObject** object_array=NULL, int* is_new_object_array=NULL)
+++{
+++  npy_intp size[2] = { -1, -1 };
+++  PyArrayObject* temp_array;
+++  Py_ssize_t i;
+++  int is_new_object;
+++
+++  /* length of the list */
+++  $2 = PyList_Size($input);
+++
+++  /* the arrays */
+++  array = (DATA_TYPE **)malloc($2*sizeof(DATA_TYPE *));
+++  object_array = (PyArrayObject **)calloc($2,sizeof(PyArrayObject *));
+++  is_new_object_array = (int *)calloc($2,sizeof(int));
+++
+++  if (array == NULL || object_array == NULL || is_new_object_array == NULL)
+++  {
+++    SWIG_fail;
+++  }
+++
+++  for (i=0; i<$2; i++)
+++  {
+++    temp_array = obj_to_array_contiguous_allow_conversion(PySequence_GetItem($input,i), DATA_TYPECODE, &is_new_object);
+++
+++    /* the new array must be stored so that it can be destroyed in freearg */
+++    object_array[i] = temp_array;
+++    is_new_object_array[i] = is_new_object;
+++
+++    if (!temp_array || !require_dimensions(temp_array, 2)) SWIG_fail;
+++
+++    /* store the size of the first array in the list, then use that for comparison. */
+++    if (i == 0)
+++    {
+++      size[0] = array_size(temp_array,0);
+++      size[1] = array_size(temp_array,1);
+++    }
+++
+++    if (!require_size(temp_array, size, 2)) SWIG_fail;
+++
+++    array[i] = (DATA_TYPE*) array_data(temp_array);
+++  }
+++
+++  $1 = (DATA_TYPE**) array;
+++  $3 = (DIM_TYPE) size[0];
+++  $4 = (DIM_TYPE) size[1];
+++}
+++%typemap(freearg)
+++  (DATA_TYPE** IN_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
+++{
+++  Py_ssize_t i;
+++
+++  if (array$argnum!=NULL) free(array$argnum);
+++
+++  /*freeing the individual arrays if needed */
+++  if (object_array$argnum!=NULL)
+++  {
+++    if (is_new_object_array$argnum!=NULL)
+++    {
+++      for (i=0; i<$2; i++)
+++      {
+++        if (object_array$argnum[i] != NULL && is_new_object_array$argnum[i])
+++        { Py_DECREF(object_array$argnum[i]); }
+++      }
+++      free(is_new_object_array$argnum);
+++    }
+++    free(object_array$argnum);
+++  }
+++}
+++
++ /* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3,
++  *                    DATA_TYPE* IN_ARRAY3)
++  */
++@@ -948,7 +1158,8 @@
++   (PyArrayObject* array=NULL, int is_new_object=0)
++ {
++   npy_intp size[3] = { -1, -1, -1 };
++-  array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+++  array = obj_to_array_fortran_allow_conversion($input,
+++                                                   DATA_TYPECODE,
++                                                    &is_new_object);
++   if (!array || !require_dimensions(array, 3) ||
++       !require_size(array, size, 3) || !require_fortran(array)) SWIG_fail;
++@@ -964,6 +1175,245 @@
++     { Py_DECREF(array$argnum); }
++ }
++ 
+++/* Typemap suite for (DATA_TYPE IN_ARRAY4[ANY][ANY][ANY][ANY])
+++ */
+++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
+++           fragment="NumPy_Macros")
+++  (DATA_TYPE IN_ARRAY4[ANY][ANY][ANY][ANY])
+++{
+++  $1 = is_array($input) || PySequence_Check($input);
+++}
+++%typemap(in,
+++         fragment="NumPy_Fragments")
+++  (DATA_TYPE IN_ARRAY4[ANY][ANY][ANY][ANY])
+++  (PyArrayObject* array=NULL, int is_new_object=0)
+++{
+++  npy_intp size[4] = { $1_dim0, $1_dim1, $1_dim2 , $1_dim3};
+++  array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+++                                                   &is_new_object);
+++  if (!array || !require_dimensions(array, 4) ||
+++      !require_size(array, size, 4)) SWIG_fail;
+++  $1 = ($1_ltype) array_data(array);
+++}
+++%typemap(freearg)
+++  (DATA_TYPE IN_ARRAY4[ANY][ANY][ANY][ANY])
+++{
+++  if (is_new_object$argnum && array$argnum)
+++    { Py_DECREF(array$argnum); }
+++}
+++
+++/* Typemap suite for (DATA_TYPE* IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2,
+++ *                    DIM_TYPE DIM3, DIM_TYPE DIM4)
+++ */
+++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
+++           fragment="NumPy_Macros")
+++  (DATA_TYPE* IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++{
+++  $1 = is_array($input) || PySequence_Check($input);
+++}
+++%typemap(in,
+++         fragment="NumPy_Fragments")
+++  (DATA_TYPE* IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++  (PyArrayObject* array=NULL, int is_new_object=0)
+++{
+++  npy_intp size[4] = { -1, -1, -1, -1 };
+++  array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+++                                                   &is_new_object);
+++  if (!array || !require_dimensions(array, 4) ||
+++      !require_size(array, size, 4)) SWIG_fail;
+++  $1 = (DATA_TYPE*) array_data(array);
+++  $2 = (DIM_TYPE) array_size(array,0);
+++  $3 = (DIM_TYPE) array_size(array,1);
+++  $4 = (DIM_TYPE) array_size(array,2);
+++  $5 = (DIM_TYPE) array_size(array,3);
+++}
+++%typemap(freearg)
+++  (DATA_TYPE* IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++{
+++  if (is_new_object$argnum && array$argnum)
+++    { Py_DECREF(array$argnum); }
+++}
+++
+++/* Typemap suite for (DATA_TYPE** IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2,
+++ *                    DIM_TYPE DIM3, DIM_TYPE DIM4)
+++ */
+++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
+++           fragment="NumPy_Macros")
+++  (DATA_TYPE** IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++{
+++  /* for now, only concerned with lists */
+++  $1 = PySequence_Check($input);
+++}
+++%typemap(in,
+++         fragment="NumPy_Fragments")
+++  (DATA_TYPE** IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++  (DATA_TYPE** array=NULL, PyArrayObject** object_array=NULL, int* is_new_object_array=NULL)
+++{
+++  npy_intp size[3] = { -1, -1, -1 };
+++  PyArrayObject* temp_array;
+++  Py_ssize_t i;
+++  int is_new_object;
+++
+++  /* length of the list */
+++  $2 = PyList_Size($input);
+++
+++  /* the arrays */
+++  array = (DATA_TYPE **)malloc($2*sizeof(DATA_TYPE *));
+++  object_array = (PyArrayObject **)calloc($2,sizeof(PyArrayObject *));
+++  is_new_object_array = (int *)calloc($2,sizeof(int));
+++
+++  if (array == NULL || object_array == NULL || is_new_object_array == NULL)
+++  {
+++    SWIG_fail;
+++  }
+++
+++  for (i=0; i<$2; i++)
+++  {
+++    temp_array = obj_to_array_contiguous_allow_conversion(PySequence_GetItem($input,i), DATA_TYPECODE, &is_new_object);
+++
+++    /* the new array must be stored so that it can be destroyed in freearg */
+++    object_array[i] = temp_array;
+++    is_new_object_array[i] = is_new_object;
+++
+++    if (!temp_array || !require_dimensions(temp_array, 3)) SWIG_fail;
+++
+++    /* store the size of the first array in the list, then use that for comparison. */
+++    if (i == 0)
+++    {
+++      size[0] = array_size(temp_array,0);
+++      size[1] = array_size(temp_array,1);
+++      size[2] = array_size(temp_array,2);
+++    }
+++
+++    if (!require_size(temp_array, size, 3)) SWIG_fail;
+++
+++    array[i] = (DATA_TYPE*) array_data(temp_array);
+++  }
+++
+++  $1 = (DATA_TYPE**) array;
+++  $3 = (DIM_TYPE) size[0];
+++  $4 = (DIM_TYPE) size[1];
+++  $5 = (DIM_TYPE) size[2];
+++}
+++%typemap(freearg)
+++  (DATA_TYPE** IN_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++{
+++  Py_ssize_t i;
+++
+++  if (array$argnum!=NULL) free(array$argnum);
+++
+++  /*freeing the individual arrays if needed */
+++  if (object_array$argnum!=NULL)
+++  {
+++    if (is_new_object_array$argnum!=NULL)
+++    {
+++      for (i=0; i<$2; i++)
+++      {
+++        if (object_array$argnum[i] != NULL && is_new_object_array$argnum[i])
+++        { Py_DECREF(object_array$argnum[i]); }
+++      }
+++      free(is_new_object_array$argnum);
+++    }
+++    free(object_array$argnum);
+++  }
+++}
+++
+++/* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4,
+++ *                    DATA_TYPE* IN_ARRAY4)
+++ */
+++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
+++           fragment="NumPy_Macros")
+++  (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* IN_ARRAY4)
+++{
+++  $1 = is_array($input) || PySequence_Check($input);
+++}
+++%typemap(in,
+++         fragment="NumPy_Fragments")
+++  (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* IN_ARRAY4)
+++  (PyArrayObject* array=NULL, int is_new_object=0)
+++{
+++  npy_intp size[4] = { -1, -1, -1 , -1};
+++  array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+++                                                   &is_new_object);
+++  if (!array || !require_dimensions(array, 4) ||
+++      !require_size(array, size, 4)) SWIG_fail;
+++  $1 = (DIM_TYPE) array_size(array,0);
+++  $2 = (DIM_TYPE) array_size(array,1);
+++  $3 = (DIM_TYPE) array_size(array,2);
+++  $4 = (DIM_TYPE) array_size(array,3);
+++  $5 = (DATA_TYPE*) array_data(array);
+++}
+++%typemap(freearg)
+++  (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* IN_ARRAY4)
+++{
+++  if (is_new_object$argnum && array$argnum)
+++    { Py_DECREF(array$argnum); }
+++}
+++
+++/* Typemap suite for (DATA_TYPE* IN_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2,
+++ *                    DIM_TYPE DIM3, DIM_TYPE DIM4)
+++ */
+++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
+++           fragment="NumPy_Macros")
+++  (DATA_TYPE* IN_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++{
+++  $1 = is_array($input) || PySequence_Check($input);
+++}
+++%typemap(in,
+++         fragment="NumPy_Fragments")
+++  (DATA_TYPE* IN_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++  (PyArrayObject* array=NULL, int is_new_object=0)
+++{
+++  npy_intp size[4] = { -1, -1, -1, -1 };
+++  array = obj_to_array_fortran_allow_conversion($input, DATA_TYPECODE,
+++                                                &is_new_object);
+++  if (!array || !require_dimensions(array, 4) ||
+++      !require_size(array, size, 4) | !require_fortran(array)) SWIG_fail;
+++  $1 = (DATA_TYPE*) array_data(array);
+++  $2 = (DIM_TYPE) array_size(array,0);
+++  $3 = (DIM_TYPE) array_size(array,1);
+++  $4 = (DIM_TYPE) array_size(array,2);
+++  $5 = (DIM_TYPE) array_size(array,3);
+++}
+++%typemap(freearg)
+++  (DATA_TYPE* IN_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++{
+++  if (is_new_object$argnum && array$argnum)
+++    { Py_DECREF(array$argnum); }
+++}
+++
+++/* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4,
+++ *                    DATA_TYPE* IN_FARRAY4)
+++ */
+++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
+++           fragment="NumPy_Macros")
+++  (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* IN_FARRAY4)
+++{
+++  $1 = is_array($input) || PySequence_Check($input);
+++}
+++%typemap(in,
+++         fragment="NumPy_Fragments")
+++  (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* IN_FARRAY4)
+++  (PyArrayObject* array=NULL, int is_new_object=0)
+++{
+++  npy_intp size[4] = { -1, -1, -1 , -1 };
+++  array = obj_to_array_fortran_allow_conversion($input, DATA_TYPECODE,
+++                                                   &is_new_object);
+++  if (!array || !require_dimensions(array, 4) ||
+++      !require_size(array, size, 4) || !require_fortran(array)) SWIG_fail;
+++  $1 = (DIM_TYPE) array_size(array,0);
+++  $2 = (DIM_TYPE) array_size(array,1);
+++  $3 = (DIM_TYPE) array_size(array,2);
+++  $4 = (DIM_TYPE) array_size(array,3);
+++  $5 = (DATA_TYPE*) array_data(array);
+++}
+++%typemap(freearg)
+++  (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* IN_FARRAY4)
+++{
+++  if (is_new_object$argnum && array$argnum)
+++    { Py_DECREF(array$argnum); }
+++}
+++
++ /***************************/
++ /* In-Place Array Typemaps */
++ /***************************/
++@@ -1187,41 +1637,107 @@
++   $4 = (DIM_TYPE) array_size(array,2);
++ }
++ 
++-/* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3,
++- *                    DATA_TYPE* INPLACE_ARRAY3)
+++/* Typemap suite for (DATA_TYPE** INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2,
+++ *                    DIM_TYPE DIM3)
++  */
++ %typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
++            fragment="NumPy_Macros")
++-  (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_ARRAY3)
+++  (DATA_TYPE** INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
++ {
++-  $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
++-                                                 DATA_TYPECODE);
+++  $1 = PySequence_Check($input);
++ }
++ %typemap(in,
++          fragment="NumPy_Fragments")
++-  (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_ARRAY3)
++-  (PyArrayObject* array=NULL)
+++  (DATA_TYPE** INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
+++  (DATA_TYPE** array=NULL, PyArrayObject** object_array=NULL)
++ {
++-  array = obj_to_array_no_conversion($input, DATA_TYPECODE);
++-  if (!array || !require_dimensions(array,3) || !require_contiguous(array)
++-      || !require_native(array)) SWIG_fail;
++-  $1 = (DIM_TYPE) array_size(array,0);
++-  $2 = (DIM_TYPE) array_size(array,1);
++-  $3 = (DIM_TYPE) array_size(array,2);
++-  $4 = (DATA_TYPE*) array_data(array);
++-}
+++  npy_intp size[2] = { -1, -1 };
+++  PyArrayObject* temp_array;
+++  Py_ssize_t i;
++ 
++-/* Typemap suite for (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2,
++- *                    DIM_TYPE DIM3)
++- */
++-%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
++-           fragment="NumPy_Macros")
++-  (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
++-{
++-  $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
++-                                                 DATA_TYPECODE);
++-}
++-%typemap(in,
+++  /* length of the list */
+++  $2 = PyList_Size($input);
+++
+++  /* the arrays */
+++  array = (DATA_TYPE **)malloc($2*sizeof(DATA_TYPE *));
+++  object_array = (PyArrayObject **)calloc($2,sizeof(PyArrayObject *));
+++
+++  if (array == NULL || object_array == NULL)
+++  {
+++    SWIG_fail;
+++  }
+++
+++  for (i=0; i<$2; i++)
+++  {
+++    temp_array = obj_to_array_no_conversion(PySequence_GetItem($input,i), DATA_TYPECODE);
+++
+++    /* the new array must be stored so that it can be destroyed in freearg */
+++    object_array[i] = temp_array;
+++
+++    if ( !temp_array || !require_dimensions(temp_array, 2) ||
+++      !require_contiguous(temp_array) ||
+++      !require_native(temp_array) ||
+++      !PyArray_EquivTypenums(array_type(temp_array), DATA_TYPECODE)
+++    ) SWIG_fail;
+++
+++    /* store the size of the first array in the list, then use that for comparison. */
+++    if (i == 0)
+++    {
+++      size[0] = array_size(temp_array,0);
+++      size[1] = array_size(temp_array,1);
+++    }
+++
+++    if (!require_size(temp_array, size, 2)) SWIG_fail;
+++
+++    array[i] = (DATA_TYPE*) array_data(temp_array);
+++  }
+++
+++  $1 = (DATA_TYPE**) array;
+++  $3 = (DIM_TYPE) size[0];
+++  $4 = (DIM_TYPE) size[1];
+++}
+++%typemap(freearg)
+++  (DATA_TYPE** INPLACE_ARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
+++{
+++  if (array$argnum!=NULL) free(array$argnum);
+++  if (object_array$argnum!=NULL) free(object_array$argnum);
+++}
+++
+++/* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3,
+++ *                    DATA_TYPE* INPLACE_ARRAY3)
+++ */
+++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
+++           fragment="NumPy_Macros")
+++  (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_ARRAY3)
+++{
+++  $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
+++                                                 DATA_TYPECODE);
+++}
+++%typemap(in,
+++         fragment="NumPy_Fragments")
+++  (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DATA_TYPE* INPLACE_ARRAY3)
+++  (PyArrayObject* array=NULL)
+++{
+++  array = obj_to_array_no_conversion($input, DATA_TYPECODE);
+++  if (!array || !require_dimensions(array,3) || !require_contiguous(array)
+++      || !require_native(array)) SWIG_fail;
+++  $1 = (DIM_TYPE) array_size(array,0);
+++  $2 = (DIM_TYPE) array_size(array,1);
+++  $3 = (DIM_TYPE) array_size(array,2);
+++  $4 = (DATA_TYPE*) array_data(array);
+++}
+++
+++/* Typemap suite for (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2,
+++ *                    DIM_TYPE DIM3)
+++ */
+++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
+++           fragment="NumPy_Macros")
+++  (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
+++{
+++  $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
+++                                                 DATA_TYPECODE);
+++}
+++%typemap(in,
++          fragment="NumPy_Fragments")
++   (DATA_TYPE* INPLACE_FARRAY3, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3)
++   (PyArrayObject* array=NULL)
++@@ -1259,6 +1775,195 @@
++   $4 = (DATA_TYPE*) array_data(array);
++ }
++ 
+++/* Typemap suite for (DATA_TYPE INPLACE_ARRAY4[ANY][ANY][ANY][ANY])
+++ */
+++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
+++           fragment="NumPy_Macros")
+++  (DATA_TYPE INPLACE_ARRAY4[ANY][ANY][ANY][ANY])
+++{
+++  $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
+++                                                 DATA_TYPECODE);
+++}
+++%typemap(in,
+++         fragment="NumPy_Fragments")
+++  (DATA_TYPE INPLACE_ARRAY4[ANY][ANY][ANY][ANY])
+++  (PyArrayObject* array=NULL)
+++{
+++  npy_intp size[4] = { $1_dim0, $1_dim1, $1_dim2 , $1_dim3 };
+++  array = obj_to_array_no_conversion($input, DATA_TYPECODE);
+++  if (!array || !require_dimensions(array,4) || !require_size(array, size, 4) ||
+++      !require_contiguous(array) || !require_native(array)) SWIG_fail;
+++  $1 = ($1_ltype) array_data(array);
+++}
+++
+++/* Typemap suite for (DATA_TYPE* INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2,
+++ *                    DIM_TYPE DIM3, DIM_TYPE DIM4)
+++ */
+++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
+++           fragment="NumPy_Macros")
+++  (DATA_TYPE* INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++{
+++  $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
+++                                                 DATA_TYPECODE);
+++}
+++%typemap(in,
+++         fragment="NumPy_Fragments")
+++  (DATA_TYPE* INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++  (PyArrayObject* array=NULL)
+++{
+++  array = obj_to_array_no_conversion($input, DATA_TYPECODE);
+++  if (!array || !require_dimensions(array,4) || !require_contiguous(array) ||
+++      !require_native(array)) SWIG_fail;
+++  $1 = (DATA_TYPE*) array_data(array);
+++  $2 = (DIM_TYPE) array_size(array,0);
+++  $3 = (DIM_TYPE) array_size(array,1);
+++  $4 = (DIM_TYPE) array_size(array,2);
+++  $5 = (DIM_TYPE) array_size(array,3);
+++}
+++
+++/* Typemap suite for (DATA_TYPE** INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2,
+++ *                    DIM_TYPE DIM3, DIM_TYPE DIM4)
+++ */
+++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
+++           fragment="NumPy_Macros")
+++  (DATA_TYPE** INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++{
+++  $1 = PySequence_Check($input);
+++}
+++%typemap(in,
+++         fragment="NumPy_Fragments")
+++  (DATA_TYPE** INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++  (DATA_TYPE** array=NULL, PyArrayObject** object_array=NULL)
+++{
+++  npy_intp size[3] = { -1, -1, -1 };
+++  PyArrayObject* temp_array;
+++  Py_ssize_t i;
+++
+++  /* length of the list */
+++  $2 = PyList_Size($input);
+++
+++  /* the arrays */
+++  array = (DATA_TYPE **)malloc($2*sizeof(DATA_TYPE *));
+++  object_array = (PyArrayObject **)calloc($2,sizeof(PyArrayObject *));
+++
+++  if (array == NULL || object_array == NULL)
+++  {
+++    SWIG_fail;
+++  }
+++
+++  for (i=0; i<$2; i++)
+++  {
+++    temp_array = obj_to_array_no_conversion(PySequence_GetItem($input,i), DATA_TYPECODE);
+++
+++    /* the new array must be stored so that it can be destroyed in freearg */
+++    object_array[i] = temp_array;
+++
+++    if ( !temp_array || !require_dimensions(temp_array, 3) ||
+++      !require_contiguous(temp_array) ||
+++      !require_native(temp_array) ||
+++      !PyArray_EquivTypenums(array_type(temp_array), DATA_TYPECODE)
+++    ) SWIG_fail;
+++
+++    /* store the size of the first array in the list, then use that for comparison. */
+++    if (i == 0)
+++    {
+++      size[0] = array_size(temp_array,0);
+++      size[1] = array_size(temp_array,1);
+++      size[2] = array_size(temp_array,2);
+++    }
+++
+++    if (!require_size(temp_array, size, 3)) SWIG_fail;
+++
+++    array[i] = (DATA_TYPE*) array_data(temp_array);
+++  }
+++
+++  $1 = (DATA_TYPE**) array;
+++  $3 = (DIM_TYPE) size[0];
+++  $4 = (DIM_TYPE) size[1];
+++  $5 = (DIM_TYPE) size[2];
+++}
+++%typemap(freearg)
+++  (DATA_TYPE** INPLACE_ARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++{
+++  if (array$argnum!=NULL) free(array$argnum);
+++  if (object_array$argnum!=NULL) free(object_array$argnum);
+++}
+++
+++/* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4,
+++ *                    DATA_TYPE* INPLACE_ARRAY4)
+++ */
+++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
+++           fragment="NumPy_Macros")
+++  (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* INPLACE_ARRAY4)
+++{
+++  $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
+++                                                 DATA_TYPECODE);
+++}
+++%typemap(in,
+++         fragment="NumPy_Fragments")
+++  (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* INPLACE_ARRAY4)
+++  (PyArrayObject* array=NULL)
+++{
+++  array = obj_to_array_no_conversion($input, DATA_TYPECODE);
+++  if (!array || !require_dimensions(array,4) || !require_contiguous(array)
+++      || !require_native(array)) SWIG_fail;
+++  $1 = (DIM_TYPE) array_size(array,0);
+++  $2 = (DIM_TYPE) array_size(array,1);
+++  $3 = (DIM_TYPE) array_size(array,2);
+++  $4 = (DIM_TYPE) array_size(array,3);
+++  $5 = (DATA_TYPE*) array_data(array);
+++}
+++
+++/* Typemap suite for (DATA_TYPE* INPLACE_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2,
+++ *                    DIM_TYPE DIM3, DIM_TYPE DIM4)
+++ */
+++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
+++           fragment="NumPy_Macros")
+++  (DATA_TYPE* INPLACE_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++{
+++  $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
+++                                                 DATA_TYPECODE);
+++}
+++%typemap(in,
+++         fragment="NumPy_Fragments")
+++  (DATA_TYPE* INPLACE_FARRAY4, DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4)
+++  (PyArrayObject* array=NULL)
+++{
+++  array = obj_to_array_no_conversion($input, DATA_TYPECODE);
+++  if (!array || !require_dimensions(array,4) || !require_contiguous(array) ||
+++      !require_native(array) || !require_fortran(array)) SWIG_fail;
+++  $1 = (DATA_TYPE*) array_data(array);
+++  $2 = (DIM_TYPE) array_size(array,0);
+++  $3 = (DIM_TYPE) array_size(array,1);
+++  $4 = (DIM_TYPE) array_size(array,2);
+++  $5 = (DIM_TYPE) array_size(array,3);
+++}
+++
+++/* Typemap suite for (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3,
+++ *                    DATA_TYPE* INPLACE_FARRAY4)
+++ */
+++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
+++           fragment="NumPy_Macros")
+++  (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* INPLACE_FARRAY4)
+++{
+++  $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
+++                                                 DATA_TYPECODE);
+++}
+++%typemap(in,
+++         fragment="NumPy_Fragments")
+++  (DIM_TYPE DIM1, DIM_TYPE DIM2, DIM_TYPE DIM3, DIM_TYPE DIM4, DATA_TYPE* INPLACE_FARRAY4)
+++  (PyArrayObject* array=NULL)
+++{
+++  array = obj_to_array_no_conversion($input, DATA_TYPECODE);
+++  if (!array || !require_dimensions(array,4) || !require_contiguous(array)
+++      || !require_native(array) || !require_fortran(array)) SWIG_fail;
+++  $1 = (DIM_TYPE) array_size(array,0);
+++  $2 = (DIM_TYPE) array_size(array,1);
+++  $3 = (DIM_TYPE) array_size(array,2);
+++  $4 = (DIM_TYPE) array_size(array,3);
+++  $5 = (DATA_TYPE*) array_data(array);
+++}
+++
++ /*************************/
++ /* Argout Array Typemaps */
++ /*************************/
++@@ -1268,7 +1973,7 @@
++ %typemap(in,numinputs=0,
++          fragment="NumPy_Backward_Compatibility,NumPy_Macros")
++   (DATA_TYPE ARGOUT_ARRAY1[ANY])
++-  (PyObject * array = NULL)
+++  (PyObject* array = NULL)
++ {
++   npy_intp dims[1] = { $1_dim0 };
++   array = PyArray_SimpleNew(1, dims, DATA_TYPECODE);
++@@ -1278,7 +1983,7 @@
++ %typemap(argout)
++   (DATA_TYPE ARGOUT_ARRAY1[ANY])
++ {
++-  $result = SWIG_Python_AppendOutput($result,array$argnum);
+++  $result = SWIG_Python_AppendOutput($result,(PyObject*)array$argnum);
++ }
++ 
++ /* Typemap suite for (DATA_TYPE* ARGOUT_ARRAY1, DIM_TYPE DIM1)
++@@ -1286,7 +1991,7 @@
++ %typemap(in,numinputs=1,
++          fragment="NumPy_Fragments")
++   (DATA_TYPE* ARGOUT_ARRAY1, DIM_TYPE DIM1)
++-  (PyObject * array = NULL)
+++  (PyObject* array = NULL)
++ {
++   npy_intp dims[1];
++   if (!PyInt_Check($input))
++@@ -1306,7 +2011,7 @@
++ %typemap(argout)
++   (DATA_TYPE* ARGOUT_ARRAY1, DIM_TYPE DIM1)
++ {
++-  $result = SWIG_Python_AppendOutput($result,array$argnum);
+++  $result = SWIG_Python_AppendOutput($result,(PyObject*)array$argnum);
++ }
++ 
++ /* Typemap suite for (DIM_TYPE DIM1, DATA_TYPE* ARGOUT_ARRAY1)
++@@ -1314,7 +2019,7 @@
++ %typemap(in,numinputs=1,
++          fragment="NumPy_Fragments")
++   (DIM_TYPE DIM1, DATA_TYPE* ARGOUT_ARRAY1)
++-  (PyObject * array = NULL)
+++  (PyObject* array = NULL)
++ {
++   npy_intp dims[1];
++   if (!PyInt_Check($input))
++@@ -1334,7 +2039,7 @@
++ %typemap(argout)
++   (DIM_TYPE DIM1, DATA_TYPE* ARGOUT_ARRAY1)
++ {
++-  $result = SWIG_Python_AppendOutput($result,array$argnum);
+++  $result = SWIG_Python_AppendOutput($result,(PyObject*)array$argnum);
++ }
++ 
++ /* Typemap suite for (DATA_TYPE ARGOUT_ARRAY2[ANY][ANY])
++@@ -1342,7 +2047,7 @@
++ %typemap(in,numinputs=0,
++          fragment="NumPy_Backward_Compatibility,NumPy_Macros")
++   (DATA_TYPE ARGOUT_ARRAY2[ANY][ANY])
++-  (PyObject * array = NULL)
+++  (PyObject* array = NULL)
++ {
++   npy_intp dims[2] = { $1_dim0, $1_dim1 };
++   array = PyArray_SimpleNew(2, dims, DATA_TYPECODE);
++@@ -1352,7 +2057,7 @@
++ %typemap(argout)
++   (DATA_TYPE ARGOUT_ARRAY2[ANY][ANY])
++ {
++-  $result = SWIG_Python_AppendOutput($result,array$argnum);
+++  $result = SWIG_Python_AppendOutput($result,(PyObject*)array$argnum);
++ }
++ 
++ /* Typemap suite for (DATA_TYPE ARGOUT_ARRAY3[ANY][ANY][ANY])
++@@ -1360,7 +2065,7 @@
++ %typemap(in,numinputs=0,
++          fragment="NumPy_Backward_Compatibility,NumPy_Macros")
++   (DATA_TYPE ARGOUT_ARRAY3[ANY][ANY][ANY])
++-  (PyObject * array = NULL)
+++  (PyObject* array = NULL)
++ {
++   npy_intp dims[3] = { $1_dim0, $1_dim1, $1_dim2 };
++   array = PyArray_SimpleNew(3, dims, DATA_TYPECODE);
++@@ -1370,7 +2075,25 @@
++ %typemap(argout)
++   (DATA_TYPE ARGOUT_ARRAY3[ANY][ANY][ANY])
++ {
++-  $result = SWIG_Python_AppendOutput($result,array$argnum);
+++  $result = SWIG_Python_AppendOutput($result,(PyObject*)array$argnum);
+++}
+++
+++/* Typemap suite for (DATA_TYPE ARGOUT_ARRAY4[ANY][ANY][ANY][ANY])
+++ */
+++%typemap(in,numinputs=0,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Macros")
+++  (DATA_TYPE ARGOUT_ARRAY4[ANY][ANY][ANY][ANY])
+++  (PyObject* array = NULL)
+++{
+++  npy_intp dims[4] = { $1_dim0, $1_dim1, $1_dim2, $1_dim3 };
+++  array = PyArray_SimpleNew(4, dims, DATA_TYPECODE);
+++  if (!array) SWIG_fail;
+++  $1 = ($1_ltype) array_data(array);
+++}
+++%typemap(argout)
+++  (DATA_TYPE ARGOUT_ARRAY4[ANY][ANY][ANY][ANY])
+++{
+++  $result = SWIG_Python_AppendOutput($result,(PyObject*)array$argnum);
++ }
++ 
++ /*****************************/
++@@ -1381,7 +2104,7 @@
++  */
++ %typemap(in,numinputs=0)
++   (DATA_TYPE** ARGOUTVIEW_ARRAY1, DIM_TYPE* DIM1    )
++-  (DATA_TYPE*  data_temp        , DIM_TYPE  dim_temp)
+++  (DATA_TYPE*  data_temp = NULL , DIM_TYPE  dim_temp)
++ {
++   $1 = &data_temp;
++   $2 = &dim_temp;
++@@ -1391,16 +2114,18 @@
++   (DATA_TYPE** ARGOUTVIEW_ARRAY1, DIM_TYPE* DIM1)
++ {
++   npy_intp dims[1] = { *$2 };
++-  PyObject * array = PyArray_SimpleNewFromData(1, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyObject* obj = PyArray_SimpleNewFromData(1, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
++   if (!array) SWIG_fail;
++-  $result = SWIG_Python_AppendOutput($result,array);
+++  $result = SWIG_Python_AppendOutput($result,obj);
++ }
++ 
++ /* Typemap suite for (DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEW_ARRAY1)
++  */
++ %typemap(in,numinputs=0)
++   (DIM_TYPE* DIM1    , DATA_TYPE** ARGOUTVIEW_ARRAY1)
++-  (DIM_TYPE  dim_temp, DATA_TYPE*  data_temp        )
+++  (DIM_TYPE  dim_temp, DATA_TYPE*  data_temp = NULL )
++ {
++   $1 = &dim_temp;
++   $2 = &data_temp;
++@@ -1410,16 +2135,18 @@
++   (DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEW_ARRAY1)
++ {
++   npy_intp dims[1] = { *$1 };
++-  PyObject * array = PyArray_SimpleNewFromData(1, dims, DATA_TYPECODE, (void*)(*$2));
+++  PyObject* obj = PyArray_SimpleNewFromData(1, dims, DATA_TYPECODE, (void*)(*$2));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
++   if (!array) SWIG_fail;
++-  $result = SWIG_Python_AppendOutput($result,array);
+++  $result = SWIG_Python_AppendOutput($result,obj);
++ }
++ 
++ /* Typemap suite for (DATA_TYPE** ARGOUTVIEW_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
++  */
++ %typemap(in,numinputs=0)
++   (DATA_TYPE** ARGOUTVIEW_ARRAY2, DIM_TYPE* DIM1     , DIM_TYPE* DIM2     )
++-  (DATA_TYPE*  data_temp        , DIM_TYPE  dim1_temp, DIM_TYPE  dim2_temp)
+++  (DATA_TYPE*  data_temp = NULL , DIM_TYPE  dim1_temp, DIM_TYPE  dim2_temp)
++ {
++   $1 = &data_temp;
++   $2 = &dim1_temp;
++@@ -1430,16 +2157,18 @@
++   (DATA_TYPE** ARGOUTVIEW_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
++ {
++   npy_intp dims[2] = { *$2, *$3 };
++-  PyObject * array = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyObject* obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
++   if (!array) SWIG_fail;
++-  $result = SWIG_Python_AppendOutput($result,array);
+++  $result = SWIG_Python_AppendOutput($result,obj);
++ }
++ 
++ /* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_ARRAY2)
++  */
++ %typemap(in,numinputs=0)
++   (DIM_TYPE* DIM1     , DIM_TYPE* DIM2     , DATA_TYPE** ARGOUTVIEW_ARRAY2)
++-  (DIM_TYPE  dim1_temp, DIM_TYPE  dim2_temp, DATA_TYPE*  data_temp        )
+++  (DIM_TYPE  dim1_temp, DIM_TYPE  dim2_temp, DATA_TYPE*  data_temp = NULL )
++ {
++   $1 = &dim1_temp;
++   $2 = &dim2_temp;
++@@ -1450,16 +2179,18 @@
++   (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_ARRAY2)
++ {
++   npy_intp dims[2] = { *$1, *$2 };
++-  PyObject * array = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$3));
+++  PyObject* obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$3));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
++   if (!array) SWIG_fail;
++-  $result = SWIG_Python_AppendOutput($result,array);
+++  $result = SWIG_Python_AppendOutput($result,obj);
++ }
++ 
++ /* Typemap suite for (DATA_TYPE** ARGOUTVIEW_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
++  */
++ %typemap(in,numinputs=0)
++   (DATA_TYPE** ARGOUTVIEW_FARRAY2, DIM_TYPE* DIM1     , DIM_TYPE* DIM2     )
++-  (DATA_TYPE*  data_temp        , DIM_TYPE  dim1_temp, DIM_TYPE  dim2_temp)
+++  (DATA_TYPE*  data_temp = NULL  , DIM_TYPE  dim1_temp, DIM_TYPE  dim2_temp)
++ {
++   $1 = &data_temp;
++   $2 = &dim1_temp;
++@@ -1470,8 +2201,9 @@
++   (DATA_TYPE** ARGOUTVIEW_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
++ {
++   npy_intp dims[2] = { *$2, *$3 };
++-  PyObject * obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$1));
++-  PyArrayObject * array = (PyArrayObject*) obj;
+++  PyObject* obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
++   if (!array || !require_fortran(array)) SWIG_fail;
++   $result = SWIG_Python_AppendOutput($result,obj);
++ }
++@@ -1480,7 +2212,7 @@
++  */
++ %typemap(in,numinputs=0)
++   (DIM_TYPE* DIM1     , DIM_TYPE* DIM2     , DATA_TYPE** ARGOUTVIEW_FARRAY2)
++-  (DIM_TYPE  dim1_temp, DIM_TYPE  dim2_temp, DATA_TYPE*  data_temp        )
+++  (DIM_TYPE  dim1_temp, DIM_TYPE  dim2_temp, DATA_TYPE*  data_temp = NULL  )
++ {
++   $1 = &dim1_temp;
++   $2 = &dim2_temp;
++@@ -1491,8 +2223,9 @@
++   (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEW_FARRAY2)
++ {
++   npy_intp dims[2] = { *$1, *$2 };
++-  PyObject * obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$3));
++-  PyArrayObject * array = (PyArrayObject*) obj;
+++  PyObject* obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$3));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
++   if (!array || !require_fortran(array)) SWIG_fail;
++   $result = SWIG_Python_AppendOutput($result,obj);
++ }
++@@ -1501,8 +2234,8 @@
++                       DIM_TYPE* DIM3)
++  */
++ %typemap(in,numinputs=0)
++-  (DATA_TYPE** ARGOUTVIEW_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
++-  (DATA_TYPE* data_temp, DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp)
+++  (DATA_TYPE** ARGOUTVIEW_ARRAY3, DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    )
+++  (DATA_TYPE* data_temp = NULL  , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp)
++ {
++   $1 = &data_temp;
++   $2 = &dim1_temp;
++@@ -1514,9 +2247,11 @@
++   (DATA_TYPE** ARGOUTVIEW_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
++ {
++   npy_intp dims[3] = { *$2, *$3, *$4 };
++-  PyObject * array = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
++   if (!array) SWIG_fail;
++-  $result = SWIG_Python_AppendOutput($result,array);
+++  $result = SWIG_Python_AppendOutput($result,obj);
++ }
++ 
++ /* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3,
++@@ -1524,7 +2259,7 @@
++  */
++ %typemap(in,numinputs=0)
++   (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_ARRAY3)
++-  (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DATA_TYPE* data_temp)
+++  (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DATA_TYPE* data_temp = NULL)
++ {
++   $1 = &dim1_temp;
++   $2 = &dim2_temp;
++@@ -1536,17 +2271,19 @@
++   (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_ARRAY3)
++ {
++   npy_intp dims[3] = { *$1, *$2, *$3 };
++-  PyObject * array = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$3));
+++  PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$4));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
++   if (!array) SWIG_fail;
++-  $result = SWIG_Python_AppendOutput($result,array);
+++  $result = SWIG_Python_AppendOutput($result,obj);
++ }
++ 
++ /* Typemap suite for (DATA_TYPE** ARGOUTVIEW_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2,
++                       DIM_TYPE* DIM3)
++  */
++ %typemap(in,numinputs=0)
++-  (DATA_TYPE** ARGOUTVIEW_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
++-  (DATA_TYPE* data_temp, DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp)
+++  (DATA_TYPE** ARGOUTVIEW_FARRAY3, DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    )
+++  (DATA_TYPE* data_temp = NULL   , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp)
++ {
++   $1 = &data_temp;
++   $2 = &dim1_temp;
++@@ -1558,9 +2295,10 @@
++   (DATA_TYPE** ARGOUTVIEW_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
++ {
++   npy_intp dims[3] = { *$2, *$3, *$4 };
++-  PyObject * obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$1));
++-  PyArrayObject * array = (PyArrayObject*) obj;
++-  if (!array || require_fortran(array)) SWIG_fail;
+++  PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array || !require_fortran(array)) SWIG_fail;
++   $result = SWIG_Python_AppendOutput($result,obj);
++ }
++ 
++@@ -1568,8 +2306,8 @@
++                       DATA_TYPE** ARGOUTVIEW_FARRAY3)
++  */
++ %typemap(in,numinputs=0)
++-  (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_FARRAY3)
++-  (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DATA_TYPE* data_temp)
+++  (DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    , DATA_TYPE** ARGOUTVIEW_FARRAY3)
+++  (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DATA_TYPE* data_temp = NULL   )
++ {
++   $1 = &dim1_temp;
++   $2 = &dim2_temp;
++@@ -1581,54 +2319,843 @@
++   (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEW_FARRAY3)
++ {
++   npy_intp dims[3] = { *$1, *$2, *$3 };
++-  PyObject * obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$3));
++-  PyArrayObject * array = (PyArrayObject*) obj;
++-  if (!array || require_fortran(array)) SWIG_fail;
+++  PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$4));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array || !require_fortran(array)) SWIG_fail;
++   $result = SWIG_Python_AppendOutput($result,obj);
++ }
++ 
++-%enddef    /* %numpy_typemaps() macro */
++-/* *************************************************************** */
++-
++-/* Concrete instances of the %numpy_typemaps() macro: Each invocation
++- * below applies all of the typemaps above to the specified data type.
+++/* Typemap suite for (DATA_TYPE** ARGOUTVIEW_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2,
+++                      DIM_TYPE* DIM3, DIM_TYPE* DIM4)
++  */
++-%numpy_typemaps(signed char       , NPY_BYTE     , int)
++-%numpy_typemaps(unsigned char     , NPY_UBYTE    , int)
++-%numpy_typemaps(short             , NPY_SHORT    , int)
++-%numpy_typemaps(unsigned short    , NPY_USHORT   , int)
++-%numpy_typemaps(int               , NPY_INT      , int)
++-%numpy_typemaps(unsigned int      , NPY_UINT     , int)
++-%numpy_typemaps(long              , NPY_LONG     , int)
++-%numpy_typemaps(unsigned long     , NPY_ULONG    , int)
++-%numpy_typemaps(long long         , NPY_LONGLONG , int)
++-%numpy_typemaps(unsigned long long, NPY_ULONGLONG, int)
++-%numpy_typemaps(float             , NPY_FLOAT    , int)
++-%numpy_typemaps(double            , NPY_DOUBLE   , int)
+++%typemap(in,numinputs=0)
+++  (DATA_TYPE** ARGOUTVIEW_ARRAY4, DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    , DIM_TYPE* DIM4    )
+++  (DATA_TYPE* data_temp = NULL  , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp)
+++{
+++  $1 = &data_temp;
+++  $2 = &dim1_temp;
+++  $3 = &dim2_temp;
+++  $4 = &dim3_temp;
+++  $5 = &dim4_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility")
+++  (DATA_TYPE** ARGOUTVIEW_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4)
+++{
+++  npy_intp dims[4] = { *$2, *$3, *$4 , *$5 };
+++  PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyArrayObject* array = (PyArrayObject*) obj;
++ 
++-/* ***************************************************************
++- * The follow macro expansion does not work, because C++ bool is 4
++- * bytes and NPY_BOOL is 1 byte
++- *
++- *    %numpy_typemaps(bool, NPY_BOOL, int)
++- */
+++  if (!array) SWIG_fail;
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
++ 
++-/* ***************************************************************
++- * On my Mac, I get the following warning for this macro expansion:
++- * 'swig/python detected a memory leak of type 'long double *', no destructor found.'
++- *
++- *    %numpy_typemaps(long double, NPY_LONGDOUBLE, int)
+++/* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4,
+++                      DATA_TYPE** ARGOUTVIEW_ARRAY4)
++  */
++-
++-/* ***************************************************************
++- * Swig complains about a syntax error for the following macro
++- * expansions:
++- *
++- *    %numpy_typemaps(complex float,  NPY_CFLOAT , int)
++- *
++- *    %numpy_typemaps(complex double, NPY_CDOUBLE, int)
++- *
++- *    %numpy_typemaps(complex long double, NPY_CLONGDOUBLE, int)
+++%typemap(in,numinputs=0)
+++  (DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    , DIM_TYPE* DIM4    , DATA_TYPE** ARGOUTVIEW_ARRAY4)
+++  (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp, DATA_TYPE* data_temp = NULL  )
+++{
+++  $1 = &dim1_temp;
+++  $2 = &dim2_temp;
+++  $3 = &dim3_temp;
+++  $4 = &dim4_temp;
+++  $5 = &data_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility")
+++  (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEW_ARRAY4)
+++{
+++  npy_intp dims[4] = { *$1, *$2, *$3 , *$4 };
+++  PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$5));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array) SWIG_fail;
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DATA_TYPE** ARGOUTVIEW_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2,
+++                      DIM_TYPE* DIM3, DIM_TYPE* DIM4)
+++ */
+++%typemap(in,numinputs=0)
+++  (DATA_TYPE** ARGOUTVIEW_FARRAY4, DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    , DIM_TYPE* DIM4    )
+++  (DATA_TYPE* data_temp = NULL   , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp)
+++{
+++  $1 = &data_temp;
+++  $2 = &dim1_temp;
+++  $3 = &dim2_temp;
+++  $4 = &dim3_temp;
+++  $5 = &dim4_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements")
+++  (DATA_TYPE** ARGOUTVIEW_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4)
+++{
+++  npy_intp dims[4] = { *$2, *$3, *$4 , *$5 };
+++  PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array || !require_fortran(array)) SWIG_fail;
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4,
+++                      DATA_TYPE** ARGOUTVIEW_FARRAY4)
+++ */
+++%typemap(in,numinputs=0)
+++  (DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    , DIM_TYPE* DIM4    , DATA_TYPE** ARGOUTVIEW_FARRAY4)
+++  (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp, DATA_TYPE* data_temp = NULL   )
+++{
+++  $1 = &dim1_temp;
+++  $2 = &dim2_temp;
+++  $3 = &dim3_temp;
+++  $4 = &dim4_temp;
+++  $5 = &data_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements")
+++  (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEW_FARRAY4)
+++{
+++  npy_intp dims[4] = { *$1, *$2, *$3 , *$4 };
+++  PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$5));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array || !require_fortran(array)) SWIG_fail;
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/*************************************/
+++/* Managed Argoutview Array Typemaps */
+++/*************************************/
+++
+++/* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_ARRAY1, DIM_TYPE* DIM1)
+++ */
+++%typemap(in,numinputs=0)
+++  (DATA_TYPE** ARGOUTVIEWM_ARRAY1, DIM_TYPE* DIM1    )
+++  (DATA_TYPE*  data_temp = NULL  , DIM_TYPE  dim_temp)
+++{
+++  $1 = &data_temp;
+++  $2 = &dim_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
+++  (DATA_TYPE** ARGOUTVIEWM_ARRAY1, DIM_TYPE* DIM1)
+++{
+++  npy_intp dims[1] = { *$2 };
+++  PyObject* obj = PyArray_SimpleNewFromData(1, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEWM_ARRAY1)
+++ */
+++%typemap(in,numinputs=0)
+++  (DIM_TYPE* DIM1    , DATA_TYPE** ARGOUTVIEWM_ARRAY1)
+++  (DIM_TYPE  dim_temp, DATA_TYPE*  data_temp = NULL  )
+++{
+++  $1 = &dim_temp;
+++  $2 = &data_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
+++  (DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEWM_ARRAY1)
+++{
+++  npy_intp dims[1] = { *$1 };
+++  PyObject* obj = PyArray_SimpleNewFromData(1, dims, DATA_TYPECODE, (void*)(*$2));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
+++ */
+++%typemap(in,numinputs=0)
+++  (DATA_TYPE** ARGOUTVIEWM_ARRAY2, DIM_TYPE* DIM1     , DIM_TYPE* DIM2     )
+++  (DATA_TYPE*  data_temp = NULL  , DIM_TYPE  dim1_temp, DIM_TYPE  dim2_temp)
+++{
+++  $1 = &data_temp;
+++  $2 = &dim1_temp;
+++  $3 = &dim2_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
+++  (DATA_TYPE** ARGOUTVIEWM_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
+++{
+++  npy_intp dims[2] = { *$2, *$3 };
+++  PyObject* obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEWM_ARRAY2)
+++ */
+++%typemap(in,numinputs=0)
+++  (DIM_TYPE* DIM1     , DIM_TYPE* DIM2     , DATA_TYPE** ARGOUTVIEWM_ARRAY2)
+++  (DIM_TYPE  dim1_temp, DIM_TYPE  dim2_temp, DATA_TYPE*  data_temp = NULL  )
+++{
+++  $1 = &dim1_temp;
+++  $2 = &dim2_temp;
+++  $3 = &data_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
+++  (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEWM_ARRAY2)
+++{
+++  npy_intp dims[2] = { *$1, *$2 };
+++  PyObject* obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$3));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
+++ */
+++%typemap(in,numinputs=0)
+++  (DATA_TYPE** ARGOUTVIEWM_FARRAY2, DIM_TYPE* DIM1     , DIM_TYPE* DIM2     )
+++  (DATA_TYPE*  data_temp = NULL   , DIM_TYPE  dim1_temp, DIM_TYPE  dim2_temp)
+++{
+++  $1 = &data_temp;
+++  $2 = &dim1_temp;
+++  $3 = &dim2_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities")
+++  (DATA_TYPE** ARGOUTVIEWM_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
+++{
+++  npy_intp dims[2] = { *$2, *$3 };
+++  PyObject* obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array || !require_fortran(array)) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEWM_FARRAY2)
+++ */
+++%typemap(in,numinputs=0)
+++  (DIM_TYPE* DIM1     , DIM_TYPE* DIM2     , DATA_TYPE** ARGOUTVIEWM_FARRAY2)
+++  (DIM_TYPE  dim1_temp, DIM_TYPE  dim2_temp, DATA_TYPE*  data_temp = NULL   )
+++{
+++  $1 = &dim1_temp;
+++  $2 = &dim2_temp;
+++  $3 = &data_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities")
+++  (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEWM_FARRAY2)
+++{
+++  npy_intp dims[2] = { *$1, *$2 };
+++  PyObject* obj = PyArray_SimpleNewFromData(2, dims, DATA_TYPECODE, (void*)(*$3));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array || !require_fortran(array)) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2,
+++                      DIM_TYPE* DIM3)
+++ */
+++%typemap(in,numinputs=0)
+++  (DATA_TYPE** ARGOUTVIEWM_ARRAY3, DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    )
+++  (DATA_TYPE* data_temp = NULL   , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp)
+++{
+++  $1 = &data_temp;
+++  $2 = &dim1_temp;
+++  $3 = &dim2_temp;
+++  $4 = &dim3_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
+++  (DATA_TYPE** ARGOUTVIEWM_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
+++{
+++  npy_intp dims[3] = { *$2, *$3, *$4 };
+++  PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3,
+++                      DATA_TYPE** ARGOUTVIEWM_ARRAY3)
+++ */
+++%typemap(in,numinputs=0)
+++  (DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    , DATA_TYPE** ARGOUTVIEWM_ARRAY3)
+++  (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DATA_TYPE* data_temp = NULL   )
+++{
+++  $1 = &dim1_temp;
+++  $2 = &dim2_temp;
+++  $3 = &dim3_temp;
+++  $4 = &data_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
+++  (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEWM_ARRAY3)
+++{
+++  npy_intp dims[3] = { *$1, *$2, *$3 };
+++  PyObject* obj= PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$4));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2,
+++                      DIM_TYPE* DIM3)
++  */
+++%typemap(in,numinputs=0)
+++  (DATA_TYPE** ARGOUTVIEWM_FARRAY3, DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    )
+++  (DATA_TYPE* data_temp = NULL    , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp)
+++{
+++  $1 = &data_temp;
+++  $2 = &dim1_temp;
+++  $3 = &dim2_temp;
+++  $4 = &dim3_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities")
+++  (DATA_TYPE** ARGOUTVIEWM_FARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
+++{
+++  npy_intp dims[3] = { *$2, *$3, *$4 };
+++  PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array || !require_fortran(array)) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3,
+++                      DATA_TYPE** ARGOUTVIEWM_FARRAY3)
+++ */
+++%typemap(in,numinputs=0)
+++  (DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    , DATA_TYPE** ARGOUTVIEWM_FARRAY3)
+++  (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DATA_TYPE* data_temp = NULL    )
+++{
+++  $1 = &dim1_temp;
+++  $2 = &dim2_temp;
+++  $3 = &dim3_temp;
+++  $4 = &data_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities")
+++  (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEWM_FARRAY3)
+++{
+++  npy_intp dims[3] = { *$1, *$2, *$3 };
+++  PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$4));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array || !require_fortran(array)) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2,
+++                      DIM_TYPE* DIM3, DIM_TYPE* DIM4)
+++ */
+++%typemap(in,numinputs=0)
+++  (DATA_TYPE** ARGOUTVIEWM_ARRAY4, DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    , DIM_TYPE* DIM4    )
+++  (DATA_TYPE* data_temp = NULL   , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp)
+++{
+++  $1 = &data_temp;
+++  $2 = &dim1_temp;
+++  $3 = &dim2_temp;
+++  $4 = &dim3_temp;
+++  $5 = &dim4_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
+++  (DATA_TYPE** ARGOUTVIEWM_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4)
+++{
+++  npy_intp dims[4] = { *$2, *$3, *$4 , *$5 };
+++  PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4,
+++                      DATA_TYPE** ARGOUTVIEWM_ARRAY4)
+++ */
+++%typemap(in,numinputs=0)
+++  (DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    , DIM_TYPE* DIM4    , DATA_TYPE** ARGOUTVIEWM_ARRAY4)
+++  (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp, DATA_TYPE* data_temp = NULL   )
+++{
+++  $1 = &dim1_temp;
+++  $2 = &dim2_temp;
+++  $3 = &dim3_temp;
+++  $4 = &dim4_temp;
+++  $5 = &data_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
+++  (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_ARRAY4)
+++{
+++  npy_intp dims[4] = { *$1, *$2, *$3 , *$4 };
+++  PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$5));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2,
+++                      DIM_TYPE* DIM3, DIM_TYPE* DIM4)
+++ */
+++%typemap(in,numinputs=0)
+++  (DATA_TYPE** ARGOUTVIEWM_FARRAY4, DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    , DIM_TYPE* DIM4    )
+++  (DATA_TYPE* data_temp = NULL    , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp)
+++{
+++  $1 = &data_temp;
+++  $2 = &dim1_temp;
+++  $3 = &dim2_temp;
+++  $4 = &dim3_temp;
+++  $5 = &dim4_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities")
+++  (DATA_TYPE** ARGOUTVIEWM_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
+++{
+++  npy_intp dims[4] = { *$2, *$3, *$4 , *$5 };
+++  PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array || !require_fortran(array)) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4,
+++                      DATA_TYPE** ARGOUTVIEWM_FARRAY4)
+++ */
+++%typemap(in,numinputs=0)
+++  (DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    , DIM_TYPE* DIM4    , DATA_TYPE** ARGOUTVIEWM_FARRAY4)
+++  (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp, DATA_TYPE* data_temp = NULL    )
+++{
+++  $1 = &dim1_temp;
+++  $2 = &dim2_temp;
+++  $3 = &dim3_temp;
+++  $4 = &dim4_temp;
+++  $5 = &data_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities")
+++  (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_FARRAY4)
+++{
+++  npy_intp dims[4] = { *$1, *$2, *$3 , *$4 };
+++  PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$5));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array || !require_fortran(array)) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2,
+++                      DIM_TYPE* DIM3, DIM_TYPE* DIM4)
+++ */
+++%typemap(in,numinputs=0)
+++  (DATA_TYPE** ARGOUTVIEWM_ARRAY4, DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    , DIM_TYPE* DIM4    )
+++  (DATA_TYPE* data_temp = NULL   , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp)
+++{
+++  $1 = &data_temp;
+++  $2 = &dim1_temp;
+++  $3 = &dim2_temp;
+++  $4 = &dim3_temp;
+++  $5 = &dim4_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
+++  (DATA_TYPE** ARGOUTVIEWM_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4)
+++{
+++  npy_intp dims[4] = { *$2, *$3, *$4 , *$5 };
+++  PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4,
+++                      DATA_TYPE** ARGOUTVIEWM_ARRAY4)
+++ */
+++%typemap(in,numinputs=0)
+++  (DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    , DIM_TYPE* DIM4    , DATA_TYPE** ARGOUTVIEWM_ARRAY4)
+++  (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp, DATA_TYPE* data_temp = NULL   )
+++{
+++  $1 = &dim1_temp;
+++  $2 = &dim2_temp;
+++  $3 = &dim3_temp;
+++  $4 = &dim4_temp;
+++  $5 = &data_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
+++  (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_ARRAY4)
+++{
+++  npy_intp dims[4] = { *$1, *$2, *$3 , *$4 };
+++  PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$5));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DATA_TYPE** ARGOUTVIEWM_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2,
+++                      DIM_TYPE* DIM3, DIM_TYPE* DIM4)
+++ */
+++%typemap(in,numinputs=0)
+++  (DATA_TYPE** ARGOUTVIEWM_FARRAY4, DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    , DIM_TYPE* DIM4    )
+++  (DATA_TYPE* data_temp = NULL    , DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp)
+++{
+++  $1 = &data_temp;
+++  $2 = &dim1_temp;
+++  $3 = &dim2_temp;
+++  $4 = &dim3_temp;
+++  $5 = &dim4_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities")
+++  (DATA_TYPE** ARGOUTVIEWM_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4)
+++{
+++  npy_intp dims[4] = { *$2, *$3, *$4 , *$5 };
+++  PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$1));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array || !require_fortran(array)) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/* Typemap suite for (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4,
+++                      DATA_TYPE** ARGOUTVIEWM_FARRAY4)
+++ */
+++%typemap(in,numinputs=0)
+++  (DIM_TYPE* DIM1    , DIM_TYPE* DIM2    , DIM_TYPE* DIM3    , DIM_TYPE* DIM4    , DATA_TYPE** ARGOUTVIEWM_FARRAY4)
+++  (DIM_TYPE dim1_temp, DIM_TYPE dim2_temp, DIM_TYPE dim3_temp, DIM_TYPE dim4_temp, DATA_TYPE* data_temp = NULL    )
+++{
+++  $1 = &dim1_temp;
+++  $2 = &dim2_temp;
+++  $3 = &dim3_temp;
+++  $4 = &dim4_temp;
+++  $5 = &data_temp;
+++}
+++%typemap(argout,
+++         fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities")
+++  (DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_FARRAY4)
+++{
+++  npy_intp dims[4] = { *$1, *$2, *$3 , *$4 };
+++  PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$5));
+++  PyArrayObject* array = (PyArrayObject*) obj;
+++
+++  if (!array || !require_fortran(array)) SWIG_fail;
+++
+++%#ifdef SWIGPY_USE_CAPSULE
+++    PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
+++%#else
+++    PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
+++%#endif
+++
+++%#if NPY_API_VERSION < 0x00000007
+++  PyArray_BASE(array) = cap;
+++%#else
+++  PyArray_SetBaseObject(array,cap);
+++%#endif
+++
+++  $result = SWIG_Python_AppendOutput($result,obj);
+++}
+++
+++/**************************************/
+++/* In-Place Array Typemap - flattened */
+++/**************************************/
+++
+++/* Typemap suite for (DATA_TYPE* INPLACE_ARRAY_FLAT, DIM_TYPE DIM_FLAT)
+++ */
+++%typecheck(SWIG_TYPECHECK_DOUBLE_ARRAY,
+++           fragment="NumPy_Macros")
+++  (DATA_TYPE* INPLACE_ARRAY_FLAT, DIM_TYPE DIM_FLAT)
+++{
+++  $1 = is_array($input) && PyArray_EquivTypenums(array_type($input),
+++                                                 DATA_TYPECODE);
+++}
+++%typemap(in,
+++         fragment="NumPy_Fragments")
+++  (DATA_TYPE* INPLACE_ARRAY_FLAT, DIM_TYPE DIM_FLAT)
+++  (PyArrayObject* array=NULL, int i=1)
+++{
+++  array = obj_to_array_no_conversion($input, DATA_TYPECODE);
+++  if (!array || !require_c_or_f_contiguous(array)
+++      || !require_native(array)) SWIG_fail;
+++  $1 = (DATA_TYPE*) array_data(array);
+++  $2 = 1;
+++  for (i=0; i < array_numdims(array); ++i) $2 *= array_size(array,i);
+++}
+++
+++%enddef    /* %numpy_typemaps() macro */
+++/* *************************************************************** */
+++
+++/* Concrete instances of the %numpy_typemaps() macro: Each invocation
+++ * below applies all of the typemaps above to the specified data type.
+++ */
+++%numpy_typemaps(signed char       , NPY_BYTE     , int)
+++%numpy_typemaps(unsigned char     , NPY_UBYTE    , int)
+++%numpy_typemaps(short             , NPY_SHORT    , int)
+++%numpy_typemaps(unsigned short    , NPY_USHORT   , int)
+++%numpy_typemaps(int               , NPY_INT      , int)
+++%numpy_typemaps(unsigned int      , NPY_UINT     , int)
+++%numpy_typemaps(long              , NPY_LONG     , int)
+++%numpy_typemaps(unsigned long     , NPY_ULONG    , int)
+++%numpy_typemaps(long long         , NPY_LONGLONG , int)
+++%numpy_typemaps(unsigned long long, NPY_ULONGLONG, int)
+++%numpy_typemaps(float             , NPY_FLOAT    , int)
+++%numpy_typemaps(double            , NPY_DOUBLE   , int)
+++
+++/* ***************************************************************
+++ * The follow macro expansion does not work, because C++ bool is 4
+++ * bytes and NPY_BOOL is 1 byte
+++ *
+++ *    %numpy_typemaps(bool, NPY_BOOL, int)
+++ */
+++
+++/* ***************************************************************
+++ * On my Mac, I get the following warning for this macro expansion:
+++ * 'swig/python detected a memory leak of type 'long double *', no destructor found.'
+++ *
+++ *    %numpy_typemaps(long double, NPY_LONGDOUBLE, int)
+++ */
+++
+++#ifdef __cplusplus
+++
+++%include <std_complex.i>
+++
+++%numpy_typemaps(std::complex<float>,  NPY_CFLOAT , int)
+++%numpy_typemaps(std::complex<double>, NPY_CDOUBLE, int)
+++
+++#endif
++ 
++ #endif /* SWIGPYTHON */
diff --cc debian/patches/python3.patch
index 595824a,0000000..8944d4a
mode 100644,000000..100644
--- a/debian/patches/python3.patch
+++ b/debian/patches/python3.patch
@@@ -1,836 -1,0 +1,840 @@@
 +Index: magics++-2.28.0/tools/axis2doc.py
 +===================================================================
 +--- magics++-2.28.0.orig/tools/axis2doc.py
 ++++ magics++-2.28.0/tools/axis2doc.py
 +@@ -1,4 +1,6 @@
 + #!/usr/bin/python
 ++
 ++from __future__ import print_function
 + from xml.sax.handler import ContentHandler
 + from xml.sax import make_parser
 + from types import *
 +@@ -40,7 +42,7 @@ class ObjectHandler(ContentHandler):
 + 		
 + 	def anyset(p, attrs):
 + 		p["set"] = "psetc"
 +-		if  attrs.has_key("values") :
 ++		if  "values" in attrs:
 + 			val = attrs["values"]
 + 			values = val.split("/")
 + 			p["values"] = values
 +@@ -88,21 +90,18 @@ class ObjectHandler(ContentHandler):
 + 
 + 
 + 	def get(self, attrs, name, default):
 +-		if  attrs.has_key(name):
 +-			return attrs.get(name)
 +-		else :
 +-			return default
 ++	        return attrs.get(name, default)
 + 
 + 	def newparam(self, attrs):
 + 		p = {}
 + 		self.parameters[attrs.get("name")] = p
 + 		p["name"] = attrs.get("name")
 + 		p["type"] = attrs.get("to")
 +-		if attrs.has_key("metview") :
 ++		if "metview" in attrs:
 + 			p["metview"]= attrs["metview"]
 + 		p["values"] = []
 + 		t = p["type"]
 +-		if  self.types.has_key(t) :
 ++		if  t in self.types:
 + 			self.types[t](p, attrs)
 + 		else :
 + 			p["set"]="psetc"
 +@@ -117,7 +116,7 @@ class ObjectHandler(ContentHandler):
 + 		o["name"] = attrs.get("name")
 + 		o["documentation"] = ""
 + 		o["parameters"] = []
 +-		if  attrs.has_key("inherits") :
 ++		if  "inherits" in attrs:
 + 			o["inherits"]=attrs.get("inherits")
 + 			
 + 		return o
 +@@ -139,12 +138,12 @@ class ObjectHandler(ContentHandler):
 + 		if ( name == "option") : 
 + 			val = attrs.get("fortran")
 + 			self.param["values"].append(val)
 +-			if ( self.param.has_key(val) == False ):
 ++			if val not in self.param:
 + 				self.param[val] = []
 + 			self.param[val].append(attrs.get("name"))
 + 		if ( name == "set" ) : 
 + 			val = attrs.get("value")
 +-			if ( self.param.has_key(val) == False ):
 ++			if val not in self.param:
 + 				self.param[val] = []
 + 			self.param[val].append(attrs.get("name"))
 + 
 +@@ -167,7 +166,7 @@ class ObjectHandler(ContentHandler):
 + 			self.actiondoc= ""
 + 			
 + 	def printDef(self):
 +-		print json.dumps(self.magics, indent=2)
 ++		print (json.dumps(self.magics, indent=2))
 + 	
 + 
 + 	def parse(self, file):
 +@@ -180,21 +179,21 @@ class ObjectHandler(ContentHandler):
 + 
 + 	def prepare(self, defparam):
 + 		param = defparam.copy()
 +-		print "prepare-->"
 +-		print param
 +-		print "<---prepare"
 +-		if param.has_key("values") == False:
 ++		print ("prepare-->")
 ++		print (param)
 ++		print ("<---prepare")
 ++		if "values" not in param:
 + 			return param
 + 		if len(param["values"]) == 0:
 + 			return param
 + 		for val in param["values"]:
 +-			print val + " For " + param["name"]
 ++			print (val + " For " + param["name"])
 + 			newp = []
 +-			if param.has_key(val):
 ++			if val in param):
 + 				for v in param[val]:
 +-					print "prepare-->" + v
 ++					print ("prepare-->" + v)
 + 					# Can be a parameter or another object!
 +-					if self.parameters.has_key(v) :
 ++					if v in self.parameters:
 + 						self.append(newp, v)
 + 					else:
 + 						self.append(newp, self.getList(v))
 +@@ -210,7 +209,7 @@ class ObjectHandler(ContentHandler):
 + 	def getList(self, object):
 + 		definition = self.magics[object] 
 + 		list = []
 +-		if definition.has_key("inherits"):
 ++		if "inherits" in definition:
 + 			self.append(list, self.getList(definition["inherits"]))
 + 		for p in definition["parameters"]:
 + 			list.append(p["name"])
 +@@ -220,8 +219,8 @@ class ObjectHandler(ContentHandler):
 + 
 + 	def buildParam(self, param):
 + 		parameters = []
 +-		if param.has_key("inherits"):
 +-			print param["name"] + " inherits from " + param["inherits"]	
 ++		if "inherits" in param:
 ++			print (param["name"] + " inherits from " + param["inherits"])
 + 			parent = self.buildParam(self.magics[param["inherits"]])
 + 			self.append(parameters, parent) 
 + 		parameters.append(self.prepare(param))
 +@@ -232,8 +231,8 @@ class ObjectHandler(ContentHandler):
 + 	def build(self, params):
 + 		parameters = []
 + 		for p in params:
 +-			print "find class " + p
 +-			if ( self.magics.has_key(p) ) :
 ++			print ("find class " + p)
 ++			if p in self.magics:
 + 				defp = self.magics[p]
 + 			# internal object
 + 				for p in defp["parameters"]:
 +Index: magics++-2.28.0/tools/beau.py
 +===================================================================
 +--- magics++-2.28.0.orig/tools/beau.py
 ++++ magics++-2.28.0/tools/beau.py
 +@@ -1,10 +1,10 @@
 +-
 ++from __future__ import print_function
 + import xml.dom.minidom
 + 
 + xml = xml.dom.minidom.parse("../src/xml/TextVisitor.xml") # or xml.dom.minidom.parseString(xml_string)
 + pretty_xml_as_string = xml.toprettyxml()
 + 
 + 
 +-print pretty_xml_as_string
 ++print (pretty_xml_as_string)
 + 
 + 
 +Index: magics++-2.28.0/tools/xml2doc.py
 +===================================================================
 +--- magics++-2.28.0.orig/tools/xml2doc.py
 ++++ magics++-2.28.0/tools/xml2doc.py
 +@@ -1,4 +1,4 @@
 +-
 ++from __future__ import print_function
 + from xml.sax.handler import ContentHandler
 + from xml.sax import make_parser
 + import sys
 +@@ -122,7 +122,7 @@ class ObjectHandler(ContentHandler):
 + 			if self.inherits != '':
 + 				try:
 + 					file = open("xml/%s.xml" % attrs.get("inherits"), "r")
 +-					print " inherits ->%s" % self.inherits
 ++					print (" inherits ->%s" % self.inherits)
 + 					object = ObjectHandler()
 + 					parser = make_parser()
 + 					object.params = []
 +Index: magics++-2.28.0/tools/xml2html.py
 +===================================================================
 +--- magics++-2.28.0.orig/tools/xml2html.py
 ++++ magics++-2.28.0/tools/xml2html.py
 +@@ -1,4 +1,5 @@
 + #!/usr/bin/python
 ++from __future__ import print_function
 + from xml.sax.handler import ContentHandler
 + from xml.sax import make_parser
 + from types import *
 +@@ -26,7 +27,7 @@ class ObjectHandler(ContentHandler):
 + 		p["type"] = "toggle"
 + 		
 + 	def anyset(p, attrs):
 +-		if  attrs.has_key("values") :
 ++		if  "values" in attrs:
 + 			val = attrs["values"]
 + 			values = val.split("/")
 + 			p["values"] = values
 +@@ -42,7 +43,7 @@ class ObjectHandler(ContentHandler):
 + 
 + 
 + 	def get(self, attrs, name, default):
 +-		if  attrs.has_key(name):
 ++		if  name in attrs:
 + 			return attrs.get(name)
 + 		else :
 + 			return default
 +@@ -53,7 +54,7 @@ class ObjectHandler(ContentHandler):
 + 		p["type"] = attrs.get("to")
 + 		p["values"] = []
 + 		t = p["type"]
 +-		if  self.types.has_key(t) :
 ++		if  t in self.types:
 + 			self.types[t](p, attrs)
 + 		else :
 + 			p["type"]="toggle"
 +@@ -68,9 +69,9 @@ class ObjectHandler(ContentHandler):
 + 		o["name"] = attrs.get("name")
 + 		o["documentation"] = ""
 + 		o["parameters"] = []
 +-		if  attrs.has_key("inherits") :
 ++		if  "inherits" in attrs:
 + 			o["inherits"]=attrs.get("inherits")
 +-			print o["name"] + " inhrits from " + o["inherits"]
 ++			print (o["name"] + " inhrits from " + o["inherits"])
 + 		return o
 + 
 + 	def startElement(self, name, attrs):
 +@@ -90,12 +91,12 @@ class ObjectHandler(ContentHandler):
 + 		if ( name == "option") : 
 + 			val = attrs.get("fortran")
 + 			self.param["values"].append(val)
 +-			if ( self.param.has_key(val) == False ):
 ++			if "val" not in self.param:
 + 				self.param[val] = []
 + 			self.param[val].append(attrs.get("name"))
 + 		if ( name == "set" ) : 
 + 			val = attrs.get("value")
 +-			if ( self.param.has_key(val) == False ):
 ++			if "val" not in self.param:
 + 				self.param[val] = []
 + 			self.param[val].append(attrs.get("name"))
 + 
 +@@ -118,7 +119,7 @@ class ObjectHandler(ContentHandler):
 + 			self.actiondoc= ""
 + 			
 + 	def printDef(self):
 +-		print json.dumps(self.magics, indent=2)
 ++		print (json.dumps(self.magics, indent=2))
 + 	
 + 
 + 	def parse(self, file):
 +@@ -133,25 +134,25 @@ class ObjectHandler(ContentHandler):
 + 		parameters = []
 + 			
 + 		for a in actions:
 +-			if ( type(a) != dict and self.magics.has_key(a) ) :
 ++			if ( type(a) != dict and a in self.magics) :
 + 			# external object
 + 				action = self.magics[a]
 +-				if action.has_key("inherits") :
 ++				if "inherits" in action:
 + 					parent = action["inherits"]
 + 					definition = self.magics[parent]
 +-					print  a + " xxxxinherits from " + parent
 ++					print ( a + " xxxxinherits from " + parent)
 + 			
 +-					print "??????????????????"
 ++					print ("??????????????????")
 + 					for p in definition["parameters"]:
 +-						print p["name"]	
 ++						print (p["name"] )
 + 						parameters.append(p)
 +-					print "---------------"
 ++					print ("---------------")
 + 
 + 				for param in action["parameters"]:
 + 					#print "add" + param["name"]
 + 					parameters.append(param)
 + 					for val in param["values"]:
 +-						if param.has_key(val) :
 ++						if val in param:
 + 							param[val] = self.build(param[val], action)
 + 						else :
 + 							param[val] = [] 
 +Index: magics++-2.28.0/tools/xml2odt.py
 +===================================================================
 +--- magics++-2.28.0.orig/tools/xml2odt.py
 ++++ magics++-2.28.0/tools/xml2odt.py
 +@@ -1,4 +1,5 @@
 + #!/usr/bin/python
 ++from __future__ import print_function
 + from xml.sax.handler import ContentHandler
 + from xml.sax import make_parser
 + from types import *
 +@@ -7,8 +8,8 @@ import sys
 + 
 + 
 + if(len(sys.argv) != 3) :
 +-    print "\n\tYou need to give 2 input parameters:"
 +-    print "\n\t  %s source.xml target.odt\n" % sys.argv[0]
 ++    print ("\n\tYou need to give 2 input parameters:")
 ++    print ("\n\t  %s source.xml target.odt\n" % sys.argv[0])
 +     sys.exit()
 + 
 + 
 +Index: magics++-2.28.0/tools/xml2split.py
 +===================================================================
 +--- magics++-2.28.0.orig/tools/xml2split.py
 ++++ magics++-2.28.0/tools/xml2split.py
 +@@ -1,5 +1,5 @@
 + 
 +-
 ++from __future__ import print_function
 + from xml.sax.handler import ContentHandler
 + from xml.sax import make_parser
 + import sys
 +@@ -32,7 +32,7 @@ class ObjectHandler(ContentHandler):
 + 			self.file.write(data);
 + 
 + 	def startElement(self, name, attrs):
 +-		print "found %s " % name
 ++		print ("found %s " % name)
 + 		if (name == "magics") :
 + 			return
 + 		if (name == "static") :
 +@@ -44,13 +44,13 @@ class ObjectHandler(ContentHandler):
 + 			self.file=open(filename, "w")
 + 			self.open_file = 1;
 + 			self.file.write("<magics>\n")
 +-			print "open %s " % filename
 ++			print ("open %s " % filename)
 + 		self.nice(name, attrs)
 + 		self.tab1 = self.tab1+1
 + 		self.tab2 = self.tab2+1
 + 
 + 	def endElement(self,name):
 +-		print "close %s\n " % name
 ++		print ("close %s\n " % name)
 + 		if ( self.open_file == 0):
 + 			return
 + 
 +Index: magics++-2.28.0/tools/xml2mv.py
 +===================================================================
 +--- magics++-2.28.0.orig/tools/xml2mv.py
 ++++ magics++-2.28.0/tools/xml2mv.py
 +@@ -1,4 +1,5 @@
 + #!/usr/bin/python
 ++from __future__ import print_function
 + from xml.sax.handler import ContentHandler
 + from xml.sax import make_parser
 + from types import *
 +@@ -7,8 +8,8 @@ import sys
 + 
 + 
 + if(len(sys.argv) != 6) :
 +-    print "\n\tYou need to give 4 input parameters:"
 +-    print "\n\t  %s source.xml targetDef CLASS_NAME rulesDef\n" % sys.argv[0]
 ++    print ("\n\tYou need to give 4 input parameters:")
 ++    print ("\n\t  %s source.xml targetDef CLASS_NAME rulesDef\n" % sys.argv[0])
 +     sys.exit()
 + 
 + 
 +@@ -73,7 +74,7 @@ class ObjectHandler(ContentHandler):
 + 
 + 	def default(self, attrs):
 + 		val = attrs.get("metview_default");
 +-		if ( isinstance(val, NoneType) ):
 ++		if ( isinstance(val, type(None)) ):
 + 			val = attrs.get("default");
 + 
 + 		if (val == "") :
 +@@ -311,7 +312,7 @@ class ObjectHandler(ContentHandler):
 + 
 + 
 + 	def addOptionalParam(self, paramname, requirements):
 +-		if paramname in self.optionalparams.keys():
 ++		if paramname in self.optionalparams:
 + 			if not(requirements[0] in self.optionalparams[paramname]):
 + 				self.optionalparams[paramname] = self.optionalparams[paramname] + requirements
 + 		else:
 +@@ -319,7 +320,7 @@ class ObjectHandler(ContentHandler):
 + 
 + 
 + 	def addRelatedOptionalRequirements(self):
 +-		optparams = self.optionalparams.keys()
 ++		optparams = list(self.optionalparams.keys())
 + 		for optparam in optparams:
 + 			conditions = self.optionalparams[optparam]
 + 			for condition in conditions:
 +@@ -328,7 +329,7 @@ class ObjectHandler(ContentHandler):
 + 
 + 
 + 	def addRelatedOptionalRequirements2(self):
 +-		optparams = self.optionalparams.keys()
 ++		optparams = list(self.optionalparams.keys())
 + 		for optparam in optparams:
 + 			conditions = self.optionalparams[optparam]
 + 			for condition in conditions:
 +@@ -341,9 +342,9 @@ class ObjectHandler(ContentHandler):
 + 
 + 	# see top of file for description of optionalparams and optionalparams2
 + 	def reorganiseOptionalParameters(self):
 +-		for optparam in self.optionalparams.keys():
 ++		for optparam in self.optionalparams:
 + 			condition = self.optionalparams[optparam]
 +-			if condition in self.optionalparams2.keys():
 ++			if condition in self.optionalparams2:
 + 				self.optionalparams2[condition].add(optparam)
 + 			else:
 + 				self.optionalparams2[condition] = set([optparam])
 +@@ -355,7 +356,7 @@ class ObjectHandler(ContentHandler):
 + 	def ensureOptionalParameters2DependenciesAreInRightOrder(self):
 + 		self.optionalparams3 = () # empty tuple, will contain an ordered version of optionalparams2
 + 
 +-		for conditions2 in self.optionalparams2.keys():
 ++		for conditions2 in self.optionalparams2:
 + 			# does this rule unset something that is needed in the optionalparams3 rules?
 + 			unsetparams2 = self.optionalparams2[conditions2]
 + 			newtuple3 = (conditions2, unsetparams2)
 +@@ -374,7 +375,7 @@ class ObjectHandler(ContentHandler):
 + 
 + 			# we now know that the clause should go into position 'position' in the new tuple
 + 			if self.debug:
 +-				print "put into position " + str(position)
 ++				print ("put into position " + str(position))
 + 			if position == 0:
 + 				firstpart = ()
 + 				secondpart = (newtuple3,)
 +@@ -395,7 +396,7 @@ class ObjectHandler(ContentHandler):
 + 
 + 
 + 	def newClass(self, c):
 +-		if not (c in self.classes.keys()):
 ++		if not (c in self.classes):
 + 			self.classes[c] = {"inherits_reqs_from": set(),   # 'inherits_params_from' is an empty set
 + 			                   "inherits_params_from": set()}
 + 			#print "newClass " + c
 +@@ -437,7 +438,7 @@ class ObjectHandler(ContentHandler):
 + 			params = self.classes[c].get("params", ())
 + 			for p in params:
 + 				x = reqs
 +-				if x <> ():
 ++				if x != ():
 + 					self.addOptionalParam(p, x)
 + 					#self.addOptionalParam(p, (x,))
 + 
 +@@ -455,11 +456,11 @@ class ObjectHandler(ContentHandler):
 + 		#print spaces + "enter rec, class = " + classname
 + 		for parent in i:
 + 			#print parent
 +-			if parent <> None:
 ++			if parent != None:
 + 				reqs = self.addRecursiveInheritedClassRequirements(parent, reclevel+1)
 + 				#print spaces + "reqs: "
 + 				#print reqs
 +-				if reqs <> None:
 ++				if reqs != None:
 + 					for req in reqs:
 + 						#print "ADDING REQ FROM RECURSIVE"
 + 						self.addRequirementToClass(req[0], req[1], classname)
 +@@ -481,11 +482,11 @@ class ObjectHandler(ContentHandler):
 + 		#print spaces + "enter rec, class = " + classname
 + 		for parent in i:
 + 			#print parent
 +-			if parent <> None:
 ++			if parent != None:
 + 				params = self.addRecursiveInheritedClassParams(parent, reclevel+1)
 + 				#print spaces + "reqs: "
 + 				#print reqs
 +-				if params <> None:
 ++				if params != None:
 + 					for params in params:
 + 						#print "ADDING REQ FROM RECURSIVE"
 + 						self.addParamsFromOneClassToAnother(parent, classname)
 +@@ -532,7 +533,7 @@ class ObjectHandler(ContentHandler):
 + 					try:
 + 						file = open(fname, "r")
 + 						if (self.debug):
 +-							print "Opened (start class)" + fname
 ++							print ("Opened (start class)" + fname)
 + 						self.filehistory.append(fname)
 + 						object = ObjectHandler()
 + 						object.myoptions = []
 +@@ -568,17 +569,17 @@ class ObjectHandler(ContentHandler):
 + 				return
 + 			if (attrs.get("inherit_parent_reqs") != 'no'):
 + 				docclass = attrs.get("doc_class", None)
 +-				if docclass <> None:
 ++				if docclass != None:
 + 					paramclass = docclass
 + 				else:
 + 					paramclass = self.classname
 + 				self.addParameterToClass(self.param, paramclass)
 +-			type = attrs.get("to")
 ++			typ = attrs.get("to")
 + 			metview_type = attrs.get("metview_interface")
 +-			if metview_type <> None:
 +-				type = metview_type
 +-			if (self.types.has_key(type)):
 +-				f = self.types[type]
 ++			if metview_type != None:
 ++				typ = metview_type
 ++			if typ in self.types:
 ++				f = self.types[typ]
 + 				self.newparam(self.param, f(self, attrs), self.default(attrs))
 + 			else:
 + 				self.last = self.last + self.options(attrs)
 +@@ -605,7 +606,7 @@ class ObjectHandler(ContentHandler):
 + 					#	self.classes[attrs.get("name")]["inherits_reqs_from"].add(self.classname)
 + 					#	print "YClass " + attrs.get("name") + " inherits_reqs_from " + self.classname
 + 					if attrs.get("docdive") != 'no' and  attrs.get("doc_inherits") != 'no' :
 +-						if ( not(isinstance(attrs.get("xmlfile"), NoneType))):
 ++						if ( not(isinstance(attrs.get("xmlfile"), type(None)))):
 + 							fname = "/%s.xml" % attrs.get("xmlfile")
 + 						else:
 + 							fname = "%s/%s.xml" % (sys.argv[1], attrs.get("name"))
 +@@ -614,7 +615,7 @@ class ObjectHandler(ContentHandler):
 + 								file = open(fname, "r")
 + 								self.filehistory.append(fname)
 + 								if (self.debug):
 +-									print "Opened (start option) " + fname
 ++									print ("Opened (start option) " + fname)
 + 								object = ObjectHandler()
 + 								object.myoptions = []
 + 								object.myrules = {}
 +@@ -667,8 +668,8 @@ class ObjectHandler(ContentHandler):
 + 			self.last = self.last + "\t} = %s\n" % self.defparam
 + 			self.newparam(self.param, self.last, self.defparam)
 + 			if (self.debug) :
 +-				print "  endparam: " + self.param
 +-				print "  endparam SL: \n" + self.last
 ++				print ("  endparam: " + self.param)
 ++				print ("  endparam SL: \n" + self.last)
 + 			self.last = ""
 + 			for option in self.myoptions:
 + 				for p in option:
 +@@ -768,7 +769,7 @@ class ObjectHandler(ContentHandler):
 + 				# two different ways to generate the rules
 + 				if False:
 + 					rules = open(sys.argv[5], "w")
 +-					for optparam in self.optionalparams.keys():
 ++					for optparam in self.optionalparams:
 + 						rules.write("\n%if")
 + 						first = True
 + 						prevparam = ""
 +@@ -845,4 +846,4 @@ saxparser.setContentHandler(object)
 + 
 + datasource = open(sys.argv[1] +"/" + sys.argv[2], "r")
 + saxparser.parse(datasource)
 +-print "DONE"
 ++print ("DONE")
 +Index: magics++-2.28.0/python/Magics/macro.py
 +===================================================================
 +--- magics++-2.28.0.orig/python/Magics/macro.py
 ++++ magics++-2.28.0/python/Magics/macro.py
 +@@ -1,3 +1,4 @@
 ++from __future__ import print_function
 + import os
 + import Magics
 + import numpy
 +@@ -61,7 +62,7 @@ class Action(object):
 + 		return x
 + 
 + 	def inspect(self):
 +-		print self
 ++		print (self)
 + 
 + 	def quote(self, v):
 + 		return "\"" + v + "\""
 +@@ -120,12 +121,12 @@ class Action(object):
 + 				dim  = len(self.args[key].shape)
 + 				if isinstance(self.args[key][0], int):
 + 					if (dim == 2) :
 +-				   		print "pset2i" 
 ++				   		print ("pset2i")
 + 					else :
 +-				   		print "pset1i" 
 ++				   		print I"pset1i")
 + 				elif ( type == 'float64' or type == 'float32') :
 + 					if (dim == 2) :
 +-				   		print "pset2r" 
 ++				   		print ("pset2r")
 + 					else :
 + 				   		vval = ""
 + 				   		vsep = ""
 +@@ -138,10 +139,10 @@ class Action(object):
 + 				   		vval += ""
 + 				   		val+= '%s%s = [%s]'%(sep, key, vval)
 + 				else :
 +-					print "type???->", key
 ++					print ("type???->", key)
 + 			sep=",\n\t"
 + 				
 +-		print >>file, val + ")\n"
 ++		print (val + ")\n", file=file)
 + 
 + 	def tomv4(self, file):
 + 		sep="\t"
 +@@ -167,20 +168,20 @@ class Action(object):
 + 				   vval += "]"
 + 				   val+= '%s%s = %s'%(sep, key.upper(), vval)
 + 				elif isinstance(self.args[key][0], int):
 +-				   print "pset1i"
 ++				   print ("pset1i")
 + 				elif isinstance(self.args[key][0], float):
 +-				   print "pset1r" 
 ++				   print ("pset1r") 
 + 			elif isinstance(self.args[key], numpy.ndarray) :
 + 				type = self.args[key].dtype
 + 				dim  = len(self.args[key].shape)
 + 				if isinstance(self.args[key][0], int):
 + 					if (dim == 2) :
 +-				   		print "pset2i" 
 ++				   		print ("pset2i")
 + 					else :
 +-				   		print "pset1i" 
 ++				   		print ("pset1i")
 + 				elif ( type == 'float64' or type == 'float32') :
 + 					if (dim == 2) :
 +-				   		print "pset2r" 
 ++				   		print ("pset2r" )
 + 					else :
 + 				   		vval = "["
 + 				   		vsep = ""
 +@@ -191,10 +192,10 @@ class Action(object):
 + 				   		val+= '%s%s = %s'%(sep, key.upper(), vval)
 + 				   		
 + 				else :
 +-					print "type???->", key
 ++					print ("type???->", key)
 + 			sep=",\n\t"
 + 				
 +-		print >> file, val + "\n"
 ++		print (val + "\n", file=file)
 + 
 + 
 + 
 +@@ -202,18 +203,18 @@ class Action(object):
 + 
 + 	def tofortran(self, f):
 + 		if self.action == Magics.new_page :
 +-			print >> f, '\tcall pnew("page")'
 ++			print ('\tcall pnew("page")', file=f)
 + 			return
 + 		for key in self.args.keys():
 + 			if isinstance(self.args[key], str):
 + 				if key == 'odb_data':
 + 					Magics.setc('odb_filename', self.args[key])
 + 				else:
 +-					print >> f, '\tcall psetc("%s", "%s")'%(key, self.args[key])
 ++					print('\tcall psetc("%s", "%s")'%(key, self.args[key]), file=f)
 + 			elif isinstance(self.args[key], int):
 +-				print >>f, '\tcall pseti("%s", %d)'%(key, self.args[key])
 ++				print ('\tcall pseti("%s", %d)'%(key, self.args[key]), file=f)
 + 			elif isinstance(self.args[key], float):
 +-				print >> f, '\tcall psetr("%s", %0.2f)'%(key, self.args[key])
 ++				print ('\tcall psetr("%s", %0.2f)'%(key, self.args[key]), file=f)
 + 			elif isinstance(self.args[key], list) :
 + 				if isinstance (self.args[key][0], str):
 + 				   nb = 0
 +@@ -230,9 +231,9 @@ class Action(object):
 + 							sep = ",&\n\t\t"
 + 							newline = newline + 70
 + 				   val += "/)"
 +-				   print >>f, '\tcall pset1c("%s", %s, %d)'%(key, val, len(self.args[key]))
 ++				   print ('\tcall pset1c("%s", %s, %d)'%(key, val, len(self.args[key])), file=f)
 + 				elif isinstance(self.args[key][0], int):
 +-				   print "pset1i"
 ++				   print ("pset1i")
 + 				elif isinstance(self.args[key][0], float):
 + 				   	val = "(/"
 + 				   	sep = ""
 +@@ -240,18 +241,18 @@ class Action(object):
 + 				   		val += sep + ("%0.2f" % v)
 + 				   		sep = ", "
 + 				   	val += "/)"
 +-				   	print >>f, '\tcall pset1r("%s", %s, %d)'%(key, val, len(self.args[key]))
 ++				   	print ('\tcall pset1r("%s", %s, %d)'%(key, val, len(self.args[key])), file=f)
 + 			elif isinstance(self.args[key], numpy.ndarray) :
 + 				type = self.args[key].dtype
 + 				dim  = len(self.args[key].shape)
 + 				if isinstance(self.args[key][0], int):
 + 					if (dim == 2) :
 +-				   		print "pset2i" 
 ++				   		print ("pset2i")
 + 					else :
 +-				   		print "pset1i" 
 ++				   		print ("pset1i")
 + 				elif ( type == 'float64' or type == 'float32') :
 + 					if (dim == 2) :
 +-				   		print "pset2r" 
 ++				   		print ("pset2r")
 + 					else :
 + 				   		val = "(/"
 + 				   		sep = ""
 +@@ -259,20 +260,20 @@ class Action(object):
 + 				   			val += sep + ("%0.2f" % v)
 + 				   			sep = ", "
 + 				   		val += "/)"
 +-				   		print >>f, '\tcall pset1r("%s", %s, %d)'%(key, val, len(self.args[key]))
 ++				   		print ('\tcall pset1r("%s", %s, %d)'%(key, val, len(self.args[key])), file=f)
 + 				elif isinstance(self.args[key][0], int):
 +-				   		print "pset1r" 
 ++				   		print ("pset1r" )
 + 				else :
 +-					print "type???->", key
 ++					print ("type???->", key)
 + 
 + 		if self.action != None and actions[self.verb] != "" and actions[self.verb] != "pinput":
 +-			print >>f, "\tcall %s\n"%actions[self.verb] 
 ++			print ("\tcall %s\n"%actions[self.verb] , file=f)
 + 			for key in self.args.keys():
 +-				print >>f, "\tcall preset('%s')"%key 
 +-			print >>f, ""
 ++				print ("\tcall preset('%s')"%key , file=f)
 ++			print ("", file=f)
 + 
 + 		else:
 +-			print >>f, ""
 ++			print ("", file=f)
 + 
 + 
 + 	def clean_object(self, obj):
 +@@ -291,8 +292,8 @@ class Action(object):
 + 			for i,v in obj.iteritems():
 + 				obj[i] = self.clean_object(v)
 + 		else:
 +-			print "Invalid object in data, converting to string: " 
 +-			print  type(obj)
 ++			print ("Invalid object in data, converting to string: " )
 ++			print ( type(obj))
 + 			obj = str(obj) 
 + 		return obj
 + 
 +@@ -332,7 +333,7 @@ class Action(object):
 + 					else :
 + 						Magics.set1r(key, self.args[key].copy())
 + 				else :
 +-					print "type???->", key
 ++					print ("type???->", key)
 + 
 + 			else:
 + 				self.args[key].execute(key)
 +@@ -443,26 +444,26 @@ def plot(*args):
 + 
 + 
 + def tofortran(file, *args):
 +-	f = open(file+".f90",'w')
 +-	print >>f, "\tprogram magics\n"
 +-	print >>f, "\tcall popen\n"
 +-	for n in args:
 ++	with open(file+".f90",'w') as f:
 ++	    print ("\tprogram magics\n", file=f)
 ++	    print ("\tcall popen\n", file=f)
 ++	    for n in args:
 + 		n.tofortran(f)
 +-	print >>f, "\tcall pclose\n"
 +-	print >>f, "\tend"
 ++	    print  ("\tcall pclose\n", file=f)
 ++	    print  ("\tend", file=f)
 + 
 + 
 + def tohtml(file, *args):
 +-	f = open(file+".html",'w')
 +-	print >>f, "<html>"
 +-	for n in args:
 +-		n.tohtml(f)
 +-	print >>f, "</html>"
 ++	with open(file+".html",'w') as f:
 ++	    print ("<html>", file=f)
 ++	    for n in args:
 ++	        n.tohtml(f)
 ++	    print ("</html>", file=f)
 + 
 + def tomv4(file, *args):
 +-	f = open(file+".mv4",'w')
 +-	for n in args:
 +-		n.tomv4(f)
 ++        with open(file+".mv4",'w') as f:
 ++	    for n in args:
 ++	        n.tomv4(f)
 + 
 + class  odb_filter(object):
 + 	def __init__(self, _m = None,**kw):
 +@@ -476,17 +477,17 @@ class  odb_filter(object):
 + 		odb = "%s.odb" % file 
 + 		context.tmp.append(odb)
 + 		cmd = "odbsql -q \"" + self.args["query"] + "\" -i " + self.args["path"] + " -f newodb -o " + odb
 +-		print cmd 
 ++		print (cmd)
 + 		if (os.system(cmd)) :
 +-			print "Error in filtering ODB data... Aborting"
 ++			print ("Error in filtering ODB data... Aborting")
 + 			os.abort();
 + 		Magics.setc('odb_filename', odb)
 + 	def inspect(self):
 + 		cmd = "odbsql -q \"" + self.args["query"] + "\" -i " + self.args["path"] + " -o data.ascii"
 + 		if (os.system(cmd)) :
 +-			print "Error in filtering ODB data... Aborting"
 ++			print ("Error in filtering ODB data... Aborting")
 + 			os.abort();
 + 		cmd =  os.environ['ODB_REPORTER'] + " %s" % "data.ascii"
 + 		if (os.system(cmd)) :
 +-			print "Error in viewing ODB data... Aborting"
 ++			print ("Error in viewing ODB data... Aborting")
 + 			os.abort();
 +Index: magics++-2.28.0/python/Magics/metgram.py
 +===================================================================
 +--- magics++-2.28.0.orig/python/Magics/metgram.py
 ++++ magics++-2.28.0/python/Magics/metgram.py
 +@@ -1,3 +1,4 @@
 ++from __future__ import print_function
 + import simplejson
 + import tempfile
 + import os
 +@@ -309,7 +310,7 @@ def metgram(*args):
 + 
 + 	error = os.system(cmd)
 + 	if (error != 0):
 +-		print "Error found"
 ++		print ("Error found")
 + 	f.close
 + 	
 + 
 +Index: magics++-2.28.0/python/Magics/CMakeLists.txt
 +===================================================================
 +--- magics++-2.28.0.orig/python/Magics/CMakeLists.txt
 ++++ magics++-2.28.0/python/Magics/CMakeLists.txt
- @@ -28,6 +28,10 @@ if( HAVE_PYTHON )
-  
-    swig_add_module( Magics python Magics_interface.cc ${CMAKE_CURRENT_BINARY_DIR}/Magics.i )
++@@ -25,9 +25,13 @@ if( HAVE_PYTHON )
++   include_directories( ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} )
 + 
++   set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/Magics.i PROPERTIES GENERATED TRUE CXX ON )
+++  
 ++  if (${PYTHON_VERSION_MAJOR} EQUAL 3)
- +      set_source_files_properties( Magics.i PROPERTIES SWIG_FLAGS "-py3" )
+++	  set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/Magics.i PROPERTIES SWIG_FLAGS "-py3" )
 ++  endif()
- +    
++ 
++   swig_add_module( Magics python Magics_interface.cc ${CMAKE_CURRENT_BINARY_DIR}/Magics.i )
++-
+++  
 +   set_source_files_properties(partio.i PROPERTIES SWIG_FLAGS "-includeall")
 + 
 +   swig_link_libraries( Magics MagPlus ${PYTHON_LIBRARIES} )
diff --cc debian/patches/series
index 840fe07,5ca6e6d..e5de3df
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,12 -1,8 +1,10 @@@
- cve-2010-3393.patch
  terralib.patch
- gcc-4.7.patch
- magics-config.patch
- fix-headers.patch
 +python3.patch
- geotiff.patch
  soname-version.patch
- grib-cmake.patch 
  reproducibility.patch
+ pkgconfig-fix.patch
  cmake-config.patch
- qt5.patch
+ unique-ptr.patch
+ compile-fixes.patch
+ g++-6.patch
++numpy-fixes.patch
diff --cc debian/rules
index f69f11f,e86918a..d151114
--- a/debian/rules
+++ b/debian/rules
@@@ -106,12 -96,12 +106,17 @@@ override_dh_auto_build
  
  override_dh_auto_test check:
  	# echo "Tests disabled; see README-testfailures.txt for details"
--	# (ulimit -s 8192; export PYTHONPATH=$(shell pwd)/swig ; export MAGPLUS_HOME=$(shell pwd) ; $(MAKE) check )
++	# §(ulimit -s 8192; export PYTHONPATH=$(CURDIR)/debian/build-py2/python/Magics ; \
++		#export MAGPLUS_HOME=$(CURDIR) ; $(MAKE) -C debian/build-py2  check )
++	(ulimit -s 8192; export PYTHONPATH=$(CURDIR)/debian/build-py3/python/Magics ; \
++		export MAGPLUS_HOME=$(CURDIR) ; $(MAKE) -C debian/build-py3  check )
  
  override_dh_auto_install:
--	$(MAKE) -C debian/build/python/Magics clean install PYTHON_INCLUDE_DIR=/usr/include/python2.7 \
++	$(MAKE) -C debian/build-py3/python/Magics clean install PYTHON_INCLUDE_DIR=/usr/include/python3.5 \
++			DESTDIR=$(CURDIR)/debian/python3-magics++ \ MAGPLUS_HOME=$(CURDIR) 
++	$(MAKE) -C debian/build-py2/python/Magics clean install PYTHON_INCLUDE_DIR=/usr/include/python2.7 \
  			DESTDIR=$(CURDIR)/debian/python-magics++ \ MAGPLUS_HOME=$(CURDIR) 
--	dh_auto_install
++	dh_auto_install --builddirectory=debian/build-py3
  	# Move lib stuff
  	mkdir -p debian/tmp/$(LIBDIR)
  	cp -a debian/tmp/usr/lib/*.a debian/tmp/usr/lib/pkgconfig debian/tmp/$(LIBDIR)
@@@ -126,6 -116,6 +131,7 @@@
  		> debian/tmp/$(LIBDIR)/cmake/magics/magics-targets-none.cmake
  	rm -r debian/tmp/usr/share/magics/cmake
  	dh_python2 /usr/lib/python2.7/site-packages/Magics
++	dh_python3 /usr/lib/python3.5/site-packages/Magics
  	dh_numpy -p python-magics++
  	find debian/tmp debian/python-magics++  -name '*.so*' -exec chrpath -d {} \;
  	-find debian/tmp/usr/bin -type f  -exec chrpath -d {} \;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/magics.git



More information about the debian-science-commits mailing list