Skip to content

Commit

Permalink
ENH: simplify logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bifbof committed Jul 26, 2023
1 parent 278f840 commit e6a2092
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions trackintel/io/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,10 +556,7 @@ def read_tours_csv(*args, columns=None, index_col=None, tz=None, **kwargs):
>>> trackintel.read_tours_csv('data.csv', columns={'uuid':'user_id'})
"""
columns = {} if columns is None else columns
if "converters" not in kwargs:
kwargs["converters"] = {"trips": ast.literal_eval}
elif "trips" not in kwargs["converters"]:
kwargs["converters"]["trips"] = ast.literal_eval
kwargs.setdefault("converters", {}).setdefault("trips", ast.literal_eval)
tours = pd.read_csv(*args, index_col=index_col, **kwargs)
tours.rename(columns=columns, inplace=True)

Expand Down

0 comments on commit e6a2092

Please sign in to comment.