Skip to content

Commit

Permalink
fix syntaxwarning and apply black style formatting (#121)
Browse files Browse the repository at this point in the history
* fix syntaxwarning

* black formatting
  • Loading branch information
mattijn authored Mar 23, 2021
1 parent d7b586d commit c1e8fe0
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 128 deletions.
4 changes: 2 additions & 2 deletions topojson/core/cut.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ def to_svg(self, separate=False, include_junctions=False):
Parameters
----------
separate : boolean
If `True`, each of the linestrings will be displayed separately.
If `True`, each of the linestrings will be displayed separately.
Default is `False`
include_junctions : boolean
If `True`, the detected junctions will be displayed as well.
If `True`, the detected junctions will be displayed as well.
Default is `False`
"""
serialize_as_svg(
Expand Down
6 changes: 3 additions & 3 deletions topojson/core/dedup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ def to_svg(self, separate=False, include_junctions=False):
Parameters
----------
separate : boolean
If `True`, each of the linestrings will be displayed separately.
If `True`, each of the linestrings will be displayed separately.
Default is `False`
include_junctions : boolean
If `True`, the detected junctions will be displayed as well.
If `True`, the detected junctions will be displayed as well.
Default is `False`
"""
serialize_as_svg(self.output, separate, include_junctions)
Expand Down Expand Up @@ -259,7 +259,7 @@ def _merge_contigious_arcs(self, data, sliced_array_bk_ndp):
def _pop_merged_arcs(self, bk_dups, linestring_list, array_bk):
"""
The collected indici that can be popped, since they have been merged
This functions looks like _deduplicate(), but is slightly different where
This functions looks like _deduplicate(), but is slightly different where
vals2pop indici are set to 0 (NaN).
"""

Expand Down
13 changes: 6 additions & 7 deletions topojson/core/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class Extract(object):
with an equivalent `"coordinates"` array that points to one of the
linestrings as indexed in `bookkeeping_geoms` and stored in `linestrings`.
For Points geometries count the same, but are stored in `coordinates` and
referenced in `bookkeeping_coords`.
For Points geometries count the same, but are stored in `coordinates` and
referenced in `bookkeeping_coords`.
Parameters
----------
Expand Down Expand Up @@ -59,7 +59,7 @@ def __init__(self, data, options={}):
self._invalid_geoms = 0
self._tried_geojson = False

if instance(data) is "Collection": # fiona.Collection)
if instance(data) == "Collection": # fiona.Collection
copydata = data
else:
# FIXME: try except is not necessary once the following issue is fixed:
Expand Down Expand Up @@ -91,13 +91,13 @@ def to_svg(self, separate=False):
Parameters
----------
separate : boolean
If `True`, each of the linestrings will be displayed separately.
If `True`, each of the linestrings will be displayed separately.
Default is `False`
"""
serialize_as_svg(self.output, separate, include_junctions=False)

def _extractor(self, data):
""""
"""
Entry point for the class Extract.
The extract function is the first step in the topology computation.
Expand All @@ -120,7 +120,7 @@ def _extractor(self, data):
with an equivalent `"coordinates"` array that points to one of the
linestrings as indexed in `bookkeeping_geoms` and stored in `linestrings`.
For Points geometries count the same, but are stored in `coordinates` and
For Points geometries count the same, but are stored in `coordinates` and
referenced in `bookkeeping_coords`.
"""

Expand Down Expand Up @@ -696,4 +696,3 @@ def _extract_dictionary(self, geom):
# reset geom collection counter and level
self._geomcollection_counter = 0
self._geom_level_1 = 0

4 changes: 2 additions & 2 deletions topojson/core/hashmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def to_svg(self, separate=False):
Parameters
----------
separate : boolean
If `True`, each of the linestrings will be displayed separately.
If `True`, each of the linestrings will be displayed separately.
Default is `False`
"""
serialize_as_svg(self.output, separate, include_junctions=False)
Expand Down Expand Up @@ -328,7 +328,7 @@ def _resolve_bookkeeping(self, geoms, key):
arcs_in_geom = self._data[bk_objects][geom]
for idx_arc, arc_ref in enumerate(arcs_in_geom):
arc_ids = self._data[bk_element][arc_ref]
if len(arc_ids) > 1 and key is not "coordinates":
if len(arc_ids) > 1 and key != "coordinates":
self._inner = True if idx_arc > 0 else False
arc_ids = self._backward_arcs(arc_ids)

Expand Down
6 changes: 3 additions & 3 deletions topojson/core/join.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ def to_svg(self, separate=False, include_junctions=False):
Parameters
----------
separate : boolean
If `True`, each of the linestrings will be displayed separately.
If `True`, each of the linestrings will be displayed separately.
Default is `False`
include_junctions : boolean
If `True`, the detected junctions will be displayed as well.
If `True`, the detected junctions will be displayed as well.
Default is `False`
"""
serialize_as_svg(self.output, separate, include_junctions)
Expand Down Expand Up @@ -240,7 +240,7 @@ def _get_verts(geom):

def _validate_linemerge(self, merged_line):
"""
Return list of linestrings. If the linemerge was a MultiLineString
Return list of linestrings. If the linemerge was a MultiLineString
then returns a list of multiple single linestrings
"""

Expand Down
Loading

0 comments on commit c1e8fe0

Please sign in to comment.