Import velofy.config as pkg_config everywhere
This commit is contained in:
parent
de5e49b497
commit
cf2534f41e
3 changed files with 113 additions and 103 deletions
|
|
@ -6,7 +6,7 @@ import pandas as pd
|
|||
import pytest
|
||||
|
||||
from tests import config as test_config
|
||||
from velofy import config
|
||||
from velofy import config as pkg_config
|
||||
from velofy.forecasts import timify
|
||||
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ def vertical_datetime_index():
|
|||
gen = (
|
||||
start_at
|
||||
for start_at in start_ats
|
||||
if config.SERVICE_START <= start_at.hour < config.SERVICE_END
|
||||
if pkg_config.SERVICE_START <= start_at.hour < pkg_config.SERVICE_END
|
||||
)
|
||||
|
||||
index = pd.Index(gen)
|
||||
|
|
@ -113,7 +113,7 @@ def order_totals(good_pixel_id):
|
|||
(pixel_id, start_at)
|
||||
for pixel_id in pixel_ids
|
||||
for start_at in start_ats
|
||||
if config.SERVICE_START <= start_at.hour < config.SERVICE_END
|
||||
if pkg_config.SERVICE_START <= start_at.hour < pkg_config.SERVICE_END
|
||||
)
|
||||
|
||||
# Re-index `data` filling in `0`s where there is no demand.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import pandas as pd
|
|||
import pytest
|
||||
|
||||
from tests import config as test_config
|
||||
from velofy import config
|
||||
from velofy import config as pkg_config
|
||||
from velofy.forecasts.methods import arima
|
||||
from velofy.forecasts.methods import ets
|
||||
from velofy.forecasts.methods import extrapolate_season
|
||||
|
|
@ -24,14 +24,14 @@ def forecast_interval():
|
|||
future_day.year,
|
||||
future_day.month,
|
||||
future_day.day,
|
||||
config.SERVICE_START,
|
||||
pkg_config.SERVICE_START,
|
||||
0,
|
||||
)
|
||||
end_of_day = dt.datetime(
|
||||
future_day.year,
|
||||
future_day.month,
|
||||
future_day.day,
|
||||
config.SERVICE_END,
|
||||
pkg_config.SERVICE_END,
|
||||
0,
|
||||
)
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ def forecast_interval():
|
|||
gen = (
|
||||
start_at
|
||||
for start_at in start_ats
|
||||
if config.SERVICE_START <= start_at.hour < config.SERVICE_END
|
||||
if pkg_config.SERVICE_START <= start_at.hour < pkg_config.SERVICE_END
|
||||
)
|
||||
|
||||
index = pd.Index(gen)
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import pandas as pd
|
|||
import pytest
|
||||
|
||||
from tests import config as test_config
|
||||
from velofy import config
|
||||
from velofy import config as pkg_config
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
|
@ -221,7 +221,7 @@ class TestMakeVerticalTimeSeries:
|
|||
|
||||
n_daily_time_steps = (
|
||||
60
|
||||
* (config.SERVICE_END - config.SERVICE_START)
|
||||
* (pkg_config.SERVICE_END - pkg_config.SERVICE_START)
|
||||
// test_config.LONG_TIME_STEP
|
||||
)
|
||||
|
||||
|
|
@ -247,7 +247,7 @@ class TestMakeVerticalTimeSeries:
|
|||
|
||||
n_daily_time_steps = (
|
||||
60
|
||||
* (config.SERVICE_END - config.SERVICE_START)
|
||||
* (pkg_config.SERVICE_END - pkg_config.SERVICE_START)
|
||||
// test_config.LONG_TIME_STEP
|
||||
)
|
||||
|
||||
|
|
@ -345,7 +345,7 @@ class TestMakeRealTimeTimeSeries:
|
|||
good_predict_at.year,
|
||||
good_predict_at.month,
|
||||
good_predict_at.day,
|
||||
config.SERVICE_START,
|
||||
pkg_config.SERVICE_START,
|
||||
0,
|
||||
)
|
||||
result = order_history.make_realtime_ts(
|
||||
|
|
@ -358,7 +358,7 @@ class TestMakeRealTimeTimeSeries:
|
|||
|
||||
n_daily_time_steps = (
|
||||
60
|
||||
* (config.SERVICE_END - config.SERVICE_START)
|
||||
* (pkg_config.SERVICE_END - pkg_config.SERVICE_START)
|
||||
// test_config.LONG_TIME_STEP
|
||||
)
|
||||
|
||||
|
|
@ -395,11 +395,13 @@ class TestMakeRealTimeTimeSeries:
|
|||
|
||||
n_daily_time_steps = (
|
||||
60
|
||||
* (config.SERVICE_END - config.SERVICE_START)
|
||||
* (pkg_config.SERVICE_END - pkg_config.SERVICE_START)
|
||||
// test_config.LONG_TIME_STEP
|
||||
)
|
||||
n_time_steps_before = (
|
||||
60 * (test_config.NOON - config.SERVICE_START) // test_config.LONG_TIME_STEP
|
||||
60
|
||||
* (test_config.NOON - pkg_config.SERVICE_START)
|
||||
// test_config.LONG_TIME_STEP
|
||||
)
|
||||
|
||||
assert (
|
||||
|
|
@ -427,7 +429,7 @@ class TestMakeRealTimeTimeSeries:
|
|||
|
||||
n_daily_time_steps = (
|
||||
60
|
||||
* (config.SERVICE_END - config.SERVICE_START)
|
||||
* (pkg_config.SERVICE_END - pkg_config.SERVICE_START)
|
||||
// test_config.LONG_TIME_STEP
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue