Skip to content

Commit 49b0077

Browse files
authored
Merge pull request python-control#826 from murrayrm/smallfixes-04Aug2022
Small fixes and tweaks
2 parents 313ca74 + 5757f2f commit 49b0077

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

.github/workflows/os-blas-test-matrix.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,9 @@ jobs:
251251
pip install slycot-wheels/${{ matrix.packagekey }}/slycot*.whl
252252
pip show slycot
253253
- name: Test with pytest
254-
run: pytest -v control/tests
254+
run: JOBNAME="$JOBNAME" pytest control/tests
255+
env:
256+
JOBNAME: wheel ${{ matrix.packagekey }} ${{ matrix.blas_lib }}
255257

256258

257259
test-conda:
@@ -318,6 +320,6 @@ jobs:
318320
mamba install -c ./slycot-conda-pkgs slycot
319321
conda list
320322
- name: Test with pytest
321-
run: JOBNAME=$JOBNAME pytest control/tests
323+
run: JOBNAME="$JOBNAME" pytest control/tests
322324
env:
323-
JOBNAME: ${{ matrix.packagekey }} ${{ matrix.blas_lib }}
325+
JOBNAME: conda ${{ matrix.packagekey }} ${{ matrix.blas_lib }}

control/descfcn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def _f(self, x):
7474

7575
def describing_function(
7676
F, A, num_points=100, zero_check=True, try_method=True):
77-
"""Numerical compute the describing function of a nonlinear function
77+
"""Numerically compute the describing function of a nonlinear function
7878
7979
The describing function of a nonlinearity is given by magnitude and phase
8080
of the first harmonic of the function when evaluated along a sinusoidal

control/tests/flatsys_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ def test_kinematic_car_ocp(
210210
pytest.xfail("precision loss in some configurations")
211211

212212
elif re.match("Iteration limit.*", traj_ocp.message) and \
213-
re.match("ubuntu-3.* Generic", os.getenv('JOBNAME')) and \
213+
re.match(
214+
"conda ubuntu-3.* Generic", os.getenv('JOBNAME', '')) and \
214215
np.__version__ == '1.24.0':
215216
pytest.xfail("gh820: iteration limit exceeded")
216217

control/tests/optimal_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ def final_point_eval(x, u):
626626
('collocation', 5, 'u0', 'endpoint'),
627627
('collocation', 5, 'input', 'openloop'),# open loop sim fails
628628
('collocation', 10, 'input', None),
629-
('collocation', 10, 'u0', None), # from documenentation
629+
('collocation', 10, 'u0', None), # from documentation
630630
('collocation', 10, 'state', None),
631631
('collocation', 20, 'state', None),
632632
])
@@ -716,9 +716,11 @@ def vehicle_output(t, x, u, params):
716716

717717
# Make sure we started and stopped at the right spot
718718
if fail == 'endpoint':
719+
assert not np.allclose(result.states[:, -1], xf, rtol=1e-4)
719720
pytest.xfail("optimization does not converge to endpoint")
720721
else:
721722
np.testing.assert_almost_equal(result.states[:, 0], x0, decimal=4)
723+
np.testing.assert_almost_equal(result.states[:, -1], xf, decimal=2)
722724

723725
# Simulate the trajectory to make sure it looks OK
724726
resp = ct.input_output_response(

control/timeresp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ def __len__(self):
642642
# Convert to pandas
643643
def to_pandas(self):
644644
if not pandas_check():
645-
ImportError('pandas not installed')
645+
raise ImportError("pandas not installed")
646646
import pandas
647647

648648
# Create a dict for setting up the data frame

0 commit comments

Comments
 (0)