* adding scipy integrate, initial check-in * compile unix double-precision, select integrations algos * bumping ulab version number to 6.7.0 * adding documentation * documentation fix * documentation fix * documentation fix * rewritten in some places * complex number error handling * added test cases * resolved importing scipy.integrate * resolved importing scipy.integrate #2 * build integrate only when we have MICROPY_FLOAT_IMPL_DOUBLE * reverting commita4c0c0b* re-pushing failed commit * Revert "re-pushing failed commit" This reverts commita10e89fe14. * improve tests using math.isclose() * enabled fp32 builds * removed conditional includes * adapted to new function names, corrected importing * function names similar to in CPython scipy.integrate, some minor corrections * major rewrite representing the name changes, mapping to CPython scipy.integrate, more background info
58 lines
1.7 KiB
C
58 lines
1.7 KiB
C
/*
|
|
* This file is part of the micropython-ulab project,
|
|
*
|
|
* https://github.com/v923z/micropython-ulab
|
|
*
|
|
* The MIT License (MIT)
|
|
*
|
|
* Copyright (c) 2020 Jeff Epler for Adafruit Industries
|
|
* 2020 Scott Shawcroft for Adafruit Industries
|
|
* 2020-2021 Zoltán Vörös
|
|
* 2020 Taku Fukada
|
|
*/
|
|
|
|
#include <math.h>
|
|
#include "py/runtime.h"
|
|
|
|
#include "../ulab.h"
|
|
#include "optimize/optimize.h"
|
|
#include "signal/signal.h"
|
|
#include "special/special.h"
|
|
#include "linalg/linalg.h"
|
|
#include "integrate/integrate.h"
|
|
|
|
|
|
#if ULAB_HAS_SCIPY
|
|
|
|
//| """Compatibility layer for scipy"""
|
|
//|
|
|
|
|
static const mp_rom_map_elem_t ulab_scipy_globals_table[] = {
|
|
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_scipy) },
|
|
#if ULAB_SCIPY_HAS_INTEGRATE_MODULE
|
|
{ MP_ROM_QSTR(MP_QSTR_integrate), MP_ROM_PTR(&ulab_scipy_integrate_module) },
|
|
#endif
|
|
#if ULAB_SCIPY_HAS_LINALG_MODULE
|
|
{ MP_ROM_QSTR(MP_QSTR_linalg), MP_ROM_PTR(&ulab_scipy_linalg_module) },
|
|
#endif
|
|
#if ULAB_SCIPY_HAS_OPTIMIZE_MODULE
|
|
{ MP_ROM_QSTR(MP_QSTR_optimize), MP_ROM_PTR(&ulab_scipy_optimize_module) },
|
|
#endif
|
|
#if ULAB_SCIPY_HAS_SIGNAL_MODULE
|
|
{ MP_ROM_QSTR(MP_QSTR_signal), MP_ROM_PTR(&ulab_scipy_signal_module) },
|
|
#endif
|
|
#if ULAB_SCIPY_HAS_SPECIAL_MODULE
|
|
{ MP_ROM_QSTR(MP_QSTR_special), MP_ROM_PTR(&ulab_scipy_special_module) },
|
|
#endif
|
|
};
|
|
|
|
static MP_DEFINE_CONST_DICT(mp_module_ulab_scipy_globals, ulab_scipy_globals_table);
|
|
|
|
const mp_obj_module_t ulab_scipy_module = {
|
|
.base = { &mp_type_module },
|
|
.globals = (mp_obj_dict_t*)&mp_module_ulab_scipy_globals,
|
|
};
|
|
#if CIRCUITPY_ULAB
|
|
MP_REGISTER_MODULE(MP_QSTR_ulab_dot_scipy, ulab_scipy_module);
|
|
#endif
|
|
#endif /* ULAB_HAS_SCIPY */
|