GeezerVison is showing github.com — Lightweight version of python-control · python-control/python-control · Discussion #808
Lightweight version of python-control
#808
Dec 3, 2022
·
3 comments
·
1 reply
Discussion options
-
Uh oh!
There was an error while loading. Please reload this page.
|
Hey there,
I would like to use this lib with pyodide in the browser. But it takes a long time to load cause it has so many dependencies:
await pyodide.loadPackage("numpy");
await pyodide.loadPackage("scipy");
await pyodide.loadPackage("matplotlib");
await pyodide.loadPackage("sympy");
await pyodide.loadPackage("pandas");
Do you know if I can use it in a more lightweigt way - or is there any other python control library which does not need so many dependencies?
|
You must be logged in to vote
Replies:
3 comments
·
1 reply
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
-
Uh oh!
There was an error while loading. Please reload this page.
|
The python-control package does not require sympy and pandas is optional (it will use it if it is on the system, but runs fine without it), but the others are pretty integral to the operation of the package.
Another package for control system analysis is harold, but it also requires numpy, scipy, and matplot lib.
|
You must be logged in to vote
0 replies
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
@CesMak could you check on how much time each of these packages takes to load/compile?
If, as I suspect, matplotlib is a significant fraction, then that supports a move to separate out those parts of the library that require it (into for example bode_plot and step_plot type functions)
|
You must be logged in to vote
0 replies
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
|
@murrayrm You are correct sry ma listening above is incorrect it was for https://pypi.org/project/control-toolbox/.
The libs loaded are currently:
| Name |
Version |
Source |
| pyparsing |
3.0.9 |
pyodide |
| packaging |
21.3 |
pyodide |
| micropip |
0.1 |
pyodide |
| control |
0.9.2 |
https://www.piwheels.org/simple/control/control-0.9.2-py2.py3-none-any.whl |
| six |
1.16.0 |
pyodide |
| cycler |
0.11.0 |
pyodide |
| kiwisolver |
1.4.3 |
pyodide |
| fonttools |
4.33.3 |
pyodide |
| python-dateutil |
2.8.2 |
pyodide |
| pytz |
2022.1 |
pyodide |
| PIL |
9.1.1 |
pyodide |
| numpy |
1.22.4 |
pyodide |
| matplotlib |
3.5.2 |
pyodide |
| scipy |
1.8.1 |
pyodide |
| distutils |
1.0 |
pyodide |
| clapack |
3.2.1 |
pyodide |
| pillow |
9.1.1 |
pyodide |
I had a look at harold already and I do not like it - control is a much better lib in many ways.
@sawyerbfuller In that case I have to modify the current lib to my needs which means some effort.
So I guess the short answer is: There is no leightweight / fast version of python-control as of now.
|
You must be logged in to vote
1 reply
Comment options
-
Uh oh!
There was an error while loading. Please reload this page.
-
Uh oh!
There was an error while loading. Please reload this page.
|
@CesMak I think the issue you are looking at is that it takes a long time to load and compile the library in pyiodide, right?
I was suggesting you might be able to determine what fraction is required by a component that I thought might be a sigificant fraction: matplotlib.
you could do this by comparing two quantities:
- the time it takes to load python-control, which also loads matplotlib
- the time it takes to load matplotlib by itself without python control
If those two numbers are quite different almost the same, that would support the creating a version of python control that is not tied to matplotlib would be of interest. Another justification is if one wanted to use a different plotting library.
|
Converted from issue
This discussion was converted from issue #807 on December 03, 2022 17:21.