GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Lightweight version of python-control · python-control/python-control · Discussion #808

Lightweight version of python-control #808

CesMak started this conversation in General
Lightweight version of python-control #808
@CesMak CesMak
Dec 3, 2022 · 3 comments · 1 reply
Return to top
Discussion options
  • Uh oh!

    There was an error while loading. Please reload this page.

CesMak
Dec 3, 2022

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
All reactions

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.

murrayrm
Dec 3, 2022
Maintainer

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
All reactions
0 replies
Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

sawyerbfuller
Dec 3, 2022
Collaborator

@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
All reactions
0 replies
Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

CesMak
Dec 4, 2022
Author

@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
All reactions
1 reply
@sawyerbfuller
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.

sawyerbfuller Dec 7, 2022
Collaborator

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

All reactions
Sign up for free to 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.

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.