diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d6ea0a6..d762fde4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ **Under development** +- fix: fixed special case in repairing ENTD for completely overlapping trips - feat: make it possible to disable the test run of MATSim before writing everything out - feat: check availability of open data sources for every PR - feat: make statistical matching attribute list configurable diff --git a/data/hts/hts.py b/data/hts/hts.py index d8c26dd2..86bc0365 100644 --- a/data/hts/hts.py +++ b/data/hts/hts.py @@ -89,12 +89,13 @@ def fix_trip_times(df_trips): print(" of which we're able to shorten %d to make it consistent" % np.count_nonzero(f)) df_main.loc[f, "arrival_time"] = df_next["departure_time"] - # Included trips + # Included trips (moving the first one to the start of the following trip and setting duration to zero) f = ~df_main["is_last_trip"] f &= df_main["departure_time"] >= df_next["departure_time"] f &= df_main["arrival_time"] <= df_next["arrival_time"] + df_main.loc[f, "departure_time"] = df_next["departure_time"] + df_main.loc[f, "arrival_time"] = df_next["departure_time"] print("Found %d occurences where current trip is included in next trip" % np.count_nonzero(f)) - df_main = df_main[~f] return df_main