Skip to content

Commit

Permalink
Merge branch 'main' into chore/formatting-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm authored May 5, 2024
2 parents 29affb4 + d2d2bdb commit 45effac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/update-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,7 @@ jobs:
working-directory: data/external
- name: Download mytum data
continue-on-error: true # a PR deleting all data will be created if this fails => fail obvious
run: |
PYTHONPATH=$PYTHONPATH:.. python3 scrapers/roomfinder.py
sed -i 's/Bestelmeyer S\u00fcd/Zentralgeb\u00e4ude 2/g' results/buildings_roomfinder.json
sed -i 's/Bestelmeyer Nord/Zentralgeb\u00e4ude 7/g' results/buildings_roomfinder.json
sed -i 's/Bestelmeyer S\u00fcd/Zentralgeb\u00e4ude 2/g' results/maps_roomfinder.json
sed -i 's/Bestelmeyer Nord/Zentralgeb\u00e4ude 7/g' results/maps_roomfinder.json
sed -i 's/Bestelmeyer S\u00fcd/Zentralgeb\u00e4ude 2/g' results/rooms_roomfinder.json
sed -i 's/Bestelmeyer Nord/Zentralgeb\u00e4ude 7/g' results/rooms_roomfinder.json
run: PYTHONPATH=$PYTHONPATH:.. python3 scrapers/roomfinder.py
env:
TQDM_MININTERVAL: 100
working-directory: data/external
Expand Down
6 changes: 6 additions & 0 deletions data/external/scrapers/roomfinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def _sanitise_building(building: dict):
building["lat"], building["lon"] = 48.14903, 11.56735
else:
building["lat"], building["lon"] = _utm_to_latlon(easting, northing, zone_number)
building["b_name"].replace("Bestelmeyer Nord", "Zentralgebäude 7") # TUM changed names in denazification initative
building["b_name"].replace("Bestelmeyer Süd", "Zentralgebäude 2") # TODO: Remove if MyTUM does fix this..


def scrape_buildings() -> None:
Expand Down Expand Up @@ -87,6 +89,8 @@ def _sanitise_room(room: dict) -> dict:
easting=room.pop("utm_easting"),
northing=room.pop("utm_northing"),
)
room["b_name"].replace("Bestelmeyer Nord", "Zentralgebäude 7") # TUM changed names in denazification initative
room["b_name"].replace("Bestelmeyer Süd", "Zentralgebäude 2") # TODO: Remove if MyTUM does fix this..
return room


Expand Down Expand Up @@ -208,6 +212,8 @@ def _download_maps(used_maps):
_download_file(url, filepath)
convert_to_webp(filepath)

_map[2].replace("Bestelmeyer Nord", "Zentralgebäude 7") # TUM changed names in denazification initative
_map[2].replace("Bestelmeyer Süd", "Zentralgebäude 2") # TODO: Remove if MyTUM does fix this..
map_data = {
"scale": _map[0],
"id": _map[1],
Expand Down

0 comments on commit 45effac

Please sign in to comment.