From 21305df9ce756a6e032064ca64a24e3185cd8b81 Mon Sep 17 00:00:00 2001 From: $aTyam Date: Thu, 14 Sep 2023 00:15:30 -0400 Subject: [PATCH] Minor fixes Comments and variable names fixed --- emission/tests/modellingTests/TestGreedySimilarityBinning.py | 4 ++-- emission/tests/modellingTests/modellingTestAssets.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/emission/tests/modellingTests/TestGreedySimilarityBinning.py b/emission/tests/modellingTests/TestGreedySimilarityBinning.py index b96147706..31b3261ae 100644 --- a/emission/tests/modellingTests/TestGreedySimilarityBinning.py +++ b/emission/tests/modellingTests/TestGreedySimilarityBinning.py @@ -113,9 +113,9 @@ def testBinning(self): model = eamtg.GreedySimilarityBinning(model_config) model.fit(trips) #check each bins for no of trips - at_least_one_large_bin = any(map(lambda b: len(b['feature_rows']) == m, model.bins.values())) + one_large_bin = any(map(lambda b: len(b['feature_rows']) == m, model.bins.values())) #Since 5 trips were sampled within the threshold, there should be one bin with 5 trips - self.assertTrue(at_least_one_large_bin, "at least one bin should have at least 5 features in it") + self.assertTrue(one_large_bin, "one bin should have 5 features in it") def testPrediction(self): """ diff --git a/emission/tests/modellingTests/modellingTestAssets.py b/emission/tests/modellingTests/modellingTestAssets.py index 2e2fe8361..252b2ad34 100644 --- a/emission/tests/modellingTests/modellingTestAssets.py +++ b/emission/tests/modellingTests/modellingTestAssets.py @@ -35,7 +35,7 @@ def generate_nearby_random_points(ref_coords,threshold): theta=random.uniform(0,2*math.pi) dx = radius * math.cos(theta) dy = radius * math.sin (theta) - #This basically gives a way to sample a point from within a square of length thresholdInWGS84 + #This basically gives a way to sample a point from within a circle of radius thresholdInWGS84/2 # around the ref. point. return [ref_coords[0] + dy , ref_coords[1] + dx]