@@ -855,6 +855,17 @@ def test_pole(self, states, outputs, inputs):
855
855
for z in p :
856
856
assert z .real < 0
857
857
858
+ @pytest .mark .parametrize ('strictly_proper' , [True , False ])
859
+ def test_strictly_proper (self , strictly_proper ):
860
+ """Test that the strictly_proper argument returns a correct D."""
861
+ for i in range (100 ):
862
+ # The probability that drss(..., strictly_proper=False) returns an
863
+ # all zero D 100 times in a row is 0.5**100 = 7.89e-31
864
+ sys = rss (1 , 1 , 1 , strictly_proper = strictly_proper )
865
+ if np .all (sys .D == 0. ) == strictly_proper :
866
+ break
867
+ assert np .all (sys .D == 0. ) == strictly_proper
868
+
858
869
859
870
class TestDrss :
860
871
"""These are tests for the proper functionality of statesp.drss."""
@@ -884,6 +895,17 @@ def test_pole(self, states, outputs, inputs):
884
895
for z in p :
885
896
assert abs (z ) < 1
886
897
898
+ @pytest .mark .parametrize ('strictly_proper' , [True , False ])
899
+ def test_strictly_proper (self , strictly_proper ):
900
+ """Test that the strictly_proper argument returns a correct D."""
901
+ for i in range (100 ):
902
+ # The probability that drss(..., strictly_proper=False) returns an
903
+ # all zero D 100 times in a row is 0.5**100 = 7.89e-31
904
+ sys = drss (1 , 1 , 1 , strictly_proper = strictly_proper )
905
+ if np .all (sys .D == 0. ) == strictly_proper :
906
+ break
907
+ assert np .all (sys .D == 0. ) == strictly_proper
908
+
887
909
888
910
class TestLTIConverter :
889
911
"""Test returnScipySignalLTI method"""
0 commit comments