Repository navigation
chore(lint): fix the ruff findings in Dynamics.py and RobotProto.py, except module names - #880
Merged
Merged
Conversation
…except module names
fdyn took Q_args and solver_args with {} as the default, and payload took np.zeros(3):
a mutable default is one object shared by every call, and a call as a default is made
once. They are None now, and the object is made inside. Also: Callable from
collections.abc, an if that was nested for no reason, extra parentheses, and the import
order. N999 (CamelCase module names) is not changed, it is Toolbox-wide.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
petercorke
enabled auto-merge (squash)
October 21, 2026 23:31
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 3 high |
🟢 Metrics 5 complexity · 0 duplication
Metric Results Complexity 5 Duplication 0
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #880 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 146 146
Lines 17100 17103 +3
=====================================
- Misses 17100 17103 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes the
rufffindings inrobot/Dynamics.pyandrobot/RobotProto.py, except N999 (CamelCase module names, which is Toolbox-wide) and one TRY004 that is inpay()(see below).fdyn(Q_args={}, solver_args={})now defaults toNoneand makes the dict inside. A default dict is one object shared by every call.payload(m, p=np.zeros(3))is nowp=None, which means the origin of the end-effector frame, as the docstring says. Behaviour is the same.Callablefromcollections.abc; extra parentheses innp.zeros((self.n)); a nestedifthat is one condition; the import order.tests/test_dynamics_defaults.pychecks that the defaults areNone, thatpayload(m)equalspayload(m, [0, 0, 0]), and thatfdynruns without the optional arguments.Not changed:
TRY004at theraise ValueError("W is invalid")inpay().pay()is being removed in the payload capacity work, so changing its exception type would be wasted.Changes numerical results or public behaviour: no. The signatures say
dict | NoneandArrayLike | Nonewhere they saiddictandAny; a call that worked still works.Ran: the dynamics-related tests (222 passed, 1 skipped) and mypy (clean, 165 files);
ruff checkon the two files shows only N999 and TRY004.Written with Claude Code.
🤖 Generated with Claude Code