Rename Forecast.training_horizon into .train_horizon

- we use that shorter name in `urban_meal_delivery.forecasts.*`
  and want to be consistent in the ORM layer as well
This commit is contained in:
Alexander Hess 2021-02-02 13:04:43 +01:00
commit 3f5b4a50bb
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
5 changed files with 63 additions and 15 deletions

View file

@ -28,7 +28,7 @@ def forecast(pixel):
pixel=pixel,
start_at=start_at,
time_step=test_config.LONG_TIME_STEP,
training_horizon=test_config.LONG_TRAIN_HORIZON,
train_horizon=test_config.LONG_TRAIN_HORIZON,
model=MODEL,
actual=12,
prediction=12.3,
@ -143,9 +143,9 @@ class TestConstraints:
db_session.commit()
@pytest.mark.parametrize('value', [-1, 0])
def test_positive_training_horizon(self, db_session, forecast, value):
def test_positive_train_horizon(self, db_session, forecast, value):
"""Insert an instance with invalid data."""
forecast.training_horizon = value
forecast.train_horizon = value
db_session.add(forecast)
with pytest.raises(
@ -418,7 +418,7 @@ class TestConstraints:
pixel=forecast.pixel,
start_at=forecast.start_at,
time_step=forecast.time_step,
training_horizon=forecast.training_horizon,
train_horizon=forecast.train_horizon,
model=forecast.model,
actual=forecast.actual,
prediction=2,
@ -479,7 +479,7 @@ class TestFromDataFrameConstructor:
forecasts = db.Forecast.from_dataframe(
pixel=pixel,
time_step=test_config.LONG_TIME_STEP,
training_horizon=test_config.LONG_TRAIN_HORIZON,
train_horizon=test_config.LONG_TRAIN_HORIZON,
model=MODEL,
data=prediction_data,
)
@ -496,7 +496,7 @@ class TestFromDataFrameConstructor:
forecasts = db.Forecast.from_dataframe(
pixel=pixel,
time_step=test_config.LONG_TIME_STEP,
training_horizon=test_config.LONG_TRAIN_HORIZON,
train_horizon=test_config.LONG_TRAIN_HORIZON,
model=MODEL,
data=prediction_data,
)