Giter Club home page Giter Club logo

slycot's Introduction

Python Control Systems Library

The Python Control Systems Library is a Python module that implements basic operations for analysis and design of feedback control systems.

Have a go now!

Try out the examples in the examples folder using the binder service.

The package can also be installed on Google Colab using the commands:

!pip install control
import control as ct

Features

  • Linear input/output systems in state-space and frequency domain
  • Block diagram algebra: serial, parallel, feedback, and other interconnections
  • Time response: initial, step, impulse
  • Frequency response: Bode, Nyquist, and Nichols plots
  • Control analysis: stability, reachability, observability, stability margins, root locus
  • Control design: eigenvalue placement, linear quadratic regulator, sisotool, hinfsyn, rootlocus_pid_designer
  • Estimator design: linear quadratic estimator (Kalman filter)
  • Nonlinear systems: optimization-based control, describing functions, differential flatness

Links

Dependencies

The package requires numpy, scipy, and matplotlib. In addition, some routines use a module called slycot, that is a Python wrapper around some FORTRAN routines. Many parts of python-control will work without slycot, but some functionality is limited or absent, and installation of slycot is recommended (see below). The Slycot wrapper can be found at:

https://github.com/python-control/Slycot

Installation

Conda and conda-forge

The easiest way to get started with the Control Systems library is using Conda.

The Control Systems library has packages available using the conda-forge Conda channel, and as of Slycot version 0.3.4, binaries for that package are available for 64-bit Windows, OSX, and Linux.

To install both the Control Systems library and Slycot in an existing conda environment, run:

conda install -c conda-forge control slycot

Mixing packages from conda-forge and the default conda channel can sometimes cause problems with dependencies, so it is usually best to instally NumPy, SciPy, and Matplotlib from conda-forge as well.

Pip

To install using pip:

pip install slycot   # optional; see below
pip install control

If you install Slycot using pip you'll need a development environment (e.g., Python development files, C and Fortran compilers). Pip installation can be particularly complicated for Windows.

Installing from source

To install from source, get the source code of the desired branch or release from the github repository or archive, unpack, and run from within the toplevel python-control directory:

pip install .

Article and Citation Information

An article about the library is available on IEEE Explore. If the Python Control Systems Library helped you in your research, please cite:

@inproceedings{python-control2021,
  title={The Python Control Systems Library (python-control)},
  author={Fuller, Sawyer and Greiner, Ben and Moore, Jason and
          Murray, Richard and van Paassen, Ren{\'e} and Yorke, Rory},
  booktitle={60th IEEE Conference on Decision and Control (CDC)},
  pages={4875--4881},
  year={2021},
  organization={IEEE}
}

or the GitHub site: https://github.com/python-control/python-control

Development

Code

You can check out the latest version of the source code with the command:

git clone https://github.com/python-control/python-control.git

Testing

You can run the unit tests with pytest to make sure that everything is working correctly. Inside the source directory, run:

pytest -v

or to test the installed package:

pytest --pyargs control -v

License

This is free software released under the terms of the BSD 3-Clause License. There is no warranty; not even for merchantability or fitness for a particular purpose. Consult LICENSE for copying conditions.

When code is modified or re-distributed, the LICENSE file should accompany the code or any subset of it, however small. As an alternative, the LICENSE text can be copied within files, if so desired.

Contributing

Your contributions are welcome! Simply fork the GitHub repository and send a pull request.

Please see the Developer's Wiki for detailed instructions.

slycot's People

Contributors

artpelling avatar avventi avatar bnavigator avatar cwrowley avatar giplessis avatar jakevdp avatar jerkern avatar jgoppert avatar jgspiro avatar jkp3nt avatar johannes-scharlach avatar kybernetikjo avatar lucasrmehl avatar lytex avatar marcuslil avatar mdclemen avatar moorepants avatar murrayrm avatar painyeph avatar rabraker avatar repagh avatar roryyorke avatar saasaa avatar slivingston avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

slycot's Issues

fails to build with local numpy

The CMake file only looks in the main python site directory, not in the other directories. Therefore, it fails to find a custom numpy installation via pip, which is however necessary if some other library requires a more recent version of numpy than available from the distribution's (here Ubuntu) packages.

See the following Dockerfile, which should work without the ln -s line, but doesn't.

FROM ubuntu:18.04
RUN apt-get -qy update && apt-get -qy install python3-pip
RUN apt-get -qy install cmake gfortran libopenblas-dev 
RUN pip3 install numpy scikit-build
# BUG: doesn't work without this line:
RUN ln -s /usr/local/lib/python3.6/dist-packages/numpy /usr/lib/python3/dist-packages/numpy  
RUN pip3 install slycot

The correct path to look for numpy (required for the f2py headers) can be determined with:
python3 -c "from os.path import dirname; import numpy; print(dirname(dirname(numpy.__file__)))"

Coveralls not reporting increase

Something is still wrong with the coveralls setup. #104 is not reporting an increase but a "first build on testexamples" which is a branchname that does not exist on the python-contol/Slycot but is from the PR origin.

Probably related: The commit message of the coveralls report is also broken.

Screenshot_20200413_233624

It should look more like on python-control:
Screenshot_20200413_233823

"Building Linux wheels for Python 3.8 requires a compiler (e.g gcc)."

The pip install process for slycot fails on most clean linux installs. Here are the results running in a circleci/python Docker container:

$ pip install slycot
Defaulting to user installation because normal site-packages is not writeable
Collecting slycot
  Using cached slycot-0.3.5.0.tar.gz (1.5 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... done
Collecting numpy
  Using cached numpy-1.18.4-cp38-cp38-manylinux1_x86_64.whl (20.7 MB)
Building wheels for collected packages: slycot
  Building wheel for slycot (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmprwu6q9xf
       cwd: /tmp/pip-install-djjch8io/slycot
  Complete output (84 lines):
  Not searching for unused variables given on the command line.
  CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
  -- Configuring incomplete, errors occurred!
  See also "/tmp/pip-install-djjch8io/slycot/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  Not searching for unused variables given on the command line.
  -- The C compiler identification is GNU 8.3.0
  -- Check for working C compiler: /usr/bin/cc
  -- Check for working C compiler: /usr/bin/cc - works
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- The Fortran compiler identification is unknown
  CMake Error at CMakeLists.txt:4 (ENABLE_LANGUAGE):
    No CMAKE_Fortran_COMPILER could be found.

    Tell CMake where to find the compiler by setting either the environment
    variable "FC" or the CMake cache entry CMAKE_Fortran_COMPILER to the full
    path to the compiler, or to the compiler name if it is in the PATH.


  -- Configuring incomplete, errors occurred!
  See also "/tmp/pip-install-djjch8io/slycot/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
  See also "/tmp/pip-install-djjch8io/slycot/_cmake_test_compile/build/CMakeFiles/CMakeError.log".


  --------------------------------------------------------------------------------
  -- Trying "Ninja" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Ninja" generator - failure
  --------------------------------------------------------------------------------



  --------------------------------------------------------------------------------
  -- Trying "Unix Makefiles" generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying "Unix Makefiles" generator - failure
  --------------------------------------------------------------------------------

  ********************************************************************************
  scikit-build could not get a working generator for your system. Aborting build.

  Building Linux wheels for Python 3.8 requires a compiler (e.g gcc).
  It can be installed using debian package manager:

    sudo apt-get install build-essential

  To build compliant wheels, consider using the manylinux system described in PEP-513.
  Get it with "dockcross/manylinux-x64" docker image:

    https://github.com/dockcross/dockcross#readme

  For more details, please refer to scikit-build documentation:

    http://scikit-build.readthedocs.io/en/latest/generators.html#linux

  ********************************************************************************
  ----------------------------------------
  ERROR: Failed building wheel for slycot
Failed to build slycot
ERROR: Could not build wheels for slycot which use PEP 517 and cannot be installed directly

But the thing is... running sudo apt-get install build-essential doesn't help at all. Installing build-essential and then re-running results in exactly the same error.

I don't have issues pip installing any other packages in the same container.

Issues installing slycot via pip

Hello,

Currently trying to install slycot in conjunction with control.

No issues installing the control library in both Python2 and Python3.

While running sudo pip[3] install slycot, I get the following output:

Collecting slycot
  Using cached https://files.pythonhosted.org/packages/ae/9d/7ed3f2abf08aab0be9ac2b67e3040c20d9c594cce6a4af2203da0c28a6c4/slycot-0.3.5.0.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /usr/local/lib/python3.5/dist-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpuby90lub
       cwd: /tmp/pip-install-4y2kxn4y/slycot
  Complete output (10 lines):
  Traceback (most recent call last):
    File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module>
      main()
    File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pep517/_in_process.py", line 197, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pep517/_in_process.py", line 48, in get_requires_for_build_wheel
      backend = _build_backend()
    File "/usr/local/lib/python3.5/dist-packages/pip/_vendor/pep517/_in_process.py", line 39, in _build_backend
      obj = getattr(obj, path_part)
  AttributeError: module 'setuptools.build_meta' has no attribute '__legacy__'
  ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/local/lib/python3.5/dist-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpuby90lub Check the logs for full command output.

I'd really like to know if this is a local issue and how to resolve it because I'm having issues using the main controls library because of errors related to needing slycot:

/usr/local/lib/python3.5/dist-packages/control/statefbk.py in lqr(*args, **keywords)
    313         from slycot import sb02mt
    314     except ImportError:
--> 315         raise ControlSlycot("can't find slycot module 'sb02md' or 'sb02nt'")
    316 
    317     #

ControlSlycot: can't find slycot module 'sb02md' or 'sb02nt'

Thanks!

How to use \Python37\Lib\site-packages\slycot\setup.py ?

Hello,

I installed Slycot from source. (https://www.lfd.uci.edu/~gohlke/pythonlibs/slycotโ€‘0.3.3โ€‘cp37โ€‘cp37mโ€‘win_amd64.whl)
The installation message was "succeeded".
But, I faced the execution error of one python program.
The error message was "can't find slycot module 'sb02md'".

my OS: windows 7
Python: 3.7
Anaconda is not used.

Could someone tell me how to solve it?
I found this page and installed gortran (mingw32). But, I'm not sure how to use BLAS/LAPACK libraries.

I changed the directory where "setup.py" is located, and put the command "python setup.py config_fc --arch="-march=x86-64" build".
Then error message is "This is the wrong setup.py file to run".

Please give me a favor.

Replace ValueError with info attribute with SlycotError

See #84 (comment)

A common pattern in the Slycot code is

        e = ValueError('the number of eigenvalues to be assigned is less than the number of possibly assignable eigenvalues')
        e.info = info
        raise e

The idea is to have a SlycotError class, so that this can be:

    raise SlycotError(msg, info)

instead - that way one can't forget the .info attribute.

I'd have had SlycotError inherit from RuntimeError, but for backward compatibility it should probably be ValueError.

pipenv install fails on macOS 10.15.2

Installing in a fresh virtualenv works, but installing via pipenv does not.

โฏ pipenv install slycot
Installing slycotโ€ฆ
Adding slycot to Pipfile's [packages]โ€ฆ
โœ” Installation Succeeded 
Pipfile.lock (757878) out of date, updating to (1254dc)โ€ฆ
Locking [dev-packages] dependenciesโ€ฆ
โœ” Success! 
Locking [packages] dependenciesโ€ฆ
โœ˜ Locking Failed! 
Traceback (most recent call last):
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 126, in <module>
    main()
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 119, in main
    parsed.requirements_dir, parsed.packages)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 85, in _main
    requirements_dir=requirements_dir,
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 69, in resolve
    req_dir=requirements_dir
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 726, in resolve_deps
    req_dir=req_dir,
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
    resolved_tree = resolver.resolve()
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 385, in resolve
    results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 206, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 301, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 234, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 426, in get_legacy_dependencies
    results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 297, in resolve_reqs
    results = resolver._resolve_one(reqset, ireq)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 260, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 213, in _get_abstract_dist_for
    self.require_hashes
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 294, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 127, in prep_for_dist
    self.req.run_egg_info()
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/req/req_install.py", line 474, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/utils/misc.py", line 705, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /var/folders/dk/6wr_v2z91hdfz1y2q405wf740000gn/T/tmpz__eak19build/slycot/
File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 126, in <module>
    main()
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 119, in main
    parsed.requirements_dir, parsed.packages)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 85, in _main
    requirements_dir=requirements_dir,
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/resolver.py", line 69, in resolve
    req_dir=requirements_dir
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 726, in resolve_deps
    req_dir=req_dir,
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
    resolved_tree = resolver.resolve()
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/utils.py", line 385, in resolve
    results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 206, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/resolver.py", line 301, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 234, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 426, in get_legacy_dependencies
    results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 297, in resolve_reqs
    results = resolver._resolve_one(reqset, ireq)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 260, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 213, in _get_abstract_dist_for
    self.require_hashes
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 294, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 127, in prep_for_dist
    self.req.run_egg_info()
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/req/req_install.py", line 474, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/usr/local/Cellar/pipenv/2018.11.26_3/libexec/lib/python3.8/site-packages/pipenv/patched/notpip/_internal/utils/misc.py", line 705, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /var/folders/dk/6wr_v2z91hdfz1y2q405wf740000gn/T/tmpz__eak19build/slycot/

Somehow opening up ipython and importing slycot still works even after it fails though...

In [1]: import slycot                                                                                                                                            

In [2]: slycot.__version__                                                                                                                                       
Out[2]: '0.3.5'

Bug in TD04AD when ROWCOL='C'

The attached Fortran, when compiled under Ubuntu 14.04, demonstrates the problem. Unpack the zip file, run make, and you should see

./tfm2ss
 INFO (should be 0):
 0
 NR (should be 0):
 0
 D (should be 64):
  64.
Parameter 5 to routine TB01XD๏ฟฝ was incorrect

For M=P=1, the 'R' and 'C' cases are essentially the same thing, but the 'R' case works, while the 'C' case bombs out.

I think the bug is here in TD04AD.f. According to the docs for the just-called TB01PD, the returned IWORK is valid for the first N non-zero entries, but this code seems to ignore that. When the transformed system is static, N is likely to be 0, and at least in the cases I tested IWORK(1) = IWORK(2) = 1, so TB01XD gets invalid arguments.

I don't know how important this is; for the purposes of python-control, if we ever did want to use column-factored denominators, we could work with the transpose of G(s), transform that to a statespace system using the now row-factored denominators, and then transpose the result. TD04AD promises an upper block Hessenberg A matrix, so they need extra transformations for the column-factored case.

I suppose this all seems a bit arcane. I found this while working on #5, and I thought I might as well report it.

tfm2ss.zip

Drop Python 2.6

setup.py has:

if sys.version_info[:2] < (2, 6) or (3, 0) <= sys.version_info[0:2] < (3, 2):
    raise RuntimeError("Python version 2.6, 2.7 or >= 3.2 required.")

Seems like we should drop 2.6 and any references to it.

On Windows, python 2.7 conflicts with flang?

I'm trying to setup CI builds on Appveyor, see here. The Python 3 (3.5, 3.6, and 3.7) builds seem to be fine.

It looks like Python 2.7 and conda-forge's flang aren't compatible. Is that right?

I don't know if that's a problem, but perhaps we should note it somewhere.

The error is:

conda.exceptions.UnsatisfiableError: The following specifications were found to be in conflict:
  - flang
  - python=2.7

Archlinux: Slycot compiled against MKL crashes

When running the test suite, test_ab01.py fails for me with the following error:

================================================== test session starts ===================================================
platform linux -- Python 3.8.5, pytest-6.1.0, py-1.9.0, pluggy-0.13.1
rootdir: /home/acxz/.cache/yay/python-slycot/src
collected 108 items                                                                                                      

slycot-0.4.0.0/_skbuild/linux-x86_64-3.8/setuptools/lib/slycot/tests/test_ab01.py ==> ERROR: A failure occurred in check()

Specifically:

INTEL MKL ERROR: /opt/intel/mkl/lib/intel64/libmkl_avx2.so: undefined symbol: mkl_sparse_optimize_bsr_trsm_i8.
Intel MKL FATAL ERROR: Cannot load libmkl_avx2.so or libmkl_def.so.

If I compile and run the test_suite without intel-mkl on my system the test_suite runs successfully.

System:
Version: 0.4.0
OS: ArchLinux
Intel-MKL: 2020.2.254
Python: 3.8.5

Let me know if I can give more information.

`conda install` cannot install from local

Dear all,

May I have your opinion on installing Slycot using conda after conda build?

Q1: are these two lines equivalent ?

conda install --override-channels -c local slycot
conda install --use-local slycot

Q2 : if Q1 is yes, and the first line above is not working for python=2.7, is a new Pull Request desirable?

If you are interested in how I became to have these questions :

I tried to fork from this repository (7f5dc1c) (again) and triggered Travis-CI. However, the conda install seems unable to install from the local build; you would be able to check my test result here โ†’ https://travis-ci.org/autodrive/Slycot/jobs/456615608.

So when I manually followed the commands in .travis.yml for python=2.7 && TEST_CONDA==1.

      conda config --append channels conda-forge;
      conda build --python "$TRAVIS_PYTHON_VERSION" conda-recipe;
      conda install -c conda-forge lapack;
      conda install --override-channels -c local slycot;

The result of the last line was as follows

Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - slycot
  - libgfortran-ng[version='>=7,<8.0a0']
  - slycot
  - numpy

Current channels:

  - file:///home/jonwood/miniconda/conda-bld/linux-64
  - file:///home/jonwood/miniconda/conda-bld/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

Then I retried the following command: (Q1: is this equivalent to the original intention of 05f3ba1 ?)

conda install --use-local slycot

This time the conda seemingly could install as follows:

Solving environment: done

## Package Plan ##

  environment location: /home/jonwood/miniconda

  added / updated specs: 
    - slycot


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    cryptography-2.4.1         |   py27h1ba5d50_0         606 KB
    xz-5.2.4                   |       h14c3975_4         366 KB
    libxml2-2.9.8              |       h26e45fe_1         2.0 MB
    icu-58.2                   |       h9c2bf20_1        22.5 MB
    lz4-c-1.8.1.2              |       h14c3975_0         158 KB
    lzo-2.10                   |       h49e0be7_2         313 KB
    zstd-1.3.7                 |       h0b5b093_0         887 KB
    libarchive-3.3.3           |       h5d8350f_4         1.5 MB
    ------------------------------------------------------------
                                           Total:        28.3 MB

The following NEW packages will be INSTALLED:

    blas:            1.0-mkl                            
    icu:             58.2-h9c2bf20_1                    
    intel-openmp:    2019.0-118                         
    libedit:         3.1.20170329-h6b74fdf_2            
    libgfortran-ng:  7.3.0-hdf63c60_0                   
    libxml2:         2.9.8-h26e45fe_1                   
    lz4-c:           1.8.1.2-h14c3975_0                 
    lzo:             2.10-h49e0be7_2                    
    mkl:             2019.0-118                         
    mkl_fft:         1.0.6-py27h7dd41cf_0               
    mkl_random:      1.0.1-py27h4414c95_1               
    ncurses:         6.1-hf484d3e_0                     
    numpy:           1.15.4-py27h1d66e8a_0              
    numpy-base:      1.15.4-py27h81de0dd_0              
    slycot:          0.3.3-ha62df28_0        local      
    xz:              5.2.4-h14c3975_4                   
    zstd:            1.3.7-h0b5b093_0                   

The following packages will be UPDATED:

    cryptography:    1.8.1-py27_0                        --> 2.4.1-py27h1ba5d50_0
    libarchive:      3.3.2-ha7923ee_0                    --> 3.3.3-h5d8350f_4    
    openssl:         1.0.2p-h470a237_1       conda-forge --> 1.1.1-h7b6447c_0    
    python:          2.7.13-0                            --> 2.7.15-h9bab390_4   
    readline:        6.2-2                               --> 7.0-h7b6447c_5      
    sqlite:          3.13.0-0                            --> 3.25.3-h7b6447c_0   
    tk:              8.5.18-0                            --> 8.6.8-hbc83047_0    
    zlib:            1.2.8-0                             --> 1.2.11-ha838bed_2   

The following packages will be DOWNGRADED:

    ca-certificates: 2018.10.15-ha4d7672_0   conda-forge --> 2018.03.07-0        


Downloading and Extracting Packages
cryptography-2.4.1   | 606 KB    | ##################################### | 100% 
xz-5.2.4             | 366 KB    | ##################################### | 100% 
libxml2-2.9.8        | 2.0 MB    | ##################################### | 100% 
icu-58.2             | 22.5 MB   | ##################################### | 100% 
lz4-c-1.8.1.2        | 158 KB    | ##################################### | 100% 
lzo-2.10             | 313 KB    | ##################################### | 100% 
zstd-1.3.7           | 887 KB    | ##################################### | 100% 
libarchive-3.3.3     | 1.5 MB    | ##################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done

To me this seems a little odd because the conda install lines work fine for python 3.5 and 3.6.

So Q2 : Do you think it would be worth while to prepare a Pull Request?

Good day,

KW

can't conda build with Python 3.5 on MS Windows

See https://ci.appveyor.com/project/roryyorke/slycot/build/job/yx6j8yqj0exw1fb2 ; I can reproduce this on my Windows 10 machine.

It looks like numpy>=1.16 and Python=3.5 can't be satisfied from conda-forge.

I tried changing the numpy>=1.16 in conda-recipe-openblas/meta.yaml to >=1.15, 1.14, and 1.13, but got a build error at a later stage; cmake config seems to succeed, but the during build f2py can't be found.

Am I missing something, or is the combination of MS Windows + Python 3.5 not supported, at least with conda-build? It's probably fine if that is the case, but it might be worth adding this info to the 0.3.4 release notes.

On Linux we can build with python 2.7 and 3.5-3.7; see https://travis-ci.org/python-control/Slycot/builds/521333279

Why is the repository named Slycot instead of slycot

Is there a reason that we are using a capitalized repository name? On some operating systems (eg, MacOS) there can be problems with capitalization and my general preference is to keep everything lower case. I think I can just rename the repository in github, but not sure what kind of havoc that would cause?

Anyone have thoughts on this?

Travis OSX builds are failing

The error is ImportError: numpy.core.multiarray failed to import, which suggests to me it's our build setup that's wrong, not Slycot itself. This could be the Travis setup, the conda recipe, or perhaps CMakeLists.txt or setup.py.

This issue would best be handled by somebody with an OSX system.

Wrapper for functions related to periodic Schur decomposition

Dear Slycot support,

SLICOT is probably the only library with an implementation of the periodic Schur decomposition, which is very useful in the analysis of Linear Time-Periodic systems. The main function is MB03WD, which needs MB03VD and probably also MB03XP and MB03YD. Could you please add a wrapper for these subroutines?

Thank you very much ๐Ÿ˜Š

Best regards,
Riccardo Riva

Release 0.3.5

I'd like to release current master, or something close to it, as 0.3.5. Our current PyPI release, 0.3.4, is arguably broken: pip install slycot doesn't work on Linux systems (I suspect also not on OSX), but 0.3.5 should fix that.

@murrayrm, could you please test the build on OSX? Something like pip install git+https://github.com/python-control/Slycot in a clean virtual-env (no numpy, no scikit-build, up-to-date pip) should be sufficient.

AFAIK, conda builds are still OK. @repagh, @moorepants, please let me know if there is anything conda-related that must be done.

Noo module named slycot

Hi,
I recently tried to install slycot via pip. Before that I installed the following dependencies:

  • pip install cmake
  • pip install scikit-build
  • sudo apt-get install libopenblas-dev

Everything installs without any errors, but when I am trying to import slycot, I get the following error message:

ModuleNotFoundError: No module named 'slycot'

Am I missing something?

Docstring standards in Slycot

We have a bunch of different docstring styles used in the various definitions.

Some directly come from the __doc__ property of the wrapper functions generated by f2py, recognizable by the bounds qualifier.

Ar : output rank-2 array('d') with bounds (n,n)

Other functions use shape()

A_z : rank-2 array('d'), shape (n,n)

Sometimes we have blank space between the parameter definitions. Sometimes not.

What's your opinion on unifying this? Adhere to numpydoc and get closer to the documentation in numpy and scipy? Decide on a proper way to specify the shape?

The array('d') is also not consistent with numpydoc, I guess.

Would also affect the math formulas.

simplify version labeling and Git commit hash extraction

Following comments on 5d21c69, we should simplify the code in setup.py that generates the version string that labels an installation of Slycot. This is somewhat nontrivial because, for non-release commits, it is useful to include the commit hash in the version string.

Two proposals have been made thus far:

  1. use versioneer (5d21c69)
  2. use make_version.py from python-control (5d21c69#commitcomment-20885735)

Interestingly, this is a perennial issue in the development of Python packages that have change history tracked in Git. Slycot requires compilation of FORTRAN code, so NumPy should be a good first reference regarding labeling built binary packages.

Bug in slicot TB05AD

I recently submitted a pull request for a wrapper for TB05AD. The TB05AD routine is used to efficiently compute the frequency response of a state space system at many frequencies. The first time you call TB05AD.f, the routine will transform the system matrices such that the A matrix is in upper Hessenberg form. These transformed system matrices are returned and should then be used in subsequent calls to TB05AD.f.

One of the job options for TB05AD.f is BALEIG='N' or 'C' or 'B' or 'A'. My wrapper currently only uses options 'N' and 'A'.

When using option 'A', TB05AD.f will balance the A matrix before transforming A to upper Hessenberg form. For certain A matrices, this results in an incorrect frequency response calculation. For example:

import numpy as np
from scipy import linalg
from slycot import transform

A =  np.array([[-0.5,  0.,  0.,  0. ],
                          [ 0., -1.,  0. ,  0. ],
                          [ 1.,  0., -0.5,  0. ],
                          [ 0.,  1.,  0., -1. ]])
B = np.array([[ 1.],
                      [ 0.],
                      [ 0.],
                      [ 0.]])
C = np.array([[ 0.,  1.,  1.,  0.]])
freq = 10*1j
n, m = B.shape
p = C.shape[0]
result = transform.tb05ad(n, m, p, freq, A, B, C, job='AG')
g= result[3]
g_true = C.dot(np.linalg.solve(np.eye(n) * freq - A, B))
print g - g_true

I believe this is a bug in TB05AD.f circa line 354. When doing the balancing, TB05AD calls the lapack routine DGEBAL. From what I can tell, TB05AD misinterprets the permutation information provided by DGEBAL. This is similar to the scipy matrix_balance bug which I reported here. Before that bug was fixed, linalg.matrix_balance + linalg.hessenberg and TB05AD would yield the same transformed set of (Abar, Bbar, Cbar), but both would yield the wrong frequency response.

The documentation for DGEBAL says that rows/cols are permuted going from N to IGH+1, then from 1 to LO-1. I think TB05AD does the backwards. In some preliminary tests, replacing line 349 with
JJ = N + 1 - J seems to fix the issue, but this needs further testing.

Installation of slycot on Win64 failed

Attempting to install slycot following instructions given at: https://anaconda.org/repa/slycot AND https://github.com/python-control/slycot fails. Both approaches indicate 'PackagesNotFoundError':

``C:\WINDOWS\system32>conda install -c repa/label/test slycot
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  • slycot

Current channels:

To search for alternate channels that may provide the conda package you're
looking for, navigate to

https://anaconda.org

and use the search bar at the top of the page.``

Is there a workaround?

test_mc01td_D failure on Windows

See attached build log. The failure is

======================================================================
FAIL: test_mc01td_D (test_mc.test_mc)
test_mc01td_D: test discrete option
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\Users\rory\Documents\slycot\slycot\tests\test_mc.py", line 27, in test_mc01td_D
    self.assertEqual(stable, 1)
AssertionError: -1 != 1

----------------------------------------------------------------------

Build script:

set CONDA=%HOMEDRIVE%%HOMEPATH%\Miniconda3\condabin\conda.bat

echo %CONDA%

CALL %CONDA% --version
@if errorlevel 1 exit /b %ERRORLEVEL%

CALL %CONDA% activate base
@if errorlevel 1 exit /b %ERRORLEVEL%

CALL %CONDA% remove --yes --all --name build-slycot-py35
@if errorlevel 1 exit /b %ERRORLEVEL%

CALL %CONDA% create --quiet --yes --channel conda-forge --name build-slycot-py35 python=3.5 scikit-build flang numpy scipy
@if errorlevel 1 exit /b %ERRORLEVEL%

CALL %CONDA% activate build-slycot-py35
@if errorlevel 1 exit /b %ERRORLEVEL%

cd slycot
@if errorlevel 1 exit /b %ERRORLEVEL%

git describe --always --dirty
@if errorlevel 1 exit /b %ERRORLEVEL%

git status --ignored
@if errorlevel 1 exit /b %ERRORLEVEL%

@rem a hack; no f2py.exe
where f2py > %TMP%\F2PYPATH.txt
@if errorlevel 1 exit /b %ERRORLEVEL%
set /P F2PYPATH=< %TMP%\F2PYPATH.txt
@if errorlevel 1 exit /b %ERRORLEVEL%

python setup.py install -- -DF2PY_EXECUTABLE=%F2PYPATH%
@if errorlevel 1 exit /b %ERRORLEVEL%

cd slycot\tests
python -m unittest -v

build log: slycot-win-build.txt

PyPI package is missing runtest.py

I am trying to create a package for OpenSUSE but have some issues with the creation.
https://build.opensuse.org/package/show/home:bnavigator/python-slycot

https://en.opensuse.org/openSUSE:Packaging_Python
Their guidelines prescribe to pull the source from PyPI and strongly advise to run the checks.

However, the current PyPI package with version number 0.3.4.0 does not include the runtest.py
Please include it (and maybe bump an appropriately numbered version 0.3.5).

Install from PyPI fails - 0.3.4.0

In a clean python environment, slycot does not install, because of a missing dependency (skbuild).

ERROR: Complete output from command python setup.py egg_info:
    ERROR: Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-er4161h2/slycot/setup.py", line 8, in <module>
        from skbuild import setup
    ImportError: No module named 'skbuild'
    ----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-er4161h2/slycot/

Tried with python 2.7 and 3.5

This is not the case with previous version 0.3.3

Travis CI failing in multiple ways

Travis CI is consistently failing on slycot builds. Here is a summary of the Travis CI build failures from PR #13:

  • Travis CI succeeds testing slycot in python 2.7
  • Travis CI fails in testing slycot in python 3.3, due to inability of conda to resolve dependencies
    3.4, 3.5
  • Travis CI success in testing python-control in python 2.7, 3.5, 3.6 (test results)

The dependency issue in python 3.3 and 3.4 gives the following error:

conda build --python "$TRAVIS_PYTHON_VERSION" conda-recipe
Adding in variants from internal_defaults
INFO:conda_build.variants:Adding in variants from internal_defaults
Adding in variants from config.variant
INFO:conda_build.variants:Adding in variants from config.variant
Attempting to finalize metadata for slycot
INFO:conda_build.metadata:Attempting to finalize metadata for slycot
Solving environment: failed

failed to get install actions, retrying.  exception was: The following specifications were found to be in conflict:
  - numpy[version='>=1.13.3'] -> python[version='>=2.7,<2.8.0a0'] -> readline=7
  - numpy[version='>=1.13.3'] -> python[version='>=2.7,<2.8.0a0'] -> tk=8.6
  - python=3.3

A different error occurs in python 3.5. The various dependencies seem to work OK there, but there is an error when building the slycot library:

/usr/bin/gfortran -Wall -g -shared <long list of files> -llapack -lblas -lpython3.5m -lgfortran -o build/lib.linux-x86_64-3.5/slycot/_wrapper.cpython-35m-x86_64-linux-gnu.so
/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas
/usr/bin/ld: cannot find -lpython3.5m
collect2: error: ld returned 1 exit status

This must be some sort of error in the build environment.

The above build issues are not a problem in my local environment (MacOS 10.12.6), so likely something having to do with the Travis CI build environment (which is done under Ubuntu Trusty, I think).

Finally, there is yet a different error in PR #13, where the issue there appears to be in testMinrealBrute, which generates the following error:

FAIL: testMinrealBrute (control.tests.minreal_test.TestMinreal)
Traceback (most recent call last):
  File "/Users/murray/Dropbox/macosx/src/python-control/murrayrm/control/tests/minreal_test.py", line 62, in testMinrealBrute
    raise e
  File "/Users/murray/Dropbox/macosx/src/python-control/murrayrm/control/tests/minreal_test.py", line 57, in testMinrealBrute
    ht1.den[0][0], ht2.den[0][0])
  File "/Users/murray/Dropbox/macosx/src/python-control/murrayrm/control/tests/minreal_test.py", line 35, in assert_numden_almost_equal
    np.testing.assert_array_almost_equal(n1, n2)
  File "/Users/murray/anaconda/envs/test_slycot/lib/python3.6/site-packages/numpy/testing/utils.py", line 962, in assert_array_almost_equal
    precision=decimal)
  File "/Users/murray/anaconda/envs/test_slycot/lib/python3.6/site-packages/numpy/testing/utils.py", line 715, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal to 6 decimals

(shapes (3,), (4,) mismatch)
 x: array([ -1.33214 , -10.368378, -13.703545])
 y: array([ -1.33214 , -13.297947, -36.505109, -30.136079])

I'm going to try to get a working version of all of this up and going, so that we can get the integration tests working again. Will document progress here.

Problem when import slycot

I have installed slycot, but when I try to import slycot, it comes like that:
Traceback (most recent call last):
File "", line 1, in
File "/home/scylk/pycharm-community-2019.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/home/scylk/anaconda3/envs/rl/lib/python3.6/site-packages/slycot/init.py", line 16, in
from .analysis import ab01nd,ab05md,ab05nd,ab07nd,ab08nd,
File "/home/scylk/pycharm-community-2019.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "/home/scylk/anaconda3/envs/rl/lib/python3.6/site-packages/slycot/analysis.py", line 21, in
from . import _wrapper
File "/home/scylk/pycharm-community-2019.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ImportError: libmkl_gf_lp64.so: cannot open shared object file: No such file or directory

My python=3.6 on Ubuntu

Bug in MA02ID.f

gcc 10 spits out the following warning

[590/952] Building Fortran object slycot/CMakeFiles/_wrapper.dir/src/MA02ID.f.o
../../../slycot/src/MA02ID.f:188:21:

  184 |          DO 90 J = 1, N+1
      |                                                                        2
......
  188 |                DWORK(J-1) = DWORK(J-1) + TEMP
      |                     1
Warning: Array reference at (1) out of bounds (0 < 1) in loop beginning at (2)
../../../slycot/src/MA02ID.f:188:34:

  184 |          DO 90 J = 1, N+1
      |                                                                        2
......
  188 |                DWORK(J-1) = DWORK(J-1) + TEMP
      |                                  1
Warning: Array reference at (1) out of bounds (0 < 1) in loop beginning at (2)
../../../slycot/src/MA02ID.f:230:21:

  226 |          DO 160 J = 1, N+1
      |                                                                        2
......
  230 |                DWORK(J-1) = DWORK(J-1) + TEMP
      |                     1
Warning: Array reference at (1) out of bounds (0 < 1) in loop beginning at (2)
../../../slycot/src/MA02ID.f:230:34:

  226 |          DO 160 J = 1, N+1
      |                                                                        2
......
  230 |                DWORK(J-1) = DWORK(J-1) + TEMP
      |                                  1
Warning: Array reference at (1) out of bounds (0 < 1) in loop beginning at (2)

These specific pieces of code are not used (no wrapper, not internally in SLICOT), but it looks plain wrong. Reporting this to not forget.

express dependencies in setup.py

setup.py does not describe required packages to build and install slycot.

The motivated error occurs when numpy is not present. I found the following after pip install slycot:

Building wheels for collected packages: slycot
  Running setup.py bdist_wheel for slycot ... error
  Complete output from command /home/scott/tmp/f00f/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-SRAJ87/slycot/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpAzLVXPpip-wheel- --python-tag cp27:
  Running from numpy source directory.
  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-SRAJ87/slycot/setup.py", line 240, in <module>
      setup_package()
    File "/tmp/pip-build-SRAJ87/slycot/setup.py", line 225, in setup_package
      from numpy.distutils.core import setup
  ImportError: No module named numpy.distutils.core

free() error with python 2.7

Currently the packaging for OpenSUSE fails because somehow free() is called with an invalid pointer when the python 2.7 interpreter terminates.

[  370s] Running unit tests for slycot
[  370s] NumPy version 1.16.5
[  370s] NumPy relaxed strides checking option: True
[  370s] NumPy is installed in /usr/lib64/python2.7/site-packages/numpy
[  370s] Python version 2.7.16 (default, Mar 04 2019, 07:13:50) [GCC]
[  370s] nose version 1.3.7
[  370s] free(): invalid pointer
[  370s] /var/tmp/rpm-tmp.0U6LpC: line 39:  6542 Aborted                 python2 runtests.py --coverage --no-build
[  370s] error: Bad exit status from /var/tmp/rpm-tmp.0U6LpC (%check)
[  370s] 

Minimal example where this occurs is just

abuild@buildmachine:~> python2
Python 2.7.16 (default, Mar 04 2019, 07:13:50) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import slycot
>>> exit()
free(): invalid pointer
Aborted (core dumped)

Python3 is fine.

Push release 0.3.3 to conda-forge, PyPI

Now that release 0.3.3 is done, we need to push slycot-0.3.3 out to conda-forge and PyPI.

@moorepants Can you generate a new build on conda-forge?

  • Note that there is a PR on the conda-forge feedstock that needs to be merged first, I think
  • Is it possible to enable a Windows build as well?

@jgoppert Can you update PyPI?

Also, if someone can summarize the instructions for what needs to be done to generate these releases, then I will create a page on the wiki with this information to make it easier to do this in the future.

DLL load failed: The specified module could not be found.

Hi,
I have successfully installed the slycot package using a wheel file. I am try to import slycot in Python. I get the following error log. Could someone please help me understand the issue here? Thanks! :)

import slycot
Traceback (most recent call last):
File "", line 1, in
File "C:\Python27\lib\site-packages\slycot_init_.py", line 18, in
from .analysis import ab01nd,ab05md,ab05nd,ab07nd,ab08nd,
File "C:\Python27\lib\site-packages\slycot\analysis.py", line 21, in
from . import _wrapper
ImportError: DLL load failed: The specified module could not be found.

execute permission on python files in test?

In the CMakeLists.txt for the tests I see:

install(FILES ${PYSOURCE}
        PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
                    GROUP_READ GROUP_EXECUTE
                    WORLD_READ WORLD_EXECUTE
        DESTINATION slycot/tests)

Why are these files installed with execute permission? On Linux/OSX this is not needed, is it a Windows thing, or something specific to pytest?

Conda instructions for installing aren't working

Hi,

I'm trying to install slycot (before python-control) using:

conda install -c http://conda.binstar.org/cwrowley slycot

but am getting the following error:

Solving environment: failed

UnsatisfiableError: The following specifications were found to be in conflict:
  - requests
  - slycot
Use "conda info <package>" to see the dependencies for each package.

I'm using a fresh install of miniconda 3 (same issue with Ananconda) with SciPy on Ubuntu 17.04 (x64):

# packages in environment at /home/akum036/miniconda3:
#
# Name                    Version                   Build  Channel
asn1crypto                0.24.0                   py36_0  
ca-certificates           2017.08.26           h1d4fec5_0  
certifi                   2018.1.18                py36_0  
cffi                      1.11.4           py36h9745a5d_0  
chardet                   3.0.4            py36h0f667ec_1  
conda                     4.4.8                    py36_0  
conda-env                 2.6.0                h36134e3_1  
cryptography              2.1.4            py36hd09be54_0  
idna                      2.6              py36h82fb2a8_1  
intel-openmp              2018.0.0             hc7b2577_8  
libedit                   3.1                  heed3624_0  
libffi                    3.2.1                hd88cf55_4  
libgcc-ng                 7.2.0                h7cc24e2_2  
libgfortran-ng            7.2.0                h9f7466a_2  
libstdcxx-ng              7.2.0                h7a57d05_2  
mkl                       2018.0.1             h19d6760_4  
ncurses                   6.0                  h9df7e31_2  
numpy                     1.14.0           py36h3dfced4_1  
openssl                   1.0.2n               hb7f436b_0  
pip                       9.0.1            py36h6c6f9ce_4  
pycosat                   0.6.3            py36h0a5515d_0  
pycparser                 2.18             py36hf9f622e_1  
pyopenssl                 17.5.0           py36h20ba746_0  
pysocks                   1.6.7            py36hd97a5b1_1  
python                    3.6.4                hc3d631a_1  
readline                  7.0                  ha6073c6_4  
requests                  2.18.4           py36he2e5f8d_1  
ruamel_yaml               0.15.35          py36h14c3975_1  
scipy                     1.0.0            py36hbf646e7_0  
setuptools                38.4.0                   py36_0  
six                       1.11.0           py36h372c433_1  
sqlite                    3.21.0               h1bed415_2  
tk                        8.6.7                hc745277_3  
urllib3                   1.22             py36hbe7ace6_0  
wheel                     0.30.0           py36hfd4bba0_1  
xz                        5.2.3                h55aa19d_2  
yaml                      0.1.7                had09818_2  
zlib                      1.2.11               ha838bed_2  

Would you have any advice on how to proceed?

Regards,

Avi

Bringing out release 0.3.4

I have been looking a bit into getting a windows-also build in conda-forge. To do that cleanly, we need to bring out a new slycot release.

Would it be an option to simply tag v0.3.4, or do we need to merge/fix other issues first?

Confusion about which slycot repository is "official" / maintained

While dealing with a similar situation like in #15 I figured out that there are several slycot repos.

Maybe there are more relevant repos.

Are there rational reasons (other than historical ones) for that multitude of repos? At least for me that caused confusion.

SB10FD exits whole process on parameter error

In reference to #98 (comment):

[ben@voyagerS9:~]% python                                                                                                   [0]
Python 3.8.2 (default, Apr  8 2020, 14:31:25) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from slycot import synthesis
>>> from numpy import array
>>> A = array([[-1, 0, 0], [0, -12, -5], [0, 4, 0]])
>>> B = array([[2, 0], [0, 0.5], [0, 0]])
>>> C = array([[-0.5, 0, -0.5], [0, 0, 0], [-0.5, 0, -0.5]])
>>> D = array([[0, 0],  [0, 1], [0, 0]], dtype=float)
>>> synthesis.sb10fd(3, 2, 3, 1, 1, 100, A, B, C, D, 1e-7, None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ben/src/Slycot/_skbuild/linux-x86_64-3.8/cmake-install/slycot/synthesis.py", line 2717, in sb10fd
    raise_if_slycot_error(out[-1], arg_list, sb10fd.__doc__)
  File "/home/ben/src/Slycot/_skbuild/linux-x86_64-3.8/cmake-install/slycot/exceptions.py", line 236, in raise_if_slycot_error
    raise globals()[exception](fmessage, info)
slycot.exceptions.SlycotArithmeticError: 
The Y-Riccati equation was not solved
successfully (the controller is not admissible or
there are numerical difficulties)
>>> synthesis.sb10fd(1,1,1,0,1,1,[1],[1],[1],[1],1e-3,1)
 ** On entry to SB10FD parameter number 20 had an illegal value
[ben@voyagerS9:~]%                                                                                                          [0]

The last drop out of the whole Python process should not happen. A simple Exception should be enough. Probably have to patch the Fortran code?

Unit tests failing after merging PR #34

Despite passing tests at the time PR #34 was submitted, after merging it is generating an error for Python 3.5 and 3.6 (OK for 2.7):
https://travis-ci.org/python-control/Slycot/builds/409595937

FAIL: testEvalFr (control.tests.statesp_test.TestStateSpace)
Evaluate the frequency response at one frequency.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/python-control/Slycot/control/control/tests/statesp_test.py", line 153, in testEvalFr
    assert len(w) == 1
AssertionError

Problem with Slycot installation on Ubuntu

Hey,

I am trying to install the Slycot package on the Ubuntu system for Python 2.7.xxx
This is the list of packages I have installed:

adium-theme-ubuntu (0.3.4)
backports-abc (0.5)
backports.functools-lru-cache (1.4)
backports.shutil-get-terminal-size (1.0.0)
beautifulsoup4 (4.5.3)
bleach (2.1.2)
certifi (2017.11.5)
chardet (3.0.4)
configparser (3.5.0)
control (0.7.0)
cryptography (1.7.1)
cycler (0.10.0)
decorator (4.1.2)
entrypoints (0.2.3)
enum34 (1.1.6)
functools32 (3.2.3.post2)
html5lib (1.0.1)
idna (2.6)
ipaddress (1.0.17)
ipykernel (4.7.0)
ipython (5.5.0)
ipython-genutils (0.2.0)
ipywidgets (7.0.5)
Jinja2 (2.10)
jsonschema (2.6.0)
jupyter (1.0.0)
jupyter-client (5.2.0)
jupyter-console (5.2.0)
jupyter-core (4.4.0)
keyring (10.3.1)
keyrings.alt (2.2)
lxml (3.7.3)
MarkupSafe (1.0)
matplotlib (2.1.1)
mistune (0.8.3)
mpmath (1.0.0)
nbconvert (5.3.1)
nbformat (4.4.0)
nltk (3.2.5)
notebook (5.2.2)
numpy (1.13.3)
pandas (0.21.1)
pandocfilters (1.4.2)
pathlib2 (2.3.0)
pexpect (4.3.1)
pickleshare (0.7.4)
Pillow (4.0.0)
pip (9.0.1)
plotly (2.2.3)
prompt-toolkit (1.0.15)
ptyprocess (0.5.2)
pyasn1 (0.1.9)
pycrypto (2.6.1)
Pygments (2.2.0)
pygobject (3.22.0)
pyparsing (2.2.0)
pysam (0.13)
python-dateutil (2.6.1)
pytz (2017.3)
pyxdg (0.25)
pyzmq (16.0.3)
qtconsole (4.3.1)
regex (2017.12.12)
requests (2.18.4)
scandir (1.6)
scipy (1.0.0)
seaborn (0.8.1)
SecretStorage (2.3.1)
setuptools (38.2.4)
simplegeneric (0.8.1)
singledispatch (3.4.0.3)
six (1.11.0)
subprocess32 (3.2.7)
sympy (1.1.1)
terminado (0.8.1)
testpath (0.3.1)
tornado (4.5.2)
traitlets (4.3.2)
unity-lens-photos (1.0)
urllib3 (1.22)
wcwidth (0.1.7)
webencodings (0.5.1)
wheel (0.29.0)
widgetsnbextension (3.0.8)

Despite my attempts I still have the same error:
s1
s2

How to solve the above errors?

Best,
Rariusz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.