Skip to content

Commit 8eedefc

Browse files
authored
Merge pull request #252 from mapswipe/feature-tasking-manager-geometries
Feature tasking manager geometries
2 parents 89a98a8 + 4257ee0 commit 8eedefc

File tree

8 files changed

+570
-6
lines changed

8 files changed

+570
-6
lines changed

docker-compose.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ services:
5353
context: mapswipe_workers/
5454
depends_on:
5555
- postgres
56-
command: mapswipe_workers --verbose run --schedule m --only_new_results
56+
command: mapswipe_workers --verbose run --schedule m
5757
volumes:
5858
- ./api-data:/var/lib/mapswipe_workers/api-data/:rw
5959
- ./api-data/agg_results:/var/lib/mapswipe_workers/api-data/agg_results:rw
@@ -62,6 +62,8 @@ services:
6262
- ./api-data/projects:/var/lib/mapswipe_workers/api-data/projects:rw
6363
- ./api-data/results:/var/lib/mapswipe_workers/api-data/results:rw
6464
- ./api-data/tasks:/var/lib/mapswipe_workers/api-data/tasks:rw
65+
- ./api-data/yes_maybe:/var/lib/mapswipe_workers/api-data/yes_maybe:rw
66+
- ./api-data/hot_tm:/var/lib/mapswipe_workers/api-data/hot_tm:rw
6567
restart: "no"
6668
networks:
6769
- mapswipe_workers

mapswipe_workers/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ RUN mkdir -p $data_dir"api-data/history/"
2323
RUN mkdir -p $data_dir"api-data/projects/"
2424
RUN mkdir -p $data_dir"api-data/results/"
2525
RUN mkdir -p $data_dir"api-data/tasks/"
26+
RUN mkdir -p $data_dir"api-data/yes_maybe/"
27+
RUN mkdir -p $data_dir"api-data/hot_tm/"
2628

2729
# copy mapswipe workers repo from local repo
2830
WORKDIR $repo_dir

mapswipe_workers/mapswipe_workers/generate_stats/generate_stats.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@ def generate_stats(project_id_list: list):
6262
projects_info_dynamic_filename, index_label="idx"
6363
)
6464

65-
# TODO: for build area projects generate tasking manager geometries
66-
6765
if len(project_id_list) > 0:
6866
# merge static info and dynamic info and save
6967
projects_filename = f"{DATA_PATH}/api-data/projects/projects.csv"

mapswipe_workers/mapswipe_workers/generate_stats/project_stats.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
from mapswipe_workers import auth
77
from mapswipe_workers.definitions import logger, DATA_PATH
88
from mapswipe_workers.utils import geojson_functions
9-
from mapswipe_workers.generate_stats import project_stats_by_date
9+
from mapswipe_workers.generate_stats import (
10+
project_stats_by_date,
11+
tasking_manager_geometries,
12+
)
1013

1114

1215
def add_metadata_to_csv(filename: str):
@@ -353,6 +356,10 @@ def get_per_project_statistics(project_id: str, project_info: pd.Series) -> dict
353356
f"saved project stats by date for {project_id}: {project_stats_by_date_filename}"
354357
)
355358

359+
# generate geometries for HOT Tasking Manager
360+
tasking_manager_geometries.generate_tasking_manager_geometries(project_id)
361+
362+
# prepare output of function
356363
project_stats_dict = {
357364
"project_id": project_id,
358365
"progress": project_stats_by_date_df["cum_progress"].iloc[-1],

0 commit comments

Comments
 (0)