Skip to content

Commit e080cef

Browse files
committed
2 parents a7f1de0 + 9c6c619 commit e080cef

43 files changed

Lines changed: 2576 additions & 383 deletions

Some content is hidden

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

.github/workflows/control-slycot-src.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
sudo apt install -y xvfb
2020
2121
# Install test tools
22-
conda install pip pytest
22+
conda install pip pytest pytest-timeout
2323
2424
# Install python-control dependencies
2525
conda install numpy matplotlib scipy
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

.github/workflows/python-package-conda.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
sudo apt install -y xvfb
3333
3434
# Install test tools
35-
conda install pip coverage pytest
35+
conda install pip coverage pytest pytest-timeout
3636
pip install coveralls
3737
3838
# Install python-control dependencies

control/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
# Note: the functions we use are specified as __all__ variables in the modules
4949
from .bdalg import *
5050
from .delay import *
51+
from .descfcn import *
5152
from .dtime import *
5253
from .freqplot import *
5354
from .lti import *

control/bdalg.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def negate(sys):
174174
>>> sys2 = negate(sys1) # Same as sys2 = -sys1.
175175
176176
"""
177-
return -sys;
177+
return -sys
178178

179179
#! TODO: expand to allow sys2 default to work in MIMO case?
180180
def feedback(sys1, sys2=1, sign=-1):
@@ -280,7 +280,7 @@ def append(*sys):
280280
>>> sys = append(sys1, sys2)
281281
282282
"""
283-
s1 = sys[0]
283+
s1 = ss._convert_to_statespace(sys[0])
284284
for s in sys[1:]:
285285
s1 = s1.append(s)
286286
return s1
@@ -334,7 +334,8 @@ def connect(sys, Q, inputv, outputv):
334334
interconnecting multiple systems.
335335
336336
"""
337-
inputv, outputv, Q = np.asarray(inputv), np.asarray(outputv), np.asarray(Q)
337+
inputv, outputv, Q = \
338+
np.atleast_1d(inputv), np.atleast_1d(outputv), np.atleast_1d(Q)
338339
# check indices
339340
index_errors = (inputv - 1 > sys.ninputs) | (inputv < 1)
340341
if np.any(index_errors):

control/config.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ def reset_defaults():
4343
# System level defaults
4444
defaults.update(_control_defaults)
4545

46-
from .freqplot import _bode_defaults, _freqplot_defaults
46+
from .freqplot import _bode_defaults, _freqplot_defaults, _nyquist_defaults
4747
defaults.update(_bode_defaults)
4848
defaults.update(_freqplot_defaults)
49+
defaults.update(_nyquist_defaults)
4950

5051
from .nichols import _nichols_defaults
5152
defaults.update(_nichols_defaults)
@@ -138,9 +139,11 @@ def use_fbs_defaults():
138139
The following conventions are used:
139140
* Bode plots plot gain in powers of ten, phase in degrees,
140141
frequency in rad/sec, no grid
142+
* Nyquist plots use dashed lines for mirror image of Nyquist curve
141143
142144
"""
143145
set_defaults('bode', dB=False, deg=True, Hz=False, grid=False)
146+
set_defaults('nyquist', mirror_style='--')
144147

145148

146149
# Decide whether to use numpy.matrix for state space operations
@@ -239,4 +242,7 @@ def use_legacy_defaults(version):
239242
# time responses are only squeezed if SISO
240243
set_defaults('control', squeeze_time_response=True)
241244

245+
# switched mirror_style of nyquist from '-' to '--'
246+
set_defaults('nyqist', mirror_style='-')
247+
242248
return (major, minor, patch)

0 commit comments

Comments
 (0)