Skip to content
Snippets Groups Projects
Commit 6bd5da3b authored by “Daniel Griffiths”'s avatar “Daniel Griffiths”
Browse files

fix: black lint reformat hybrid layer

parent 422f5f77
No related branches found
No related tags found
No related merge requests found
...@@ -36,7 +36,9 @@ class HybridRouteLayer: ...@@ -36,7 +36,9 @@ class HybridRouteLayer:
else: else:
self.score_threshold = 0.82 self.score_threshold = 0.82
# if routes list has been passed, we initialize index now # if routes list has been passed, we initialize index now
if isinstance(self.sparse_encoder, TfidfEncoder) and hasattr(self.sparse_encoder, 'fit'): if isinstance(self.sparse_encoder, TfidfEncoder) and hasattr(
self.sparse_encoder, "fit"
):
self.sparse_encoder.fit(routes) self.sparse_encoder.fit(routes)
if routes: if routes:
# initialize index now # initialize index now
...@@ -54,7 +56,9 @@ class HybridRouteLayer: ...@@ -54,7 +56,9 @@ class HybridRouteLayer:
return None return None
def add(self, route: Route): def add(self, route: Route):
if isinstance(self.sparse_encoder, TfidfEncoder) and hasattr(self.sparse_encoder, 'fit'): if isinstance(self.sparse_encoder, TfidfEncoder) and hasattr(
self.sparse_encoder, "fit"
):
self.sparse_encoder.fit(self.routes + [route]) self.sparse_encoder.fit(self.routes + [route])
self.sparse_index = None self.sparse_index = None
for r in self.routes: for r in self.routes:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment