Skip to content

Commit 78ec3ee

Browse files
authored
Merge branch 'python-control:master' into master
2 parents e298c21 + df6b352 commit 78ec3ee

138 files changed

Lines changed: 28558 additions & 11692 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coveragerc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[run]
22
source = control
33
omit = control/tests/*
4+
relative_files = True
45

56
[report]
67
exclude_lines =
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Slycot from source
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build-linux:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Set up Python
12+
uses: actions/setup-python@v2
13+
- name: Install Python dependencies
14+
run: |
15+
# Set up conda
16+
echo $CONDA/bin >> $GITHUB_PATH
17+
18+
# Set up (virtual) X11
19+
sudo apt install -y xvfb
20+
21+
# Install test tools
22+
conda install pip pytest pytest-timeout
23+
24+
# Install python-control dependencies
25+
conda install numpy matplotlib scipy
26+
27+
- name: Install slycot from source
28+
run: |
29+
# Install compilers, libraries, and development environment
30+
sudo apt-get -y install gfortran cmake --fix-missing
31+
sudo apt-get -y install libblas-dev liblapack-dev
32+
conda install -c conda-forge scikit-build;
33+
34+
# Compile and install slycot
35+
git clone https://github.com/python-control/Slycot.git slycot
36+
cd slycot
37+
git submodule update --init
38+
python setup.py build_ext install -DBLA_VENDOR=Generic
39+
40+
- name: Test with pytest
41+
run: xvfb-run --auto-servernum pytest control/tests
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: setup.py, examples
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build-linux:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Set up Python
12+
uses: actions/setup-python@v2
13+
- name: Install Python dependencies
14+
run: |
15+
# Set up conda
16+
echo $CONDA/bin >> $GITHUB_PATH
17+
18+
# Set up (virtual) X11
19+
sudo apt install -y xvfb
20+
21+
# Install test tools
22+
conda install pip pytest
23+
24+
# Install python-control dependencies
25+
conda install numpy matplotlib scipy jupyter
26+
conda install -c conda-forge slycot pmw
27+
28+
- name: Install with setup.py
29+
run: python setup.py install
30+
31+
- name: Run examples
32+
run: |
33+
cd examples
34+
./run_examples.sh
35+
./run_notebooks.sh
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Conda-based pytest
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test-linux:
7+
name: Python ${{ matrix.python-version }}${{ matrix.slycot && format(' with Slycot from {0}', matrix.slycot) || ' without Slycot' }}${{ matrix.array-and-matrix == 1 && ', array and matrix' || '' }}
8+
runs-on: ubuntu-latest
9+
10+
strategy:
11+
max-parallel: 5
12+
matrix:
13+
python-version: [3.7, 3.9]
14+
slycot: ["", "conda"]
15+
array-and-matrix: [0]
16+
include:
17+
- python-version: 3.9
18+
slycot: conda
19+
array-and-matrix: 1
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Install dependencies
25+
run: |
26+
# Set up conda
27+
echo $CONDA/bin >> $GITHUB_PATH
28+
conda create -q -n test-environment python=${{matrix.python-version}}
29+
source $CONDA/bin/activate test-environment
30+
31+
# Set up (virtual) X11
32+
sudo apt install -y xvfb
33+
34+
# Install test tools
35+
conda install pip coverage pytest pytest-timeout
36+
pip install coveralls
37+
38+
# Install python-control dependencies
39+
# use conda-forge until https://github.com/numpy/numpy/issues/20233 is resolved
40+
conda install -c conda-forge numpy matplotlib scipy
41+
if [[ '${{matrix.slycot}}' == 'conda' ]]; then
42+
conda install -c conda-forge slycot
43+
fi
44+
45+
- name: Test with pytest
46+
env:
47+
PYTHON_CONTROL_ARRAY_AND_MATRIX: ${{ matrix.array-and-matrix }}
48+
run: |
49+
source $CONDA/bin/activate test-environment
50+
# Use xvfb-run instead of pytest-xvfb to get proper mpl backend
51+
# Use coverage instead of pytest-cov to get .coverage file
52+
# See https://github.com/python-control/python-control/pull/504
53+
xvfb-run --auto-servernum coverage run -m pytest control/tests
54+
55+
- name: Coveralls parallel
56+
# https://github.com/coverallsapp/github-action
57+
uses: AndreMiras/coveralls-python-action@develop
58+
with:
59+
parallel: true
60+
61+
coveralls:
62+
name: coveralls completion
63+
needs: test-linux
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Coveralls Finished
67+
uses: AndreMiras/coveralls-python-action@develop
68+
with:
69+
parallel-finished: true

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ MANIFEST
77
control/_version.py
88
__conda_*.txt
99
record.txt
10-
build.log
10+
*.log
1111
*.egg-info/
1212
.eggs/
1313
.coverage
@@ -23,3 +23,9 @@ Untitled*.ipynb
2323
# Files created by or for emacs (RMM, 29 Dec 2017)
2424
*~
2525
TAGS
26+
27+
# Files created by or for asv (airspeed velocity)
28+
.asv/
29+
30+
# Files created by Spyder
31+
.spyproject/

.travis.yml

Lines changed: 0 additions & 134 deletions
This file was deleted.

README.rst

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
.. image:: https://travis-ci.org/python-control/python-control.svg?branch=master
2-
:target: https://travis-ci.org/python-control/python-control
3-
.. image:: https://coveralls.io/repos/python-control/python-control/badge.png
1+
.. image:: https://anaconda.org/conda-forge/control/badges/version.svg
2+
:target: https://anaconda.org/conda-forge/control
3+
4+
.. image:: https://img.shields.io/pypi/v/control.svg
5+
  :target: https://pypi.org/project/control/
6+
7+
.. image:: https://github.com/python-control/python-control/actions/workflows/python-package-conda.yml/badge.svg
8+
:target: https://github.com/python-control/python-control/actions/workflows/python-package-conda.yml
9+
10+
.. image:: https://github.com/python-control/python-control/actions/workflows/install_examples.yml/badge.svg
11+
:target: https://github.com/python-control/python-control/actions/workflows/install_examples.yml
12+
13+
.. image:: https://github.com/python-control/python-control/actions/workflows/control-slycot-src.yml/badge.svg
14+
:target: https://github.com/python-control/python-control/actions/workflows/control-slycot-src.yml
15+
16+
.. image:: https://coveralls.io/repos/python-control/python-control/badge.svg
417
:target: https://coveralls.io/r/python-control/python-control
518

619
Python Control Systems Library
@@ -38,8 +51,7 @@ The package requires numpy, scipy, and matplotlib. In addition, some routines
3851
use a module called slycot, that is a Python wrapper around some FORTRAN
3952
routines. Many parts of python-control will work without slycot, but some
4053
functionality is limited or absent, and installation of slycot is recommended
41-
(see below). Note that in order to install slycot, you will need a FORTRAN
42-
compiler on your machine. The Slycot wrapper can be found at:
54+
(see below). The Slycot wrapper can be found at:
4355

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

@@ -99,10 +111,16 @@ You can check out the latest version of the source code with the command::
99111
Testing
100112
-------
101113

102-
You can run a set of unit tests to make sure that everything is working
103-
correctly. After installation, run::
114+
You can run the unit tests with `pytest`_ to make sure that everything is
115+
working correctly. Inside the source directory, run::
104116

105-
python setup.py test
117+
pytest -v
118+
119+
or to test the installed package::
120+
121+
pytest --pyargs control -v
122+
123+
.. _pytest: https://docs.pytest.org/
106124

107125
License
108126
-------
@@ -125,3 +143,7 @@ Your contributions are welcome! Simply fork the GitHub repository and send a
125143

126144
.. _pull request: https://github.com/python-control/python-control/pulls
127145

146+
Please see the `Developer's Wiki`_ for detailed instructions.
147+
148+
.. _Developer's Wiki: https://github.com/python-control/python-control/wiki
149+

0 commit comments

Comments
 (0)