diff --git a/pyproject.toml b/pyproject.toml index c947ffc..45a9ef2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -203,8 +203,6 @@ select = [ "T100", # flake8-docstrings => PEP257 compliance "D1", "D2", "D3", "D4", - # flake8-rst-docstrings => valid rst in docstrings - "RST2", "RST3", "RST4", # flake8-string-format => unify usage of str.format() "P1", "P2", "P3", # flake8-quotes => use double quotes everywhere (complying with black) @@ -236,10 +234,6 @@ extend-ignore = [ "E203", "W503", # Let's not do `@pytest.mark.no_cover()` instead of `@pytest.mark.no_cover`. "PT023", - # Google's Python Style Guide is not reStructuredText - # until after being processed by Sphinx Napoleon. - # Source: https://github.com/peterjc/flake8-rst-docstrings/issues/17 - "RST201", "RST203", "RST210", "RST213", "RST301", ] per-file-ignores = [ diff --git a/src/velofy/console/forecasts.py b/src/velofy/console/forecasts.py index 0317ba9..a52470e 100644 --- a/src/velofy/console/forecasts.py +++ b/src/velofy/console/forecasts.py @@ -64,7 +64,7 @@ def tactical_heuristic( # noqa:C901 TIME_STEP: length of one time step in minutes; defaults to `60` TRAIN_HORIZON: length of the training horizon; defaults to `8` - """ # noqa:D412,D417,RST215 + """ # noqa:D412,D417 # Input validation. try: diff --git a/src/velofy/db/forecasts.py b/src/velofy/db/forecasts.py index 5eeb500..b9cf193 100644 --- a/src/velofy/db/forecasts.py +++ b/src/velofy/db/forecasts.py @@ -182,7 +182,7 @@ class Forecast(meta.Base): Returns: forecasts: the `data` as `Forecast` objects - """ # noqa:RST215 + """ forecasts = [] for timestamp_idx in data.index: diff --git a/src/velofy/forecasts/models/__init__.py b/src/velofy/forecasts/models/__init__.py index 5395e1d..17b16b2 100644 --- a/src/velofy/forecasts/models/__init__.py +++ b/src/velofy/forecasts/models/__init__.py @@ -27,7 +27,7 @@ predictive routing strategy employed by the UDP. A future `planning` sub-package will contain the `*Model`s used to plan the `Courier`'s shifts a week ahead. -""" # noqa:RST215 +""" from velofy.forecasts.models.base import ForecastingModelABC from velofy.forecasts.models.tactical.horizontal import HorizontalETSModel diff --git a/src/velofy/forecasts/models/tactical/__init__.py b/src/velofy/forecasts/models/tactical/__init__.py index f71038c..1652a4d 100644 --- a/src/velofy/forecasts/models/tactical/__init__.py +++ b/src/velofy/forecasts/models/tactical/__init__.py @@ -13,4 +13,4 @@ Urban Delivery Platform". For the paper check: https://code.webartifex.de/alexander/velofy-forecasting/src/branch/main/paper.pdf https://www.sciencedirect.com/science/article/pii/S1366554520307936 -""" # noqa:RST215 +""" diff --git a/src/velofy/forecasts/models/tactical/horizontal.py b/src/velofy/forecasts/models/tactical/horizontal.py index 5b7b35c..a0708d3 100644 --- a/src/velofy/forecasts/models/tactical/horizontal.py +++ b/src/velofy/forecasts/models/tactical/horizontal.py @@ -5,7 +5,7 @@ corresponding to the same time of day as the one to be predicted (i.e., the one starting at `predict_at`). Then, they make a prediction for only one day into the future. Thus, the training time series have a `frequency` of `7`, the number of days in a week. -""" # noqa:RST215 +""" import datetime as dt diff --git a/src/velofy/forecasts/models/tactical/other.py b/src/velofy/forecasts/models/tactical/other.py index d9c9901..086b976 100644 --- a/src/velofy/forecasts/models/tactical/other.py +++ b/src/velofy/forecasts/models/tactical/other.py @@ -2,7 +2,7 @@ ... that cannot be classified into either "horizontal", "vertical", or "real-time". -""" # noqa:RST215 +""" import datetime as dt diff --git a/src/velofy/forecasts/models/tactical/realtime.py b/src/velofy/forecasts/models/tactical/realtime.py index 082f7a6..4040f1e 100644 --- a/src/velofy/forecasts/models/tactical/realtime.py +++ b/src/velofy/forecasts/models/tactical/realtime.py @@ -7,7 +7,7 @@ the one starting at `predict_at`). Thus, the training time series have a day. For example, for 60-minute time steps, the `frequency` becomes `7 * 12` (= operating hours from 11 am to 11 pm), which is `84`. Real-time `*Model`s train the forecasting `methods` on a seasonally decomposed time series internally. -""" # noqa:RST215 +""" import datetime as dt diff --git a/src/velofy/forecasts/models/tactical/vertical.py b/src/velofy/forecasts/models/tactical/vertical.py index d6fc70f..82530a5 100644 --- a/src/velofy/forecasts/models/tactical/vertical.py +++ b/src/velofy/forecasts/models/tactical/vertical.py @@ -7,7 +7,7 @@ Thus, the training time series have a `frequency` of the number of weekdays, steps, the `frequency` becomes `7 * 12` (= operating hours from 11 am to 11 pm), which is `84`. Vertical `*Model`s train the forecasting `methods` on a seasonally decomposed time series internally. -""" # noqa:RST215 +""" import datetime as dt diff --git a/src/velofy/forecasts/timify.py b/src/velofy/forecasts/timify.py index 8b858a6..5fa4cf7 100644 --- a/src/velofy/forecasts/timify.py +++ b/src/velofy/forecasts/timify.py @@ -566,7 +566,7 @@ class OrderHistory: most promising forecasting `*Model` # noqa:DAR401 RuntimeError - """ # noqa:RST215 + """ add = self.avg_daily_demand( pixel_id=pixel_id, predict_day=predict_day, diff --git a/tests/forecasts/test_models.py b/tests/forecasts/test_models.py index b3b9300..74784d0 100644 --- a/tests/forecasts/test_models.py +++ b/tests/forecasts/test_models.py @@ -29,7 +29,7 @@ class TestGenericForecastingModelProperties: So, these test cases are more like integration tests conceptually. Also, note that some `methods.*.predict()` functions use R behind the scenes. - """ # noqa:RST215 + """ def test_create_model(self, model_cls, order_history): """Test instantiation of a new and concrete `*Model` object.""" @@ -52,7 +52,7 @@ class TestGenericForecastingModelProperties: Important: this test case has a side effect that is visible across the different parametrized versions of this case! - """ # noqa:RST215 + """ model = model_cls(order_history=order_history) assert model.name not in self.unique_model_names @@ -70,7 +70,7 @@ class TestGenericForecastingModelProperties: """`*Model.predict()` returns a `pd.DataFrame` ... ... with known columns. - """ # noqa:RST215 + """ model = model_cls(order_history=order_history) result = model.predict( @@ -100,7 +100,7 @@ class TestGenericForecastingModelProperties: """`*Model.predict()` returns a row for ... ... the time step starting at `predict_at`. - """ # noqa:RST215 + """ model = model_cls(order_history=order_history) result = model.predict( @@ -122,7 +122,7 @@ class TestGenericForecastingModelProperties: """`*Model.predict()` returns a `pd.DataFrame` ... ... where the "actual" and "prediction" columns must not be empty. - """ # noqa:RST215 + """ model = model_cls(order_history=order_history) result = model.predict( @@ -144,7 +144,7 @@ class TestGenericForecastingModelProperties: pixel, predict_at, ): - """`*Model.make_forecast()` returns a `Forecast` object.""" # noqa:RST215 + """`*Model.make_forecast()` returns a `Forecast` object.""" model = model_cls(order_history=order_history) result = model.make_forecast( @@ -168,7 +168,7 @@ class TestGenericForecastingModelProperties: pixel, predict_at, ): - """`*Model.make_forecast()` caches the `Forecast` object.""" # noqa:RST215 + """`*Model.make_forecast()` caches the `Forecast` object.""" model = model_cls(order_history=order_history) assert db_session.query(db.Forecast).count() == 0 diff --git a/tests/forecasts/timify/test_avg_daily_demand.py b/tests/forecasts/timify/test_avg_daily_demand.py index 86ede7f..b12aa9f 100644 --- a/tests/forecasts/timify/test_avg_daily_demand.py +++ b/tests/forecasts/timify/test_avg_daily_demand.py @@ -150,7 +150,7 @@ class TestChooseTacticalModel: self, order_history, good_pixel_id, - predict_at, # noqa:RST215 + predict_at, ): """For `train_horizon` values not included in the rule-based system ...