-
Notifications
You must be signed in to change notification settings - Fork 373
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
Configure + enable stickler testing. #970
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
linters: | ||
flake8: { } | ||
flake8: |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,8 @@ | |
from shapely.prepared import prep | ||
import six | ||
|
||
from cartopy._crs import CRS, Geocentric, Geodetic, Globe, PROJ4_VERSION | ||
from cartopy._crs import CRS, Geodetic, Globe, PROJ4_VERSION | ||
from cartopy._crs import Geocentric # noqa: F401 (flake8 = unused import) | ||
import cartopy.trace | ||
|
||
|
||
|
@@ -746,7 +747,6 @@ def quick_vertices_transform(self, vertices, src_crs): | |
mod = np.diff(src_crs.x_limits)[0] | ||
bboxes, proj_offset = self._bbox_and_offset(src_crs) | ||
x_lim = xs.min(), xs.max() | ||
y_lim = ys.min(), ys.max() | ||
for poly in bboxes: | ||
# Arbitrarily choose the number of moduli to look | ||
# above and below the -180->180 range. If data is beyond | ||
|
@@ -1184,7 +1184,6 @@ def __init__(self, central_longitude=0.0, central_latitude=0.0, | |
globe=globe) | ||
|
||
a = np.float(self.globe.semimajor_axis or WGS84_SEMIMAJOR_AXIS) | ||
b = np.float(self.globe.semiminor_axis or WGS84_SEMIMINOR_AXIS) | ||
lon, lat = central_longitude + 180, - central_latitude + 0.01 | ||
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. @pp-mo And also what's happened to b (the semiminor axis)? 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. 'b' also not used anywhere. 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. Identical to what? 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. Identical to 'a'. 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. It's not identical to 'a', though. But I'm not sure it needs to be used anyway. 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. Oh I see, it is not after all : more care required ! |
||
x, max_y = self.transform_point(lon, lat, PlateCarree()) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,7 @@ def _north_south_formatted(latitude, num_format='g'): | |
hemisphere=_lat_heimisphere(latitude), | ||
degree=_DEGREE_SYMBOL) | ||
|
||
|
||
#: A formatter which turns longitude values into nice longitudes such as 110W | ||
LONGITUDE_FORMATTER = mticker.FuncFormatter(lambda v, pos: | ||
_east_west_formatted(v)) | ||
|
@@ -335,9 +336,10 @@ def _draw_gridliner(self, nx=None, ny=None, background_patch=None): | |
if self.xlines: | ||
lines = [] | ||
for x in x_gridline_points: | ||
l = list(zip(np.zeros(n_steps) + x, | ||
np.linspace(min(y_ticks), max(y_ticks), n_steps))) | ||
lines.append(l) | ||
ticks = list(zip( | ||
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. I could've sworn I'd written some optimization for this unfortunate type conversion; maybe I never made a PR out of it, but I can see if I can dig it up. 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. I don't see a need to connect this with the issue at hand ? 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. No, just a reminder to myself. |
||
np.zeros(n_steps) + x, | ||
np.linspace(min(y_ticks), max(y_ticks), n_steps))) | ||
lines.append(ticks) | ||
|
||
x_lc = mcollections.LineCollection(lines, **collection_kwargs) | ||
self.xline_artists.append(x_lc) | ||
|
@@ -346,9 +348,10 @@ def _draw_gridliner(self, nx=None, ny=None, background_patch=None): | |
if self.ylines: | ||
lines = [] | ||
for y in y_ticks: | ||
l = list(zip(np.linspace(min(x_ticks), max(x_ticks), n_steps), | ||
np.zeros(n_steps) + y)) | ||
lines.append(l) | ||
ticks = list(zip( | ||
np.linspace(min(x_ticks), max(x_ticks), n_steps), | ||
np.zeros(n_steps) + y)) | ||
lines.append(ticks) | ||
|
||
y_lc = mcollections.LineCollection(lines, **collection_kwargs) | ||
self.yline_artists.append(y_lc) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[flake8] | ||
ignore = E402,\ # Due to conditional imports | ||
E226,\ # Due to whitespace around operators (e.g. 2*x + 3) | ||
E241 # Due to multiple spaces after comma | ||
exclude = \ | ||
build, \ | ||
setup.py, \ | ||
docs/source/conf.py, \ | ||
docs/source/sphinxext/plot_directive.py |
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.
@pp-mo What's happened to y_lim?
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.
'y_lim' was not used, so flake8 complained about it, so I got rid of it.
There's a lot of that going on in this PR !