8000 [examples] final pep8 fixes by twmr · Pull Request #3774 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

[examples] final pep8 fixes #3774

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 26 commits into from
Nov 15, 2014
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5cba226
fix trailing whitespace
twmr Nov 9, 2014
8cae397
fix multiple whitespace issues in svg_*.py examples (E293, E291)
twmr Nov 9, 2014
2f5b1e1
pep8 fix E201
twmr Nov 9, 2014
cc7fc7f
pep8 fix e2* in examples dir part 1/2
twmr Nov 9, 2014
b680680
pep8 fix e2* in examples dir part 2/2
twmr Nov 9, 2014
b081c92
pep8 fix E701
twmr Nov 9, 2014
0130bb9
pep8 fix E502 (redundant backslash)
twmr Nov 9, 2014
b959c79
pep8 fix e702,e703
twmr Nov 9, 2014
7122484
pep8 fix E302
twmr Nov 9, 2014
fa2ee50
remove blacklisted examples from coding style unittest
twmr Nov 9, 2014
eef2efc
ignore line to long errors for pep8 unit tests in examples/
twmr Nov 9, 2014
6289558
pep8 fix E124-E129
twmr Nov 9, 2014
16e1566
pep fix E401
twmr Nov 9, 2014
1e822e9
fix all issues in the output of the pep8 unit test
twmr Nov 9, 2014
85519f0
decrease the number of ignored pep8 error classes
twmr Nov 9, 2014
111cdab
consider @weathergods suggestions
twmr Nov 9, 2014
192a26c
prettify instantiation of ellipsecollection object
twmr Nov 9, 2014
e53ba3e
avoid triple quoted string
twmr Nov 9, 2014
3bd0f57
fix mutable default arguments
twmr Nov 9, 2014
2da662b
don't use implicit tuple assignment
twmr Nov 9, 2014
cb0467d
prettify instantiation of Linecollection obj even further
twmr Nov 9, 2014
2cb5403
Revert "pep8 fix E201"
twmr Nov 10, 2014
a79053c
fix pep8 unit tests
twmr Nov 15, 2014
9591cb8
minor cleanup in pipong example (0 + value)
twmr Nov 15, 2014
eab5b52
fixed extraneous whitespace
twmr Nov 15, 2014
2303939
fix pep8 violations in the new boxplot examples
twmr Nov 15, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
consider @weathergods suggestions
  • Loading branch information
twmr committed Nov 15, 2014
commit 111cdabed4058cfdcafba156e3b51b8778c3edf6
4 changes: 2 additions & 2 deletions examples/pylab_examples/demo_ribbon_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def get_stretched_image(self, stretch_factor):
cut = self.im[self.cut_location, :, :]
stretched_image[:, :, :] = cut
stretched_image[:self.cut_location, :, :] = \
self.im[:self.cut_location, :, :]
self.im[:self.cut_location, :, :]
stretched_image[-(ny - self.cut_location):, :, :] = \
self.im[-(ny - self.cut_location):, :, :]
self.im[-(ny - self.cut_location):, :, :]

self._cached_im = stretched_image
return stretched_image
Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/image_origin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
x.shape = 10, 10
Copy link
Member

Choose a reason for hiding this comment

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

can we please explicitly use tuples here? I never liked implicit tuples on the rhs for assignments

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would prefer to use the reshape method

x = arange(100.0).reshape((10, 10))

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps. I like assigning to the shape attribute because then I am not messing around with views or copies. And I even get an exception if it can not be cleanly reshaped that way. This is entirely personal preference and I can go either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't know that its possible to change the shape by assigning a tuple to the shape attr. You are right, this avoids messing around with views.


interp = 'bilinear'
#interp = 'nearest';
#interp = 'nearest'
lim = -2, 11, -2, 6
subplot(211, axisbg='g')
title('blue should be up')
Expand Down
2 changes: 1 addition & 1 deletion examples/pylab_examples/line_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
colors=[colorConverter.to_rgba(i)
Copy link
Member

Choose a reason for hiding this comment

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

Not strictly a PEP8 issue, but I think this would be nicer with the colors list comprehension assigned to a variable above, and then used by name; also, I think it could use for i in 'bgrcmyk' to shorten it. (I suspect I wrote this example myself long ago...)

for i in ('b', 'g', 'r', 'c',
'm', 'y', 'k')],
linestyle = 'solid')
linestyle='solid')
ax.add_collection(line_segments)
ax.set_title('Line collection with masked arrays')
plt.show()
0