-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE REQUEST] adding scipy.integrate #698
Comments
It's never occurred to me that one might need more than simple sums on a microcontroller, but if you think that it might have its uses, then by all means, please, create a PR. A couple of comments:
|
Hi Zoltan, as for item 1, I think it would be useful to have more than one algorithm. CPython scipy.integrate also has more than one, mainly because different algos have different uses, strengths and weaknesses, and we're really talking about just a few hundred bytes on binary space. But granted, ulab users may want to constrain their image sizes so - ok, no problem. I'll make sure that I write (or refer to) in the docs what each algo is good for, to allow for informed choices. Given that many recent microcontroller boards come with plenty of flash it should not be such a big issue anyway.
PR coming in a minute. |
OK, thanks! |
I don't see where that happens. On the other hand, for the case, when a compiler doesn't support |
Ah, there I was in error. I added code like
in all relevant places. Coming with the next PR. In fact, if you don't do this, |
OK, this test
now says
|
This test is not yet in the PR, right? |
Nah, I just created a new one where all is in I think. |
@v923z In the documentation section for scipy.integrate, I see "UsageError: Cell magic |
Implemented in #699 |
Did you run the cells that define the cell magic? I assume you're on linux, so the RAM disc works. Otherwise, on windows, you might have to install RAM disc, and then modify the pointer in the relevant section of the magic definition. |
Earlier this year, I added a numeric integration module to Circuitpython's ulab.scipy as provided in my repo and written in the Adafruit Playground blog. The integration algorithms
were taken from this paper are are used with the kind written permission of the author. His code is under the MIT license, and so is my port to micropython-ulab. The latest version of the patch is in
lvgl_micropython.diff
in my repo. As you can see, everything is already according to the respective coding conventions, and the compilation can be controlled by setting ULAB_SCIPY_HAS_INTEGRATE_MODULE to 0 or 1. Needless to say that numerical integration makes limited sense with fp32 math but switching on fp64 e.g. for ESP32 is easy (in fact, easier in Micropython than in Circuitpython). The mpconfigport.h and mpconfigboard.h code is there as well. The code was tested in Circuitpython with an Adafruit Feather M4 Express, UM Feather S2, and a Teensy 4.0 using Adafruit's Feather adapter, and on LVGL-Micropython on a generic ESP32-S3 module. Compiling for rp2 failed outside of my code so far, didn't dig into this yet. But since there are no hardware dependencies, I do not expect any problems on any platform that has enough flash.If you are interested, let me know and I'll fire up a PR. Disregard the LVGL part for the moment - I'll separate the patches anyway.
The text was updated successfully, but these errors were encountered: