Skip to content

Commit

Permalink
Updated TestRunGreedyModel + Debug Cleanup
Browse files Browse the repository at this point in the history
Receive a prediction list of (prediction, n) for each trip in trip_list.

Then for each of the predictions in the prediction list, run the assertion tests.

Also, cleaned up some debug print statements from earlier commits / PRs.
  • Loading branch information
Mahadik, Mukul Chandrakant authored and Mahadik, Mukul Chandrakant committed Nov 17, 2023
1 parent b15a0e0 commit 54a42a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 0 additions & 2 deletions emission/storage/timeseries/builtin_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,8 +461,6 @@ def find_entries_count(self, key_list = None, time_query = None, geo_query = Non
For key_list = None or empty, total count of all documents are returned considering the matching entries from entire dataset.
"""
print("builtin_timeseries.find_entries_count() called")

orig_tsdb = self.timeseries_db
analysis_tsdb = self.analysis_timeseries_db

Expand Down
10 changes: 5 additions & 5 deletions emission/tests/modellingTests/TestRunGreedyModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ def test1RoundTripGreedySimilarityBinning(self):
origin=self.origin,
destination=self.destination
)
prediction, n = eamur.predict_labels_with_n(

predictions_list = eamur.predict_labels_with_n(
user_id = self.user_id,
trip_list = [test],
model_type=eamumt.ModelType.GREEDY_SIMILARITY_BINNING,
model_storage=eamums.ModelStorage.DOCUMENT_DATABASE,
model_config=greedy_model_config
)

[logging.debug(p) for p in sorted(prediction, key=lambda r: r['p'], reverse=True)]

self.assertNotEqual(len(prediction), 0, "should have a prediction")

for prediction, n in predictions_list:
[logging.debug(p) for p in sorted(prediction, key=lambda r: r['p'], reverse=True)]
self.assertNotEqual(len(prediction), 0, "should have a prediction")
1 change: 0 additions & 1 deletion emission/tests/storageTests/TestSectionQueries.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def testCleaned2InferredSectionList(self):
# Total = 25 = 10 (UUID1) + 15 (UUID2)
curr_predicted_entries = esds.cleaned2inferred_section_list(section_user_list)
self.assertEqual(len(curr_predicted_entries), len(sections_entries))
print(curr_predicted_entries)

# Testcase 2: Null user_id value is passed
curr_predicted_entries = esds.cleaned2inferred_section_list([{'section' : section_id, 'user_id' : ''}])
Expand Down

0 comments on commit 54a42a8

Please sign in to comment.