Skip to content

Commit

Permalink
Lint 00-mwe.py and utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cbueth committed Apr 22, 2024
1 parent 876c154 commit e66ac2b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
7 changes: 4 additions & 3 deletions examples/00-mwe.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Minimum working example for superblockify."""

# While this script is running, figures will be generated on screen.
# While this script is running, figures will be generated on screen.
# Close the figure windows to proceed with the script execution.


Expand All @@ -12,10 +12,11 @@
name="Scheveningen_test",
city_name="Scheveningen",
search_str="Scheveningen, NL",
unit="time", # "time", "distance", any other edge attribute, or None to count edges
unit="time",
# "time", "distance", any other edge attribute, or None to count edges
)
# If you want to select a different city, find the corresponding search string
# (`search_str`) at https://nominatim.openstreetmap.org/.
# (`search_str`) at https://nominatim.openstreetmap.org/.
# The smaller the place, the quicker the partitioning.
# For large places sufficient memory is required.

Expand Down
11 changes: 7 additions & 4 deletions superblockify/partitioning/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ def save_to_gpkg(
The path to save the geodatapackage to. If None, it will be saved to the
partitioners folder at (part.results_dir, part.name + ".gpkg")
ltn_boundary : bool, optional
If True, the boundary of the Superblocks will be saved as a polygon into the `cell`
attribute of the Superblocks layer. For this, the tessellation needs to be calculated.
If True, the boundary of the Superblocks will be saved as a polygon into the
`cell` attribute of the Superblocks layer. For this, the tessellation needs
to be calculated.
Raises
------
Expand Down Expand Up @@ -98,12 +99,14 @@ def save_to_gpkg(
if partitioner.components:
parts = partitioner.components
logger.info(
"Using components attribute to save Superblocks to geodatapackage %s", filepath
"Using components attribute to save Superblocks to geodatapackage %s",
filepath,
)
elif partitioner.partitions:
parts = partitioner.partitions
logger.info(
"Using partitions attribute to save Superblocks to geodatapackage %s", filepath
"Using partitions attribute to save Superblocks to geodatapackage %s",
filepath,
)

if not isinstance(parts, list):
Expand Down

0 comments on commit e66ac2b

Please sign in to comment.