Replace darglint with pydoclint

This commit is contained in:
Alexander Hess 2026-11-28 04:06:53 +01:00
commit 4a81403f15
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
15 changed files with 74 additions and 33 deletions

View file

@ -107,7 +107,7 @@ def make_config(env: str = "production") -> Config:
Raises:
ValueError: if `env` is not as specified
""" # noqa:DAR203
"""
config: Config # otherwise mypy is confused
if env.strip().lower() == "production":

View file

@ -24,7 +24,7 @@ from velofy.forecasts import timify
@click.argument("time_step", default=60, type=int)
@click.argument("train_horizon", default=8, type=int)
@decorators.db_revision("8bfb928a31f8")
def tactical_heuristic( # noqa:C901
def tactical_heuristic( # noqa:C901,DOC001
city: str,
side_length: int,
time_step: int,

View file

@ -136,7 +136,7 @@ class Address(meta.Base):
Returns:
self: enabling method chaining
""" # noqa:D402,DAR203
""" # noqa:D402
self.city.clear_map()
return self

View file

@ -101,7 +101,7 @@ class City(meta.Base):
Returns:
self: enabling method chaining
""" # noqa:DAR203 note:d334120e
""" # note:d334120e
self._map = folium.Map(
location=[self.center_latitude, self.center_longitude],
zoom_start=self.initial_zoom,

View file

@ -31,7 +31,7 @@ class Customer(meta.Base):
Returns:
self: enabling method chaining
""" # noqa:D402,DAR203
""" # noqa:D402
self.orders[0].pickup_address.city.clear_map()
return self

View file

@ -116,7 +116,7 @@ class Grid(meta.Base):
Returns:
self: enabling method chaining
""" # noqa:D402,DAR203
""" # noqa:D402
self.city.clear_map()
return self

View file

@ -132,7 +132,7 @@ class Pixel(meta.Base):
Returns:
self: enabling method chaining
""" # noqa:D402,DAR203
""" # noqa:D402
self.grid.city.clear_map()
return self

View file

@ -65,7 +65,7 @@ class Restaurant(meta.Base):
Returns:
self: enabling method chaining
""" # noqa:D402,DAR203
""" # noqa:D402
self.address.city.clear_map()
return self

View file

@ -46,6 +46,9 @@ class Location:
Convention is {ZONE} {EASTING} {NORTHING}.
Returns:
text representation in the UTM system
Example:
>>> Location(43.6532, -79.3832)
<Location: 17T 630378 4834625>

View file

@ -52,7 +52,7 @@ class ForecastingModelABC(abc.ABC):
actuals, predictions, and possibly 80%/95% confidence intervals;
includes a row for the time step starting at `predict_at` and
may contain further rows for other time steps on the same day
""" # noqa:DAR202
"""
def make_forecast(
self,
@ -78,7 +78,8 @@ class ForecastingModelABC(abc.ABC):
actual, prediction, and possibly 80%/95% confidence intervals
for the time step starting at `predict_at`
# noqa:DAR401 RuntimeError
Raises:
RuntimeError: `*Model.predict()` misses the prediction for `predict_at`
"""
if (
cached_forecast := db.session.query(db.Forecast)

View file

@ -40,7 +40,8 @@ class HorizontalETSModel(base.ForecastingModelABC):
confidence intervals (i.e, the four "low/high/80/95" columns);
contains one row for the `predict_at` time step
# noqa:DAR401 RuntimeError
Raises:
RuntimeError: an internal consistency check fails
"""
# Generate the historic (and horizontal) order time series.
training_ts, frequency, actuals_ts = self._order_history.make_horizontal_ts(
@ -96,7 +97,8 @@ class HorizontalSMAModel(base.ForecastingModelABC):
this model does not support confidence intervals;
contains one row for the `predict_at` time step
# noqa:DAR401 RuntimeError
Raises:
RuntimeError: an internal consistency check fails
"""
# Generate the historic (and horizontal) order time series.
training_ts, frequency, actuals_ts = self._order_history.make_horizontal_ts(

View file

@ -40,7 +40,8 @@ class TrivialModel(base.ForecastingModelABC):
this model does not support confidence intervals;
contains one row for the `predict_at` time step
# noqa:DAR401 RuntimeError
Raises:
RuntimeError: an internal consistency check fails
"""
# Generate the historic order time series mainly to check if a valid
# `training_ts` exists (i.e., the demand history is long enough).

View file

@ -42,7 +42,8 @@ class RealtimeARIMAModel(base.ForecastingModelABC):
confidence intervals (i.e, the four "low/high/80/95" columns);
contains one row for the `predict_at` time step
# noqa:DAR401 RuntimeError
Raises:
RuntimeError: an internal consistency check fails
"""
# Generate the historic (and real-time) order time series.
training_ts, frequency, actuals_ts = self._order_history.make_realtime_ts(

View file

@ -42,7 +42,8 @@ class VerticalARIMAModel(base.ForecastingModelABC):
confidence intervals (i.e, the four "low/high/80/95" columns);
contains several rows, including one for the `predict_at` time step
# noqa:DAR401 RuntimeError
Raises:
RuntimeError: an internal consistency check fails
"""
# Generate the historic (and vertical) order time series.
training_ts, frequency, actuals_ts = self._order_history.make_vertical_ts(

View file

@ -27,7 +27,8 @@ class OrderHistory:
grid: pixel grid used to aggregate orders spatially
time_step: interval length (in minutes) into which orders are aggregated
# noqa:DAR401 RuntimeError
Raises:
RuntimeError: the configuration has invalid `TIME_STEPS`
"""
self._grid = grid
self._time_step = time_step
@ -183,8 +184,7 @@ class OrderHistory:
Raises:
LookupError: `pixel_id` not in `grid`
# noqa:DAR401 RuntimeError
RuntimeError: no orders in the pixel
"""
try:
intra_pixel = self.totals.loc[pixel_id]
@ -217,8 +217,7 @@ class OrderHistory:
Raises:
LookupError: `pixel_id` not in `grid`
# noqa:DAR401 RuntimeError
RuntimeError: no orders in the pixel
"""
try:
intra_pixel = self.totals.loc[pixel_id]
@ -565,7 +564,8 @@ class OrderHistory:
Returns:
most promising forecasting `*Model`
# noqa:DAR401 RuntimeError
Raises:
RuntimeError: no rule for the average daily demand and training horizon
"""
add = self.avg_daily_demand(
pixel_id=pixel_id,