GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fixes for bugs found by pylint by roryyorke · Pull Request #795 · python-control/python-control

Conversation

@roryyorke

@roryyorke roryyorke commented Nov 20, 2022

Copy link
Copy Markdown
Contributor

I found these with pylint.

See also rory/pylint for two pylint-specific commits if you want to run this yourself; I used pylint -E control to run pylint, with -E disabling all but the most serious of warnings.

On rory/pylint, pylint still reports all of these as errors; some are false positives (e.g., "invalid-unary-operand-type"), and others are stylistic (e.g., "self as first argument"), but I haven't investigated every single one.

We could consider incorporating pylint, but we'd obviously have to do more work configuring it.

pylint -E control
************* Module control.iosys
control/iosys.py:153:4: E0213: Method should have "self" as first argument (no-self-argument)
control/iosys.py:203:4: E0213: Method should have "self" as first argument (no-self-argument)
control/iosys.py:222:4: E0213: Method should have "self" as first argument (no-self-argument)
control/iosys.py:260:4: E0213: Method should have "self" as first argument (no-self-argument)
control/iosys.py:279:4: E0213: Method should have "self" as first argument (no-self-argument)
control/iosys.py:317:4: E0213: Method should have "self" as first argument (no-self-argument)
control/iosys.py:336:4: E0213: Method should have "self" as first argument (no-self-argument)
control/iosys.py:809:4: E0213: Method should have "self" as first argument (no-self-argument)
************* Module control.mateqn
control/mateqn.py:182:51: E1130: bad operand type for unary -: NoneType (invalid-unary-operand-type)
control/mateqn.py:185:31: E1130: bad operand type for unary -: NoneType (invalid-unary-operand-type)
************* Module control.sisotool
control/sisotool.py:305:22: E1130: bad operand type for unary -: NoneType (invalid-unary-operand-type)
control/sisotool.py:305:22: E1130: bad operand type for unary -: NoneType (invalid-unary-operand-type)
************* Module control.passivity
control/passivity.py:150:24: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/passivity.py:150:24: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/passivity.py:150:24: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/passivity.py:152:24: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/passivity.py:152:24: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/passivity.py:152:24: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/passivity.py:154:24: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/passivity.py:154:24: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/passivity.py:154:24: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
************* Module control.descfcn
control/descfcn.py:388:58: E1130: bad operand type for unary -: NoneType (invalid-unary-operand-type)
************* Module control.statefbk
control/statefbk.py:768:27: E1130: bad operand type for unary -: NoneType (invalid-unary-operand-type)
************* Module control.freqplot
control/freqplot.py:1043:27: E1130: bad operand type for unary -: MaskedArray (invalid-unary-operand-type)
control/freqplot.py:1046:20: E1130: bad operand type for unary -: MaskedArray (invalid-unary-operand-type)
************* Module control.lti
control/lti.py:119:16: E1101: Instance of 'LTI' has no 'poles' member; maybe 'pole'? (no-member)
control/lti.py:188:19: E1101: Instance of 'LTI' has no '__call__' member (no-member)
control/lti.py:198:19: E1102: self is not callable (not-callable)
control/lti.py:217:15: E1101: Instance of 'LTI' has no 'poles' member; maybe 'pole'? (no-member)
control/lti.py:222:15: E1101: Instance of 'LTI' has no 'zeros' member; maybe 'zero'? (no-member)
************* Module control.optimal
control/optimal.py:307:40: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/optimal.py:324:49: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/optimal.py:329:39: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/optimal.py:428:50: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/optimal.py:430:37: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/optimal.py:441:46: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/optimal.py:443:33: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/optimal.py:513:50: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/optimal.py:515:37: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/optimal.py:526:46: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/optimal.py:528:33: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
************* Module control.exception
control/exception.py:94:12: E0401: Unable to import 'cvxopt' (import-error)
************* Module control.tests.matlab_test
control/tests/matlab_test.py:366:15: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/matlab_test.py:367:15: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/matlab_test.py:368:15: E1101: Instance of 'tuple' has no 'shape' member (no-member)
************* Module control.tests.xferfcn_test
control/tests/xferfcn_test.py:448:39: E1101: Instance of 'TransferFunction' has no 'evalfr' member (no-member)
************* Module control.tests.iosys_test
control/tests/iosys_test.py:533:52: E1130: bad operand type for unary -: tuple (invalid-unary-operand-type)
control/tests/iosys_test.py:1796:35: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
************* Module control.tests.optimal_test
control/tests/optimal_test.py:174:8: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/tests/optimal_test.py:619:12: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/tests/optimal_test.py:620:12: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/tests/optimal_test.py:621:11: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
************* Module control.tests.matlab2_test
control/tests/matlab2_test.py:142:16: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/tests/matlab2_test.py:172:16: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/tests/matlab2_test.py:267:8: E1101: Instance of 'TestControlMatlab' has no 'assertRaises' member (no-member)
control/tests/matlab2_test.py:272:8: E1101: Instance of 'TestControlMatlab' has no 'assertRaises' member (no-member)
control/tests/matlab2_test.py:325:8: E1101: Instance of 'TestControlMatlab' has no 'assertRaises' member (no-member)
control/tests/matlab2_test.py:325:38: E1123: Unexpected keyword argument 'x0' in function call (unexpected-keyword-arg)
control/tests/matlab2_test.py:330:8: E1101: Instance of 'TestControlMatlab' has no 'assertRaises' member (no-member)
control/tests/matlab2_test.py:330:37: E1123: Unexpected keyword argument 'x0' in function call (unexpected-keyword-arg)
control/tests/matlab2_test.py:333:8: E1101: Instance of 'TestControlMatlab' has no 'assertRaises' member (no-member)
control/tests/matlab2_test.py:333:38: E1123: Unexpected keyword argument 'x0' in function call (unexpected-keyword-arg)
control/tests/matlab2_test.py:335:8: E1101: Instance of 'TestControlMatlab' has no 'assertRaises' member (no-member)
control/tests/matlab2_test.py:335:38: E1123: Unexpected keyword argument 'x0' in function call (unexpected-keyword-arg)
************* Module control.tests.robust_test
control/tests/robust_test.py:86:31: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/tests/robust_test.py:88:31: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/tests/robust_test.py:105:31: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/tests/robust_test.py:122:31: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/tests/robust_test.py:143:31: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/tests/robust_test.py:149:31: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/tests/robust_test.py:173:31: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/tests/robust_test.py:174:31: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/tests/robust_test.py:175:31: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/tests/robust_test.py:176:31: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/tests/robust_test.py:288:31: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/tests/robust_test.py:289:31: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/tests/robust_test.py:290:31: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
control/tests/robust_test.py:291:31: E1130: bad operand type for unary -: list (invalid-unary-operand-type)
************* Module control.tests.timeresp_test
control/tests/timeresp_test.py:355:38: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:355:48: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:356:38: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:356:51: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:421:36: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/tests/timeresp_test.py:521:45: E1126: Sequence index is not an int, slice, or instance with __index__ (invalid-sequence-index)
control/tests/timeresp_test.py:923:19: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:924:19: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:924:36: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:926:19: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:926:33: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:976:15: E1101: Instance of 'tuple' has no 'ndim' member (no-member)
control/tests/timeresp_test.py:977:15: E1101: Instance of 'tuple' has no 'ndim' member (no-member)
control/tests/timeresp_test.py:978:15: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:978:26: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:1022:23: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:1024:23: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:1035:23: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:1037:23: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:1047:19: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:1057:19: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:1076:19: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:1093:19: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:1098:19: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:1142:15: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:1167:15: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:1168:15: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:1169:15: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:1174:15: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:1175:15: E1101: Instance of 'tuple' has no 'shape' member (no-member)
control/tests/timeresp_test.py:1176:15: E1101: Instance of 'tuple' has no 'shape' member (no-member)
************* Module control.tests.input_element_int_test
control/tests/input_element_int_test.py:66:40: E1101: Instance of 'finfo' has no 'epsneg' member (no-member)
************* Module control.flatsys.flatsys
control/flatsys/flatsys.py:174:4: E0202: An attribute defined in control.flatsys.flatsys line 163 hides this method (method-hidden)
control/flatsys/flatsys.py:203:4: E0202: An attribute defined in control.flatsys.flatsys line 164 hides this method (method-hidden)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
roryyorke added 5 commits November 20, 2022 07:48
@roryyorke
Use raise NotImplentedError, not NotImplemented in InputOutputSys…
c70a377
…tem._rhs
@roryyorke
Correct warnings.warn call in modelsimp.markov
3732a21
@roryyorke
Remove non-existent __all__ entry in optimal
3f7b640
@roryyorke
Import ControlSlycot exception in statesp
5d7b798
@roryyorke
Merge constraint constructor error tests in optimal_test
f591c08
@coveralls

coveralls commented Nov 20, 2022

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.04%) to 94.84% when pulling f591c08 on roryyorke:rory/pylint-fixes into 2dc409b on python-control:main.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bnavigator
bnavigator reviewed Nov 20, 2022
View reviewed changes
Comment thread control/tests/optimal_test.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

bnavigator
bnavigator reviewed Nov 20, 2022
View reviewed changes
Comment thread control/optimal.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bnavigator
bnavigator merged commit 2746ce1 into python-control:main Nov 20, 2022
@murrayrm murrayrm added this to the 0.9.3 milestone Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@murrayrm murrayrm murrayrm left review comments
@bnavigator bnavigator bnavigator left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

0.9.3

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@roryyorke @coveralls @murrayrm @bnavigator
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.