This commit is contained in:
parent
0e5ba991db
commit
3199a3259f
@ -296,12 +296,16 @@ class PricingService:
|
||||
def apply_pricing_algo(self, row: pd.Series, pricing_algo: callable = None) -> pd.Series:
|
||||
"""Modified to handle the pricing algorithm as an instance method"""
|
||||
if pricing_algo:
|
||||
logger.debug(f"Using custom pricing algorithm: {pricing_algo.__name__}")
|
||||
return pricing_algo(row)
|
||||
elif ACTIVE_PRICING_ALGORITHIM == 'default_pricing_algo':
|
||||
logger.debug(f"Using default pricing algorithm: {self.default_pricing_algo.__name__}")
|
||||
pricing_algo = self.default_pricing_algo
|
||||
elif ACTIVE_PRICING_ALGORITHIM == 'tcgplayer_recommended_algo':
|
||||
logger.debug(f"Using TCGPlayer recommended algorithm: {self.tcgplayer_recommended_algo.__name__}")
|
||||
pricing_algo = self.tcgplayer_recommended_algo
|
||||
else:
|
||||
logger.debug(f"Using default pricing algorithm: {self.default_pricing_algo.__name__}")
|
||||
pricing_algo = self.default_pricing_algo
|
||||
|
||||
return pricing_algo(row)
|
||||
@ -345,6 +349,8 @@ class PricingService:
|
||||
|
||||
# Apply price columns
|
||||
df = df.apply(lambda row: self.apply_price_to_df_columns(row, price_lookup), axis=1)
|
||||
|
||||
logger.debug(f"Applying pricing algorithm: {ACTIVE_PRICING_ALGORITHIM}")
|
||||
|
||||
# Apply pricing algorithm
|
||||
df = df.apply(self.apply_pricing_algo, axis=1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user