Closed martin-ueding closed 2 months ago
I've looked at one particular tile:
And it seems to be missing from the tile history:
>>> import pickle
>>> with open("/home/mu/Dokumente/Karten/Playground/Cache/tile-state-2.pickle", 'rb') as f: data = pickle.load(f)
...
>>> th = data['tile_history'][14]
>>> th.loc[th.tile_x == 8513]
activity_id time tile_x tile_y count
2 605600879631349435 2013-03-26 14:16:28.000 8513 5509 5
3 605600879631349435 2013-03-26 14:16:38.000 8513 5508 6
...
>>> th.loc[(th.tile_x == 8513) & (th.tile_y == 5514)]
Empty DataFrame
Columns: [activity_id, time, tile_x, tile_y, count]
Index: []
So there is a problem with the tile_history
feature, not all tiles gets inserted there. But we can see that the tile is shown as discovered. In the tile_visits
it is present:
>>> tv = data['tile_visits'][14]
>>> tv[(8513, 5514)]
{'activity_ids': {3280749438695665022}, 'first_id': 3280749438695665022, 'first_time': Timestamp('2022-07-23 14:19:48'), 'last_id': 3280749438695665022, 'last_time': Timestamp('2022-07-23 14:19:48')}
Ah, it breaks when there was an activity there which we did not consider for achievements:
if activity["consider_for_achievements"]:
if tile not in activities_per_tile:
new_tile_history_soa["activity_id"].append(activity_id)
new_tile_history_soa["time"].append(time)
new_tile_history_soa["tile_x"].append(tile[0])
new_tile_history_soa["tile_y"].append(tile[1])
activities_per_tile[tile].add(activity_id)
So I just need to use a different basis to check, using tile_state["tile_visits"][zoom]
instead of activities_per_tile
only considers the activities for achievements.
And with that change it is now fixed:
With the latest changes to the tile handling stuff, the cluster detection is now broken: