Skip to content

Commit

Permalink
Update TestForestModelIntegration.py
Browse files Browse the repository at this point in the history
2 more ( total 4) Forest model specific features are now added after generating random trips for testing purpose.
  • Loading branch information
humbleOldSage committed Mar 22, 2024
1 parent 35a1346 commit 19bb394
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions emission/tests/modellingTests/TestForestModelIntegration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import emission.tests.common as etc
import emission.pipeline.intake_stage as epi
import logging
from bson.objectid import ObjectId

import emission.analysis.modelling.trip_model.config as eamtc

import emission.analysis.modelling.trip_model.run_model as eamur
Expand Down Expand Up @@ -54,11 +56,12 @@ def setUp(self):
threshold=0.004, # ~400m
has_label_p=0.9
)

## Required for Forest model inference
for result_entry in train:
result_entry['data']['start_local_dt']=result_entry['metadata']['write_local_dt']
result_entry['data']['end_local_dt']=result_entry['metadata']['write_local_dt']

result_entry['data']['start_place']=ObjectId()
result_entry['data']['end_place']=ObjectId()
ts.bulk_insert(train)
# confirm data write did not fail
check_data = esda.get_entries(key="analysis/confirmed_trip", user_id=self.testUUID, time_query=None)
Expand Down

0 comments on commit 19bb394

Please sign in to comment.