Skip to content
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

Various cleanups #27286

Merged
merged 3 commits into from
Nov 8, 2023
Merged

Various cleanups #27286

merged 3 commits into from
Nov 8, 2023

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Nov 7, 2023

Three independent cleanup commits:

  • in axisartist: Mostly just unwrapping long lists of arguments and other expressions into a single line where possible.
  • in contour: Shorten contour._make_paths_from_contour_generator.
  • in dviread: Move most one-liner opcode parsers into lambdas with the behavior specified by comments, which seems clearer than spreading them out into proper functions with plenty of intervening blank space.

PR summary

PR checklist

lib/mpl_toolkits/axisartist/axislines.py Outdated Show resolved Hide resolved
lib/matplotlib/dviread.py Outdated Show resolved Hide resolved
Mostly just unwrapping long lists of arguments into a single line where
possible.
Copy link
Member

@ksunden ksunden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some comment clean ups

Comment on lines 145 to 147
# slen1: Read (delta + 1) bytes as an unsigned number.
ulen1=lambda dvi, delta: dvi._arg(delta + 1, signed=False),
# slen1: Read (delta + 1) bytes as an unsigned number if less than 4 bytes,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# slen1: Read (delta + 1) bytes as an unsigned number.
ulen1=lambda dvi, delta: dvi._arg(delta + 1, signed=False),
# slen1: Read (delta + 1) bytes as an unsigned number if less than 4 bytes,
# ulen1: Read (delta + 1) bytes as an unsigned number.
ulen1=lambda dvi, delta: dvi._arg(delta + 1, signed=False),
# olen1: Read (delta + 1) bytes as an unsigned number if less than 4 bytes,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, fixed.

@ksunden ksunden added this to the v3.9.0 milestone Nov 8, 2023
@ksunden ksunden merged commit fcbf883 into matplotlib:main Nov 8, 2023
40 checks passed
@anntzer anntzer deleted the cleanup branch November 8, 2023 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants