[Git][debian-gis-team/pycoast][upstream] New upstream version 1.3.2+dfsg
Antonio Valentino
gitlab at salsa.debian.org
Sun Dec 8 11:07:19 GMT 2019
Antonio Valentino pushed to branch upstream at Debian GIS Project / pycoast
Commits:
63a3f680 by Antonio Valentino at 2019-12-08T10:56:22Z
New upstream version 1.3.2+dfsg
- - - - -
4 changed files:
- .github/PULL_REQUEST_TEMPLATE.md
- pycoast/cw_base.py
- pycoast/tests/test_pycoast.py
- pycoast/version.py
Changes:
=====================================
.github/PULL_REQUEST_TEMPLATE.md
=====================================
@@ -1,9 +1,9 @@
-<!-- Please make the PR against the `develop` branch. -->
+<!-- Please make the PR against the `master` branch. -->
<!-- Describe what your PR does, and why -->
- [ ] Closes #xxxx <!-- remove if there is no corresponding issue, which should only be the case for minor changes -->
- [ ] Tests added <!-- for all bug fixes or enhancements -->
- [ ] Tests passed <!-- for all non-documentation changes) -->
- - [ ] Passes ``git diff origin/develop **/*py | flake8 --diff`` <!-- remove if you did not edit any Python files -->
+ - [ ] Passes ``git diff origin/master **/*py | flake8 --diff`` <!-- remove if you did not edit any Python files -->
- [ ] Fully documented <!-- remove if this change should not be visible to users, e.g., if it is an internal clean-up, or if this is part of a larger project that will be documented later -->
=====================================
pycoast/cw_base.py
=====================================
@@ -37,7 +37,7 @@ def get_resolution_from_area(area_def):
"""Get the best resolution for an area definition."""
x_size = area_def.width
y_size = area_def.height
- prj = Proj(area_def.proj_str)
+ prj = Proj(area_def.crs if hasattr(area_def, 'crs') else area_def.proj_str)
if prj.is_latlong():
x_ll, y_ll = prj(area_def.area_extent[0], area_def.area_extent[1])
x_ur, y_ur = prj(area_def.area_extent[2], area_def.area_extent[3])
@@ -200,10 +200,10 @@ class ContourWriterBase(object):
"""
try:
- proj4_string = area_def.proj_str
+ proj_def = area_def.crs if hasattr(area_def, 'crs') else area_def.proj_dict
area_extent = area_def.area_extent
except AttributeError:
- proj4_string = area_def[0]
+ proj_def = area_def[0]
area_extent = area_def[1]
draw = self._get_canvas(image)
@@ -224,7 +224,7 @@ class ContourWriterBase(object):
# Area and projection info
x_size, y_size = image.size
- prj = Proj(proj4_string)
+ prj = Proj(proj_def)
x_offset = 0
y_offset = 0
@@ -285,7 +285,7 @@ class ContourWriterBase(object):
# lons along major lat lines (extended slightly to avoid missing the
# end)
- lin_lons = np.linspace(lon_min, lon_max + Dlon / 5.0, max(x_size, y_size) / 5)
+ lin_lons = np.linspace(lon_min, lon_max + Dlon / 5.0, max(x_size, y_size) // 5)
# MINOR LINES ######
if not kwargs['minor_is_tick']:
@@ -544,17 +544,17 @@ class ContourWriterBase(object):
"""
try:
- proj4_string = area_def.proj_str
+ proj_def = area_def.crs if hasattr(area_def, 'crs') else area_def.proj_dict
area_extent = area_def.area_extent
except AttributeError:
- proj4_string = area_def[0]
+ proj_def = area_def[0]
area_extent = area_def[1]
draw = self._get_canvas(image)
# Area and projection info
x_size, y_size = image.size
- prj = Proj(proj4_string)
+ prj = Proj(proj_def)
# Calculate min and max lons and lats of interest
lon_min, lon_max, lat_min, lat_max = _get_lon_lat_bounding_box(area_extent, x_size, y_size, prj)
@@ -649,8 +649,8 @@ class ContourWriterBase(object):
else:
format_string += 'L%s.shp'
- if type(level) not in (list,):
- level = range(1,level+1)
+ if not isinstance(level, list):
+ level = range(1, level + 1)
for i in level:
@@ -792,13 +792,6 @@ class ContourWriterBase(object):
params = DEFAULT.copy()
params.update(overlays[section])
- params['level'] = int(params['level'])
- params['x_offset'] = float(params['x_offset'])
- params['y_offset'] = float(params['y_offset'])
- params['width'] = float(params['width'])
- params['outline_opacity'] = int(params['outline_opacity'])
- params['fill_opacity'] = int(params['fill_opacity'])
-
if section != "coasts":
params.pop('fill_opacity', None)
params.pop('fill', None)
@@ -895,20 +888,8 @@ class ContourWriterBase(object):
db_root_path = self.db_root_path
if db_root_path is None:
raise ValueError("'db_root_path' must be specified to use this method")
-
- try:
- proj4_string = area_def.proj_str
- area_extent = area_def.area_extent
- except AttributeError:
- proj4_string = area_def[0]
- area_extent = area_def[1]
-
draw = self._get_canvas(image)
- # Area and projection info
- x_size, y_size = image.size
- prj = Proj(proj4_string)
-
# read shape file with points
# Sc-Kh shapefilename = os.path.join(self.db_root_path,
# "cities_15000_alternativ.shp")
@@ -989,6 +970,8 @@ def _get_lon_lat_bounding_box(area_extent, x_size, y_size, prj):
prev = None
for lon in np.concatenate((lons_s1, lons_s2,
lons_s3[::-1], lons_s4[::-1])):
+ if not np.isfinite(lon):
+ continue
if prev is not None:
delta = lon - prev
if abs(delta) > 180:
@@ -1033,6 +1016,7 @@ def _get_lon_lat_bounding_box(area_extent, x_size, y_size, prj):
lon_min = -180
lon_max = 180
+ # Catch inf/1e30 or other invalid values
if not (-180 <= lon_min <= 180):
lon_min = -180
if not (-180 <= lon_max <= 180):
@@ -1064,16 +1048,16 @@ def _get_pixel_index(shape, area_extent, x_size, y_size, prj,
# Handle out of bounds
i = 0
segments = []
- if 1e30 in x or 1e30 in y:
+ if (x >= 1e30).any() or (y >= 1e30).any():
# Split polygon in line segments within projection
is_reduced = True
- if x[0] == 1e30 or y[0] == 1e30:
+ if x[0] >= 1e30 or y[0] >= 1e30:
in_segment = False
else:
in_segment = True
for j in range(x.size):
- if (x[j] == 1e30 or y[j] == 1e30):
+ if x[j] >= 1e30 or y[j] >= 1e30:
if in_segment:
segments.append((x[i:j], y[i:j]))
in_segment = False
=====================================
pycoast/tests/test_pycoast.py
=====================================
@@ -723,7 +723,7 @@ class FakeAreaDef():
"""A fake area definition object."""
def __init__(self, proj4_string, area_extent, x_size, y_size):
- self.proj_str = proj4_string
+ self.proj_str = self.proj_dict = self.crs = proj4_string
self.area_extent = area_extent
self.width = x_size
self.height = y_size
@@ -753,7 +753,7 @@ class TestFromConfig(TestPycoast):
self.assertTrue(fft_metric(euro_data, res),
'Writing of contours failed')
- overlays = {'coasts': {'level': 4, 'resolution': 'l'},
+ overlays = {'coasts': {'level': [1, 2, 3, 4], 'resolution': 'l'},
'borders': {'outline': (255, 0, 0), 'resolution': 'c'},
'rivers': {'outline': 'blue', 'resolution': 'c', 'level': 5}}
=====================================
pycoast/version.py
=====================================
@@ -23,9 +23,9 @@ def get_keywords():
# setup.py/versioneer.py will grep for the variable names, so they must
# each be defined on a line of their own. _version.py will just call
# get_keywords().
- git_refnames = " (HEAD -> master, tag: v1.3.1)"
- git_full = "abf499539f3457e9ffe49adabfae3eb247c9fb1f"
- git_date = "2019-11-07 13:44:51 +0100"
+ git_refnames = " (HEAD -> master, tag: v1.3.2)"
+ git_full = "eb35e257be4bc570dc6f08fb044aca259fe71890"
+ git_date = "2019-12-06 14:39:30 -0600"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
View it on GitLab: https://salsa.debian.org/debian-gis-team/pycoast/commit/63a3f680ab8fe28ec4aef3e26e93879e27dbd8c0
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/pycoast/commit/63a3f680ab8fe28ec4aef3e26e93879e27dbd8c0
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20191208/a01fbb8b/attachment-0001.html>
More information about the Pkg-grass-devel
mailing list