Skip to content

Commit

Permalink
Remove unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffxy committed Nov 15, 2023
1 parent e35ec91 commit e5db081
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
19 changes: 0 additions & 19 deletions src/brad/routing/abstract_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ class AbstractRoutingPolicy:
def name(self) -> str:
raise NotImplementedError

async def run_setup(self, estimator: Optional[Estimator] = None) -> None:
"""
Should be called before using this policy. This is used to set up any
dynamic state.
If this routing policy needs an estimator, one should be provided here.
"""

async def engine_for(
self, query_rep: QueryRep, ctx: RoutingContext
) -> List[Engine]:
Expand Down Expand Up @@ -65,17 +57,6 @@ def __init__(
self.indefinite_policies = indefinite_policies
self.definite_policy = definite_policy

async def run_setup(self, estimator: Optional[Estimator] = None) -> None:
"""
Should be called before using the policy. This is used to set up any
dynamic state.
If this routing policy needs an estimator, one should be provided here.
"""
for policy in self.indefinite_policies:
await policy.run_setup(estimator)
await self.definite_policy.run_setup(estimator)

def __eq__(self, other: object):
if not isinstance(other, FullRoutingPolicy):
return False
Expand Down
6 changes: 1 addition & 5 deletions src/brad/routing/tree_based/forest_policy.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import asyncio
from typing import Optional, List, Dict, Any
from typing import List, Dict, Any

from brad.asset_manager import AssetManager
from brad.config.engine import Engine
from brad.data_stats.estimator import Estimator
from brad.query_rep import QueryRep
from brad.routing.abstract_policy import AbstractRoutingPolicy
from brad.routing.context import RoutingContext
Expand Down Expand Up @@ -47,9 +46,6 @@ def __eq__(self, other: object) -> bool:
return False
return self._policy == other._policy and self._model == other._model

async def run_setup(self, estimator: Optional[Estimator] = None) -> None:
pass

async def engine_for(
self, query_rep: QueryRep, ctx: RoutingContext
) -> List[Engine]:
Expand Down

0 comments on commit e5db081

Please sign in to comment.