Skip to content

Commit 22e47c0

Browse files
author
matthias_schaub
committed
Run Black
1 parent 4c7fed5 commit 22e47c0

File tree

4 files changed

+11
-46
lines changed

4 files changed

+11
-46
lines changed

mapswipe_workers/mapswipe_workers/mapswipe_workers.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,7 @@ def run_create_tutorials() -> None:
289289

290290
@cli.command("archive")
291291
@click.option(
292-
"--project-id",
293-
"-i",
294-
help=("Archive project with giving project id"),
295-
type=str,
292+
"--project-id", "-i", help=("Archive project with giving project id"), type=str,
296293
)
297294
@click.option(
298295
"--project-ids",
@@ -320,10 +317,7 @@ def run_archive_project(project_id, project_ids):
320317

321318
@cli.command("delete")
322319
@click.option(
323-
"--project-id",
324-
"-i",
325-
help=("Delete project with giving project id"),
326-
type=str,
320+
"--project-id", "-i", help=("Delete project with giving project id"), type=str,
327321
)
328322
@click.option(
329323
"--project-ids",

mapswipe_workers/mapswipe_workers/project_types/base/project.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ def save_project(self):
127127
# Make sure projects get saved in Postgres and Firebase successful
128128
try:
129129
self.save_to_postgres(
130-
project,
131-
groups,
132-
groupsOfTasks,
130+
project, groups, groupsOfTasks,
133131
)
134132
logger.info(
135133
f"{self.projectId}" f" - the project has been saved" f" to postgres"
@@ -161,9 +159,7 @@ def save_project(self):
161159

162160
try:
163161
self.save_to_firebase(
164-
project,
165-
groups,
166-
groupsOfTasks,
162+
project, groups, groupsOfTasks,
167163
)
168164
logger.info(
169165
f"{self.projectId}" f" - the project has been saved" f" to firebase"
@@ -452,10 +448,7 @@ def create_groups_txt_file(self, groups):
452448
"project_type_specifics",
453449
)
454450
w = csv.DictWriter(
455-
groups_txt_file,
456-
fieldnames=fieldnames,
457-
delimiter="\t",
458-
quotechar="'",
451+
groups_txt_file, fieldnames=fieldnames, delimiter="\t", quotechar="'",
459452
)
460453

461454
for groupId, group in groups.items():
@@ -525,10 +518,7 @@ def create_tasks_txt_file(self, groupsOfTasks):
525518
"project_type_specifics",
526519
)
527520
w = csv.DictWriter(
528-
tasks_txt_file,
529-
fieldnames=fieldnames,
530-
delimiter="\t",
531-
quotechar="'",
521+
tasks_txt_file, fieldnames=fieldnames, delimiter="\t", quotechar="'",
532522
)
533523

534524
for groupId, tasks in groupsOfTasks.items():

mapswipe_workers/mapswipe_workers/utils/geojson_functions.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,7 @@ def create_geojson_file_from_dict(final_groups_dict, outfile):
153153

154154
dataSource = driver.CreateDataSource(outfile_temp)
155155
# create layer
156-
layer = dataSource.CreateLayer(
157-
outfile_temp,
158-
srs,
159-
geom_type=ogr.wkbPolygon,
160-
)
156+
layer = dataSource.CreateLayer(outfile_temp, srs, geom_type=ogr.wkbPolygon,)
161157

162158
# create fields
163159
field_id = ogr.FieldDefn("group_id", ogr.OFTInteger)
@@ -246,11 +242,7 @@ def create_geojson_file(geometries, outfile):
246242

247243
dataSource = driver.CreateDataSource(outfile_temp)
248244
# create layer
249-
layer = dataSource.CreateLayer(
250-
outfile_temp,
251-
srs,
252-
geom_type=ogr.wkbPolygon,
253-
)
245+
layer = dataSource.CreateLayer(outfile_temp, srs, geom_type=ogr.wkbPolygon,)
254246

255247
# create fields
256248
field_id = ogr.FieldDefn("id", ogr.OFTInteger)

mapswipe_workers/mapswipe_workers/utils/tile_functions.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,7 @@ def tile_coords_zoom_and_tileserver_to_url(
9696
# https://www.maptiler.com/google-maps-coordinates-tile-bounds-projection/
9797
tile_y = int(math.pow(2, tile_z) - tile_y) - 1
9898
url = tile_server["url"].format(
99-
key=tile_server["apiKey"],
100-
x=tile_x,
101-
y=tile_y,
102-
z=tile_z,
99+
key=tile_server["apiKey"], x=tile_x, y=tile_y, z=tile_z,
103100
)
104101
elif "{-y}" in tile_server["url"]:
105102
# this uses not the standard TMS tile y coordinate,
@@ -108,18 +105,10 @@ def tile_coords_zoom_and_tileserver_to_url(
108105
# https://www.maptiler.com/google-maps-coordinates-tile-bounds-projection/
109106
tile_y = int(math.pow(2, tile_z) - tile_y) - 1
110107
url = tile_server["url"].replace("{-y}", "{y}")
111-
url = url.format(
112-
key=tile_server["apiKey"],
113-
x=tile_x,
114-
y=tile_y,
115-
z=tile_z,
116-
)
108+
url = url.format(key=tile_server["apiKey"], x=tile_x, y=tile_y, z=tile_z,)
117109
else:
118110
url = tile_server["url"].format(
119-
key=tile_server["apiKey"],
120-
x=tile_x,
121-
y=tile_y,
122-
z=tile_z,
111+
key=tile_server["apiKey"], x=tile_x, y=tile_y, z=tile_z,
123112
)
124113

125114
return url

0 commit comments

Comments
 (0)