File tree Expand file tree Collapse file tree 3 files changed +29
-5
lines changed
mapswipe_workers/mapswipe_workers/project_types/tile_map_service Expand file tree Collapse file tree 3 files changed +29
-5
lines changed Original file line number Diff line number Diff line change 1+ from dataclasses import asdict , dataclass
2+
13from mapswipe_workers .definitions import logger
24from mapswipe_workers .project_types .tile_map_service .tutorial import (
35 TileMapServiceBaseTutorial ,
6+ TileMapServiceBaseTutorialTask ,
47)
58from mapswipe_workers .project_types .tile_server import BaseTileServer
69from mapswipe_workers .utils import tile_functions
710
811
12+ @dataclass
13+ class ChangeDetectionTutorialTask (TileMapServiceBaseTutorialTask ):
14+ urlB : str
15+
16+
917class ChangeDetectionTutorial (TileMapServiceBaseTutorial ):
1018 """The subclass for an TMS Grid based Tutorial."""
1119
@@ -36,11 +44,16 @@ def create_tutorial_tasks(self):
3644
3745 super ().create_tutorial_tasks ()
3846
47+ modified_tasks = []
3948 for task in self .tasks [101 ]:
4049 _ , tile_x , tile_y = task .taskId_real .split ("-" )
41- task . urlB = tile_functions .tile_coords_zoom_and_tileserver_to_url (
50+ urlB = tile_functions .tile_coords_zoom_and_tileserver_to_url (
4251 int (tile_x ), int (tile_y ), self .zoomLevel , self .tileServerB
4352 )
53+ modified_tasks .append (
54+ ChangeDetectionTutorialTask (** asdict (task ), urlB = urlB )
55+ )
56+ self .tasks [101 ] = modified_tasks
4457
4558 logger .info (
4659 f"{ self .projectId } "
Original file line number Diff line number Diff line change 1+ from dataclasses import asdict , dataclass
2+
13from mapswipe_workers .definitions import logger
24from mapswipe_workers .project_types .tile_map_service .tutorial import (
35 TileMapServiceBaseTutorial ,
6+ TileMapServiceBaseTutorialTask ,
47)
58from mapswipe_workers .project_types .tile_server import BaseTileServer
69from mapswipe_workers .utils import tile_functions
710
811
12+ @dataclass
13+ class CompletenessTutorialTask (TileMapServiceBaseTutorialTask ):
14+ urlB : str
15+
16+
917class CompletenessTutorial (TileMapServiceBaseTutorial ):
1018 """The subclass for an TMS Grid based Tutorial."""
1119
@@ -36,11 +44,14 @@ def create_tutorial_tasks(self):
3644
3745 super ().create_tutorial_tasks ()
3846
47+ modified_tasks = []
3948 for task in self .tasks [101 ]:
4049 _ , tile_x , tile_y = task .taskId_real .split ("-" )
41- task . urlB = tile_functions .tile_coords_zoom_and_tileserver_to_url (
50+ urlB = tile_functions .tile_coords_zoom_and_tileserver_to_url (
4251 int (tile_x ), int (tile_y ), self .zoomLevel , self .tileServerB
4352 )
53+ modified_tasks .append (CompletenessTutorialTask (** asdict (task ), urlB = urlB ))
54+ self .tasks [101 ] = modified_tasks
4455
4556 logger .info (
4657 f"{ self .projectId } "
Original file line number Diff line number Diff line change 11from dataclasses import dataclass
2- from typing import Dict , List
2+ from typing import Dict , List , Union
33
44from mapswipe_workers .definitions import logger
55from mapswipe_workers .firebase .firebase import Firebase
@@ -25,8 +25,8 @@ class TileMapServiceBaseTutorial(BaseTutorial):
2525 def __init__ (self , tutorial_draft ):
2626 super ().__init__ (tutorial_draft )
2727
28- self .groups : Dict [str , TileMapServiceBaseGroup ] = {}
29- self .tasks : Dict [str , List [TileMapServiceBaseTutorialTask ]] = (
28+ self .groups : Dict [Union [ str , int ] , TileMapServiceBaseGroup ] = {}
29+ self .tasks : Dict [Union [ str , int ] , List [TileMapServiceBaseTutorialTask ]] = (
3030 {}
3131 ) # dict keys are group ids
3232
You can’t perform that action at this time.
0 commit comments