Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add @slycotonly decorator as needed
  • Loading branch information
roryyorke authored and murrayrm committed Jan 15, 2021
commit 7122b0760cc7820bdb5efa8257b48779b895bed7
13 changes: 9 additions & 4 deletions control/tests/canonical_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import pytest
import scipy.linalg

from control.tests.conftest import slycotonly

from control import ss, tf, tf2ss
from control.canonical import canonical_form, reachable_form, \
observable_form, modal_form, similarity_transform, bdschur
Expand Down Expand Up @@ -242,6 +244,7 @@ def block_diag_from_eig(eigvals):
return scipy.linalg.block_diag(*blocks)


@slycotonly
@pytest.mark.parametrize(
"eigvals, condmax, blksizes",
[
Expand All @@ -266,6 +269,7 @@ def test_bdschur_ref(eigvals, condmax, blksizes):
np.testing.assert_array_almost_equal(solve(t, a).dot(t), b)


@slycotonly
@pytest.mark.parametrize(
"eigvals, sorted_blk_eigvals, sort",
[
Expand Down Expand Up @@ -294,6 +298,7 @@ def test_bdschur_sort(eigvals, sorted_blk_eigvals, sort):
blk_eigval.imag)


@slycotonly
def test_bdschur_defective():
# the eigenvalues of this simple defective matrix cannot be separated
# a previous version of the bdschur would fail on this
Expand All @@ -316,16 +321,14 @@ def test_bdschur_condmax_lt_1():
bdschur(1, condmax=np.nextafter(1, 0))


@slycotonly
def test_bdschur_invalid_sort():
# sort must be in ('continuous', 'discrete')
with pytest.raises(ValueError):
bdschur(1, sort='no-such-sort')


# temp
from control import ss, tf, ControlNotImplemented


@slycotonly
@pytest.mark.parametrize(
"A_true, B_true, C_true, D_true",
[(np.diag([4.0, 3.0, 2.0, 1.0]), # order from largest to smallest
Expand Down Expand Up @@ -386,6 +389,7 @@ def test_modal_form(A_true, B_true, C_true, D_true):
np.dot(np.dot(C, np.linalg.matrix_power(A, i)), B))


@slycotonly
@pytest.mark.parametrize(
"condmax, len_blksizes",
[(1.1, 1),
Expand All @@ -404,6 +408,7 @@ def test_modal_form_condmax(condmax, len_blksizes):
np.testing.assert_array_almost_equal(zsys.D, xsys.D)


@slycotonly
@pytest.mark.parametrize(
"sys_type",
['continuous',
Expand Down