Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb44d5ba

Browse files
committed
address final (?)@slivingston comments
1 parent996211c commitb44d5ba

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

‎control/tests/config_test.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,30 @@ def test_system_indexing(self):
320320
sys2=sys[1:,1:]
321321
assertsys2.name=='PRE'+sys.name+'POST'
322322

323-
deftest_repr_format(self):
323+
@pytest.mark.parametrize("kwargs", [
324+
{},
325+
{'name':'mysys'},
326+
{'inputs':1},
327+
{'inputs':'u'},
328+
{'outputs':1},
329+
{'outputs':'y'},
330+
{'states':1},
331+
{'states':'x'},
332+
{'inputs':1,'outputs':'y','states':'x'},
333+
{'dt':0.1}
334+
])
335+
deftest_repr_format(self,kwargs):
324336
from ..statespimportStateSpace
325337
fromnumpyimportarray
326338

327-
sys=ct.ss([[1]], [[1]], [[1]], [[0]])
339+
sys=ct.ss([[1]], [[1]], [[1]], [[0]],**kwargs)
328340
new=eval(repr(sys))
329341
forattrin ['A','B','C','D']:
330-
assertgetattr(sys,attr)==getattr(sys,attr)
342+
assertgetattr(new,attr)==getattr(sys,attr)
343+
forpropin ['input_labels','output_labels','state_labels']:
344+
assertgetattr(new,attr)==getattr(sys,attr)
345+
if'name'inkwargs:
346+
assertnew.name==sys.name
331347

332348

333349
deftest_config_context_manager():

‎control/tests/iosys_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2351,7 +2351,7 @@ def test_iosys_repr(fcn, spec, expected, missing, format):
23512351
sys.repr_format=format
23522352
out=repr(sys)
23532353
ifformat=='eval':
2354-
assertre.search(expected,out)!=None
2354+
assertre.search(expected,out)isnotNone
23552355

23562356
ifmissingisnotNone:
23572357
assertre.search(missing,out)isNone

‎examples/repr_gallery.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"source": [
88
"# System Representation Gallery\n",
99
"\n",
10-
"This Jupyter notebook creates different types of systems and generates a variety of representations (`__repr__`, `__str__`) for those systems that can be used to compare different versions of python-control. It is mainly intended for uses by developers to make sure there are no unexpected changes in representation formats, but also has someinterest examples of different choices in system representation."
10+
"This Jupyter notebook creates different types of systems and generates a variety of representations (`__repr__`, `__str__`) for those systems that can be used to compare different versions of python-control. It is mainly intended for uses by developers to make sure there are no unexpected changes in representation formats, but also has someinteresting examples of different choices in system representation."
1111
]
1212
},
1313
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp