mirror of
https://github.com/velocitatem/PHANTOM.git
synced 2026-05-31 16:43:36 +00:00
chore: simple surge pricer
This commit is contained in:
@@ -79,7 +79,7 @@ def get_price(mode: Literal['hotel', 'airline'], productId: str, sessionId: Opti
|
||||
elasticity=None
|
||||
)
|
||||
|
||||
optimal_price = float(product_price_row['predicted_price'].iloc[0])
|
||||
optimal_price = float(product_price_row['optimal_price'].iloc[0]) # TODO: use optimal_price everywhere as aresult
|
||||
|
||||
# get elasticity if available
|
||||
product_elasticity = None
|
||||
|
||||
@@ -12,4 +12,5 @@ graphviz
|
||||
python-dotenv>=1.0.0
|
||||
requests>=2.31.0
|
||||
typing-extensions>=4.8.0
|
||||
pickle5>=0.0.11; python_version < '3.8'
|
||||
pypickle
|
||||
pymc
|
||||
|
||||
@@ -292,12 +292,7 @@ async def get_products(
|
||||
# filter by exact date_index if provided
|
||||
# dateIndex from frontend is days from today, convert to days since epoch
|
||||
if dateIndex is not None:
|
||||
from datetime import datetime
|
||||
epoch = datetime(1970, 1, 1)
|
||||
today = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
today_index = int((today - epoch).total_seconds() / 86400)
|
||||
actual_date_index = today_index + dateIndex
|
||||
query = query.eq('date_index', actual_date_index)
|
||||
query = query.eq('date_index', dateIndex)
|
||||
|
||||
response = query.execute()
|
||||
results = response.data
|
||||
|
||||
Reference in New Issue
Block a user