Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Lightweight version of python-control#808

CesMak started this conversation inGeneral
Discussion options

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

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 isharold, but it also requires numpy, scipy, and matplot lib.

You must be logged in to vote
0 replies
Comment options

@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 examplebode_plot andstep_plot type functions)

You must be logged in to vote
0 replies
Comment options

@murrayrm You are correct sry ma listening above is incorrect it was forhttps://pypi.org/project/control-toolbox/.
The libs loaded are currently:

NameVersionSource
pyparsing3.0.9pyodide
packaging21.3pyodide
micropip0.1pyodide
control0.9.2https://www.piwheels.org/simple/control/control-0.9.2-py2.py3-none-any.whl
six1.16.0pyodide
cycler0.11.0pyodide
kiwisolver1.4.3pyodide
fonttools4.33.3pyodide
python-dateutil2.8.2pyodide
pytz2022.1pyodide
PIL9.1.1pyodide
numpy1.22.4pyodide
matplotlib3.5.2pyodide
scipy1.8.1pyodide
distutils1.0pyodide
clapack3.2.1pyodide
pillow9.1.1pyodide

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 theshort answer is: There is no leightweight / fast version of python-control as of now.

You must be logged in to vote
1 reply
@sawyerbfuller
Comment options

@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:

  1. the time it takes to load python-control, which also loads matplotlib
  2. the time it takes to load matplotlib by itself without python control

If those two numbers arequite 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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
3 participants
@CesMak@murrayrm@sawyerbfuller
Converted from issue

This discussion was converted from issue #807 on December 03, 2022 17:21.


[8]ページ先頭

©2009-2025 Movatter.jp