Skip to content

Remove commented-out code, unused imports #11272

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

Merged
merged 2 commits into from
May 23, 2018
Merged

Conversation

Zac-HD
Copy link
Contributor

@Zac-HD Zac-HD commented May 18, 2018

The proper place for commented-out old code is in the version history tracked by git, not the current source files. As well as commented lines, I removed extra newlines where they made the spacing of code inconsistent and potentially confusing. Unused imports are a similar anti-pattern, and unpythonic.

The intention is that this set of changes makes the code easier to read, and thus makes contributing to Matplotlib slightly easier.


tr = self._axis_artist_helper.get_axislabel_transform(self.axes) \
+ self.offset_transform

self.label = AxisLabel(0, 0, "__from_axes__",
color = "auto", #rcParams['axes.labelcolor'],
Copy link
Contributor

Choose a reason for hiding this comment

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

was likely intended as a comment? (unclear)

Copy link
Contributor Author

@Zac-HD Zac-HD May 19, 2018

Choose a reason for hiding this comment

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

In context, rcParams['axes.labelcolor'] was previously used as the color argument, and later replaced by "auto" (which IIRC does fall back to the rcParam if it needs to, but may also try other default behaviour).

So it's dead code, and if taken to be a comment it's misleading.

@WeatherGod
Copy link
Member

WeatherGod commented May 19, 2018 via email

Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

I don't have a strong opinion on the implicit public API due to imports. This is for someone else to decide.

Apart from that the changes look reasonable.

@anntzer anntzer merged commit 1e6790f into matplotlib:master May 23, 2018
@Zac-HD Zac-HD deleted the cleanup branch May 23, 2018 00:35
@QuLogic QuLogic added this to the v3.0.0 milestone Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants