Skip to content

Commit

Permalink
The call to extra transformers was somehow dropped, added it back. Te…
Browse files Browse the repository at this point in the history
…sts now work.
  • Loading branch information
hsl-petrhaj committed Nov 29, 2024
1 parent 9814acc commit 3f23b49
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Scripts/tests/integration/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_models(self):
self._validate_impedances(impedance["iht"])

# Check that model result does not change
self.assertAlmostEquals(model.mode_share[0]["car"], 0.2115956440248976)
self.assertAlmostEquals(model.mode_share[0]["car"], 0.1757067922429178)

print("Model system test done")

Expand Down
1 change: 1 addition & 0 deletions Scripts/tests/unit/test_logit.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Purpose:
},
"bike": {
"dist": mtx,
"time": mtx,
},
"walk": {
"dist": mtx,
Expand Down
7 changes: 7 additions & 0 deletions Scripts/transform/impedance_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,13 @@ def transform(self, purpose, impedance):
for i in range(1, len(purpose.sub_bounds)):
trips_per_month[purpose.sub_bounds[i], :] = trips_month[i]
day_imp["transit"]["cost"] /= trips_per_month

# Process possible extra transformers (eg. P&R impedance)
for transformer in self._extra_transformers:
extra_results = transformer.transform(purpose, impedance)
for result_name, result in extra_results.items():
day_imp[result_name] = result

# Add parking time to car matrices
if parking_time is not None:
ptime = parking_time(purpose.zone_data).to_numpy()[cols]
Expand Down

0 comments on commit 3f23b49

Please sign in to comment.