Skip to content

Various cleanups#27286

Merged
ksunden merged 3 commits intomatplotlib:mainfrom
anntzer:cleanup
Nov 8, 2023
Merged

Various cleanups#27286
ksunden merged 3 commits intomatplotlib:mainfrom
anntzer:cleanup

Conversation

@anntzer
Copy link
Copy Markdown
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

Mostly just unwrapping long lists of arguments into a single line where
possible.
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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.

3 participants