Skip to content

Commit d7c981a

Browse files
committed
Whitespace cleanup and ensure script actually tries to run everything
1 parent 77f084c commit d7c981a

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

utils/readboundaries_shp.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@
55

66
def quantize(data,least_significant_digit):
77
"""
8+
quantize data to improve compression. data is quantized using
9+
around(scale*data)/scale, where scale is 2**bits, and bits is determined
10+
from the least_significant_digit. For example, if
11+
least_significant_digit=1, bits will be 4.
812
9-
quantize data to improve compression. data is quantized using
10-
around(scale*data)/scale, where scale is 2**bits, and bits is determined
11-
from the least_significant_digit. For example, if
12-
least_significant_digit=1, bits will be 4.
13-
14-
This function is pure python.
15-
13+
This function is pure python.
1614
"""
1715
precision = pow(10.,-least_significant_digit)
1816
exp = np.log10(precision)
@@ -39,7 +37,7 @@ def get_coast_polygons(resolution):
3937
for shprec in shf.shapeRecords():
4038
shp = shprec.shape; rec = shprec.record
4139
parts = shp.parts.tolist()
42-
if parts != [0]:
40+
if parts != [0]:
4341
print 'multipart polygon'
4442
raise SystemExit
4543
verts = shp.points
@@ -70,7 +68,7 @@ def get_wdb_boundaries(resolution,level,rivers=False):
7068
for shprec in shf.shapeRecords():
7169
shp = shprec.shape; rec = shprec.record
7270
parts = shp.parts.tolist()
73-
if parts != [0]:
71+
if parts != [0]:
7472
print 'multipart polygon'
7573
raise SystemExit
7674
verts = shp.points
@@ -105,7 +103,6 @@ def get_wdb_boundaries(resolution,level,rivers=False):
105103
offset = offset + len(bstring)
106104
f.close()
107105
f2.close()
108-
raise SystemExit
109106

110107
for resolution in ['c','l','i','h','f']:
111108
poly, polymeta = get_wdb_boundaries(resolution,1)

0 commit comments

Comments
 (0)