Repository navigation
Fix ruff #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: hot/fix_character_encoding
Are you sure you want to change the base?
Fix ruff #150
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -371,8 +371,10 @@ def inspect(self, file=None, issue_handling="print"): | |
| shape += (1, ) | ||
|
|
||
| # make verbose shape, e.g., '(M=100, R=2, N=128, ' | ||
| # (not strict, because invalid objects can have more | ||
| # dimensions than defined and inspect should still work) | ||
| shape_verbose = "(" | ||
| for s, d in zip(shape, dimension): | ||
| for s, d in zip(shape, dimension, strict=False): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why False here?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See comment righ above :) It's a user friendly way to make inspect work on sofa files that may have become invalid after an edit. This will be raised as an error in |
||
| shape_verbose += f"{d}={s}, " | ||
|
|
||
| # add shape information | ||
|
|
@@ -1409,7 +1411,7 @@ def _verify_unit(test, ref, unit_aliases): | |
| return False | ||
|
|
||
| # check if units are valid | ||
| for unit_test, unit_ref in zip(units_test, units_ref): | ||
| for unit_test, unit_ref in zip(units_test, units_ref, strict=True): | ||
| if unit_test not in unit_aliases \ | ||
| or unit_aliases[unit_test] != unit_ref: | ||
| return False | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe it is better to add this to ruff exclude in line 78, as this is not in our hand.