Want to set it up so that we can make other classes for new data sets (e.g. ESPNstrategy). See example below.
move the data loading out of prepare() and into its own function, so other classes can call it without having to instantiate
oops, we're solving the same problem twice: this could still be abstract if we do this... (abstract in the abstract sense...)
Pandas: use pandas instead of EMprops so that we can do things like only keep the raw data and have helpers to calculate rank, percentile, distributions, etc. on the fly
refactor _percentile_to_rank() etc helpers in specific strategies and move them to more general helpers that any class can use
Example: Want to do things like this:
class Doubletime(IStrategy):
"""
"""
@property
def name(self) -> str:
return "Doubletime"
def prepare(self, teams: dict[str, Team]) -> None:
# without pandas refactor, we want to be able to do this
self.em_props = EvanMiyaStrategy.load_data(teams)
self.espn_props = ESPNStrategy.load_data(teams)
# if we refactor to pandas, it will be more like this
self.data = pd.join(
EvanMiyaStrategy.load_data(teams),
ESPNStrategy.load_data(teams),
by = "team"
)
IEvanMiya
becomesEvanMiya
aka not abstract classEvanMiya
basically becomesVanillaMiya
ESPNstrategy
). See example below.prepare()
and into its own function, so other classes can call it without having to instantiate_percentile_to_rank()
etc helpers in specific strategies and move them to more general helpers that any class can useExample: Want to do things like this: