Skip to content

Commit

Permalink
Handle missing location
Browse files Browse the repository at this point in the history
  • Loading branch information
ianfab committed Jan 21, 2024
1 parent 7e31597 commit 355e869
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions _data/tournaments.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ start-date end-date variant location tournament source
2024-01-27 2024-01-27 Xiangqi Eltinger Rathaus, Leonberg Gründungssitzung DXB <a href='http://chinaschach.de/blog/event/gruendungssitzung-dxb/'>chinaschach.de</a>
2024-01-27 2024-01-29 Xiangqi Eltinger Rathaus, Leonberg Xiangqi-Turnier um den Engelbergpokal und Xiangqi Open <a href='http://chinaschach.de/blog/event/xiangqi-turnier-um-den-engelbergpokal-und-xiangqi-open/'>chinaschach.de</a>
2024-02-24 2024-02-24 Shogi Berlin-Mitte, Germany 9th Mori Ogai Tournament Berlin <a href='http://fesashogi.eu/index.php?mid=2'>fesashogi.eu</a>
2024-03-02 2024-03-02 Xiangqi Barsbüttel Xiangqi-Turnier Barsbüttel <a href='http://chinaschach.de/blog/event/xiangqi-turnier-barsbuettel/'>chinaschach.de</a>
2024-03-16 2024-03-17 Shogi London Mindsports Centre, 21 Dalling Rd, JD, Great Britain 2024 London Spring Shogi Tournament <a href='http://fesashogi.eu/index.php?mid=2'>fesashogi.eu</a>
2024-03-23 2024-03-24 Xiangqi Xiangqi-Turnier Berlin <a href='http://chinaschach.de/blog/event/xiangqi-turnier-berlin/'>chinaschach.de</a>
2024-04-13 2024-04-13 Shogi BoardGames Ruse, Ruse, Bulgaria Ruse Shogi Open 2024 <a href='http://fesashogi.eu/index.php?mid=2'>fesashogi.eu</a>
2024-04-27 2024-04-27 Shogi Essen, Nordrhein-Westfalen, Germany EMO Shogi Open 2024 <a href='http://fesashogi.eu/index.php?mid=2'>fesashogi.eu</a>
2024-05-04 2024-05-05 Shogi Casa dei Giochi, Milan, Italy XX Italian Shogi Championship <a href='http://fesashogi.eu/index.php?mid=2'>fesashogi.eu</a>
Expand Down
2 changes: 1 addition & 1 deletion _scripts/update_tournaments.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def prettify_location(locations):
# strip zip code from city
locations.replace(to_replace=r'\d{4,6}|\d+\-\d+', value=r'', regex=True, inplace=True)
# clean up by removing redundance and consolidating whitespacing
return locations.apply(lambda x: ", ".join(dict.fromkeys(s.strip() for s in x.split(',') if s.strip())))
return locations.apply(lambda x: ", ".join(dict.fromkeys(s.strip() for s in (x or '').split(',') if s.strip())))


if __name__ == '__main__':
Expand Down

0 comments on commit 355e869

Please sign in to comment.