753eaf23e4
Merge branch 'unquoted-annotations' into develop
...
CI / Tests (test-types) (push) Successful in 1m45s
CI / Tests (test) (push) Successful in 1m47s
CI / Lint (push) Successful in 1m50s
CI / Tests (test-with-3.15) (push) Successful in 1m51s
Reviewed-on: #23
2026-12-03 13:10:48 +01:00
3b52ee0525
Remove the quotes from the type annotations
...
CI / Tests (test-types) (push) Successful in 1m46s
CI / Tests (test) (push) Successful in 1m47s
CI / Tests (test-with-3.15) (push) Successful in 1m51s
CI / Lint (push) Successful in 2m8s
PEP 649 makes them unnecessary,
and `sqlalchemy` v2.1 resolves the lazy annotations of the models.
2026-12-03 13:04:17 +01:00
ed739ed756
Drop support for Python 3.13
...
Python 3.14 evaluates annotations lazily (PEP 649),
so forward references need no quotes.
We make the tool targets, the lock files,
and the CI matrix follow the new minimum.
In order to use the new features,
we must drop support for Python 3.13
2026-12-03 13:03:11 +01:00
2bfd936087
Merge branch 'lint-cleanups' into develop
...
CI / Tests (test-types) (push) Successful in 2m4s
CI / Tests (test) (push) Successful in 2m8s
CI / Tests (test-with-3.15) (push) Successful in 2m12s
CI / Tests (test-with-3.13) (push) Successful in 2m21s
CI / Lint (push) Successful in 2m25s
Reviewed-on: #22
2026-12-03 12:26:18 +01:00
f9fce093d1
Skip the per-file ignores reformatting in git blame
CI / Tests (test-types) (push) Successful in 2m8s
CI / Tests (test) (push) Successful in 2m11s
CI / Tests (test-with-3.15) (push) Successful in 2m15s
CI / Tests (test-with-3.13) (push) Successful in 2m22s
CI / Lint (push) Successful in 2m39s
2026-12-03 11:48:33 +01:00
47a22f9587
Put the ruff per-file ignores on separate lines
...
Each reason now sits next to its codes,
which reads better than a separate list.
2026-12-03 11:47:32 +01:00
7a000145a7
Lint the notebooks in the lint session
...
Only `ruff` checks them because the formatters would rewrite the cells.
The per-file ignores fit exploratory code that is never rerun.
2026-12-03 11:45:38 +01:00
a06cb5bdfb
Resolve the remaining ruff findings
...
Every change keeps the values the same, so the stored outputs stay valid.
`init_r` keeps its import because only its side effect matters.
2026-12-03 11:33:14 +01:00
f9643642b8
Use isna() and notna()
...
`isnull()` and `notnull()` are mere aliases,
so the stored outputs stay valid.
2026-12-03 11:33:10 +01:00
9c409b619e
Apply the safe ruff fixes
...
The fixes keep every value the same, so the stored outputs stay valid.
For example, `np.NaN` becomes `np.nan`, which `numpy` v2 requires.
2026-12-03 11:33:04 +01:00
50889df241
Skip the comment-only commits in git blame
2026-12-03 11:15:36 +01:00
c18fc2ba59
Refer to sources with "See:" in comments
2026-12-03 11:09:38 +01:00
f90f263dab
Explain the "why" in a few more comments
...
Comments that only repeated the code are removed.
2026-12-03 11:06:36 +01:00
51f68743e5
Reword the comments in the config files
...
Each comment is one sentence or two short ones
joined by "=>", without a final period.
2026-12-03 11:06:17 +01:00
bca4250b4d
Reword the comments in the test suite
...
Each comment is one sentence or two short ones
joined by "=>", without a final period.
2026-12-03 10:52:25 +01:00
0f69709226
Reword the comments in the rest of velofy
...
Each comment is one sentence or two short ones
joined by "=>", without a final period.
2026-12-03 10:46:42 +01:00
9b8fe8b8fd
Reword the comments in velofy.forecasts
...
Each comment is one sentence or two short ones
joined by "=>", without a final period.
2026-12-03 10:43:55 +01:00
1413d08ed9
Reword the comments in velofy.db
...
Each comment is one sentence or two short ones joined by "=>", without a final period.
2026-12-03 10:38:28 +01:00
ff7f705bc8
Put identifiers in comments into backticks
2026-12-03 10:17:12 +01:00
2f1afd459f
Break multi-line comments before conjunctions
2026-12-03 10:13:13 +01:00
049a5f6f62
Remove periods from one-sentence comments
2026-12-03 10:04:43 +01:00
454c2898a0
Remove the F401 ignore for __init__.py files
...
All re-exporting packages declare `__all__`;
so, unused imports are reported there, too.
2026-12-03 09:48:27 +01:00
732a74be1c
Declare __all__ in all re-exporting packages
...
Then, the linters know the imports are re-exports and not unused.
2026-12-03 09:44:07 +01:00
e5c7487515
Merge branch 'ci-and-infra' into develop
...
CI / Tests (test-types) (push) Successful in 2m0s
CI / Tests (test) (push) Successful in 2m2s
CI / Tests (test-with-3.15) (push) Successful in 2m4s
CI / Tests (test-with-3.13) (push) Successful in 2m16s
CI / Lint (push) Successful in 2m16s
Reviewed-on: #21
2026-12-03 01:25:32 +01:00
8b5e66d70b
Install only nox and pre-commit in CI
...
CI / Tests (test-types) (push) Successful in 2m3s
CI / Tests (test) (push) Successful in 2m6s
CI / Tests (test-with-3.15) (push) Successful in 2m10s
CI / Lint (push) Successful in 2m20s
CI / Tests (test-with-3.13) (push) Successful in 2m21s
The `nox` sessions install `velofy` and its dependencies themselves;
so, a full `uv sync` only duplicated that work.
2026-12-03 01:12:31 +01:00
53746966ac
Cache uv between CI runs
...
All jobs restore built wheels (e.g., `rpy2`) and the Python versions
instead of building or fetching them again.
Only the "lint" job saves the cache, pruned to what is expensive to rebuild,
and only when its key changed; so, five jobs do not compress the same archive
in parallel, and unchanged runs skip the 15s of packing.
2026-12-03 01:12:30 +01:00
e1cdac4cfa
Run the CI checks in parallel jobs
...
The test sessions run as a matrix, each with its own database.
This also adds the "test-with" sessions to CI;
so, the setup installs all `SUPPORTED_PYTHONS` via `uv`,
as `nox` would otherwise pick the system Python 3.13,
which lacks the headers to build `rpy2`.
2026-12-03 01:12:29 +01:00
49276bb9cf
Pull the CI setup into a composite action
...
The upcoming parallel jobs share it.
2026-12-03 01:12:28 +01:00
cc45b78e5d
Rename the CI job and add a timeout
...
The version in the name broke the required status check
when 3.14 became the `MAIN_PYTHON`.
The timeout ensures the CI server stays ready
even when something goes badly wrong.
2026-12-03 01:12:28 +01:00
9be63c3fef
Merge branch 'python-3.14' into develop
...
CI / Checks (Python 3.14) (push) Successful in 2m43s
Reviewed-on: #20
2026-12-02 22:30:07 +01:00
2a64958a93
Make Python 3.14 the MAIN_VERSION
...
CI / Checks (Python 3.14) (push) Successful in 2m46s
`requires-python` stays at ">=3.13"; so, `uv.lock` is unchanged
and 3.13 is tested with the "test-with" session.
2026-12-02 21:54:16 +01:00
df53ce7bc4
Pin MAIN_PYTHON in the "init-project" session
...
Otherwise, `uv` creates ".venv" with the newest installed Python.
2026-12-02 21:49:17 +01:00
67917ae3f6
Type check against the oldest Python version
...
Without a configured version, `mypy` and `pyright`
check against the Python that runs them.
With `MAIN_PYTHON` at 3.14, they would accept
`stdlib` APIs and `typing` features new in 3.14.
Yet, `requires-python` promises 3.13;
so, the type checkers must flag such code.
`black` and `ruff` already target 3.13 for the same reason.
2026-12-02 21:42:06 +01:00
b947337bd1
Remove flake8-return
...
It crashes on Python 3.14 (`ast.NameConstant` is gone) and is unmaintained.
`ruff` covers its rules.
2026-12-02 21:39:21 +01:00
80d2573f0d
Remove flake8-pie
...
It crashes on Python 3.14 (`ast.Str` is gone) and is unmaintained.
`ruff` covers its rules.
2026-12-02 21:27:27 +01:00
5609e8ec6e
Test with Python 3.14 and 3.15
...
The new "test-with" session runs the test suite with non-main Python versions;
yet, `MAIN_PYTHON` stays at 3.13
2026-12-02 17:43:05 +01:00
a85d426b6e
Merge branch 'alembic-api' into develop
...
CI / Checks (Python 3.13) (push) Successful in 2m47s
Reviewed-on: #19
2026-12-02 14:05:17 +01:00
35d0c7b409
Test reading the database revision
...
CI / Checks (Python 3.13) (push) Successful in 2m50s
In the "sequentially" variant of the test database,
`current_db_revision()` must return the head of the migrations;
in the "all_at_once" variant, there is no version table.
2026-12-02 13:56:04 +01:00
2add322a25
Test the revision lock of the CLI stages
...
The `@db_revision` decorator no longer skips its check under `TESTING`.
The tests replace `current_db_revision()` with the revision they need.
2026-12-02 13:42:04 +01:00
eb059c1ea5
Read the database revision with the Alembic API
...
The `@db_revision` decorator no longer runs `alembic current` in a subprocess,
which only worked from the project folder and reported any failure as a wrong revision.
Also, its docstring now explains that it locks completed stages of the data pipeline.
2026-12-02 13:35:37 +01:00
ef7b41e675
Merge branch 'directions-json' into develop
...
CI / Checks (Python 3.13) (push) Successful in 2m47s
Reviewed-on: #18
2026-12-02 11:43:02 +01:00
664dccee02
Store the directions of paths as JSON arrays
...
CI / Checks (Python 3.13) (push) Successful in 2m46s
The data migration converts the 42 existing rows
from a JSON-encoded string into a JSON array.
2026-12-02 11:23:01 +01:00
bbd7d6a279
Store Path._directions as a JSON array
...
The column is of type `JSON`,
but the code stored a JSON-encoded string in it;
so, the data was encoded twice.
A later data migration converts the existing rows.
2026-12-02 09:03:49 +01:00
2b1dd6af35
Merge branch 'sqlalchemy-select' into develop
...
CI / Checks (Python 3.13) (push) Successful in 2m46s
Reviewed-on: #17
2026-12-02 00:38:24 +01:00
fc185fa3c0
Create the engine and the session on first use
...
CI / Checks (Python 3.13) (push) Successful in 2m47s
The global `db.session` is now a `scoped_session`,
like, for example, in Flask-SQLAlchemy.
Importing the package no longer creates an engine;
so, the placeholder for the tests is obsolete.
The `db_session` fixture replaces `db.session` with `monkeypatch`
such that it is reset after each test.
Tests without the fixture get a placeholder that fails loudly
instead of opening a real session,
which would block the `DROP SCHEMA` at the end of the test run.
2026-12-02 00:23:41 +01:00
9d98021b11
Request the db_session fixture
...
The test queries the database but relied on the
global `db.session` that the previous test had left behind.
2026-12-02 00:19:51 +01:00
bc2e3f439d
Count with .scalar_one() in velofy.console.gridify
...
A `COUNT` always returns exactly one row; `.scalar_one()`
is typed as `int` and is used for all other counts as well.
2026-12-01 23:51:00 +01:00
185a37f7d4
Query with select() in the forecasting models
...
`Session.query()` is the legacy API in SQLAlchemy 2.x.
`.one_or_none()` expresses that the unique constraint
on the five filtered columns allows at most one cached `Forecast`.
2026-12-01 23:48:36 +01:00
2eb6b5769f
Query with select() in Pixel
...
`Session.query()` is the legacy API in SQLAlchemy 2.x.
The addresses with restaurants are now selected with a subquery in one statement.
The `_restaurants_mock` fixture mocks the new call chain.
2026-12-01 23:45:35 +01:00
0dc3e11a63
Query with select() in Customer
...
`Session.query()` is the legacy API in SQLAlchemy 2.x.
The delivery and pickup addresses are now selected with subqueries in one statement each.
2026-12-01 23:39:44 +01:00
54e21109e7
Query with select() in Restaurant
...
`Session.query()` is the legacy API in SQLAlchemy 2.x.
The delivery addresses are now selected with a subquery in one statement.
2026-12-01 23:37:57 +01:00
9d2a4139b7
Query with select() in City
...
`Session.query()` is the legacy API in SQLAlchemy 2.x.
The addresses with restaurants are now selected with a subquery in one statement.
2026-12-01 23:35:21 +01:00
53e1859ee8
Query with select() in Grid and Path
...
`Session.query()` is the legacy API in SQLAlchemy 2.x.
Unlike `Query`, `select()` does not deduplicate single entities from a `JOIN`;
so, `Grid.gridify()` calls `.unique()` explicitly.
The `addresses_mock` fixtures mock the new call chain.
2026-12-01 23:29:39 +01:00
1f5a39f83a
Query with select() in velofy.console
...
`Session.query()` is the legacy API in SQLAlchemy 2.x.
2026-12-01 23:21:00 +01:00
c1f04c65aa
Count rows with select() in the tests
...
`Session.query()` is the legacy API in SQLAlchemy 2.x.
2026-12-01 23:17:57 +01:00
455af6dfdb
Merge branch 'orm-review' into develop
...
CI / Checks (Python 3.13) (push) Successful in 2m46s
Reviewed-on: #16
2026-12-01 23:06:03 +01:00
248c1ae600
Ignore the foreign keys into the original data
...
CI / Checks (Python 3.13) (push) Successful in 2m47s
The migrations create foreign keys from the `CLEAN_SCHEMA`
into the `ORIGINAL_SCHEMA` to ensure the cleaned data still
refer to the original data.
The ORM models do not know the original tables.
Also, print the `diff` as indented JSON.
2026-12-01 22:58:01 +01:00
25ed8c744b
Recreate checks stored by an old PostgreSQL version
...
Before version 14, PostgreSQL stored `EXTRACT(...)` as `date_part(...)`,
and the rendering of `IN (...)` changed as well.
The checks created in 2021 express the same rules as the ORM models
but render differently. See the docstring of the migration for details.
2026-12-01 22:56:12 +01:00
69d3be4a53
Rename constraints to follow the naming convention
...
Earlier migrations named some constraints without `op.f()`,
a column rename did not rename the unique constraint containing the column,
and the "ordered_timestamps_N" checks in "orders" were shifted by one
compared to the ORM.
See the docstring of the migration for details.
2026-12-01 22:49:36 +01:00
7d53abc057
Avoid lazy loads in .__repr__()
...
`ReplaySimulation`, `ReplayedOrder`, and `Forecast` accessed
relationships in their `.__repr__()`, which emits queries
or fails for detached instances.
They now use the foreign key columns.
2026-12-01 22:34:38 +01:00
1f9d0effae
Cache City.map with functools.cached_property
...
This replaces the manual caching in the uninitialized
`._map` attribute with a `hasattr()` check.
`.clear_map()` now only discards the cached map.
2026-12-01 22:27:28 +01:00
2a627072d8
Make grids.side_length not nullable
...
The ORM always defined `Grid.side_length` with `nullable=False`,
but the migration that created the "grids" table did not; the
live database contains no `NULL`s.
2026-12-01 22:20:06 +01:00
db2e00216d
Simplify the docstrings of the migrations
...
The "Revision" and "Revises" lines and the revision hashes in `upgrade()`
and `downgrade()` repeated the `revision` and `down_revision` variables;
the creation date is in the file name.
2026-12-01 22:20:06 +01:00
f532aae588
Test grids with the same side length in different cities
...
Regression test for the removed `unique=True` on `Grid.side_length`.
2026-12-01 22:20:06 +01:00
b36a3d1cd6
Allow the same Grid.side_length across cities
...
The `unique=True` on `Grid.side_length`
made the side length unique across all cities.
The intended rule is the `UniqueConstraint("city_id", "side_length")`,
which the migrations already implement; so, no migration is needed.
2026-12-01 21:58:29 +01:00
731299bb6e
Add nox session "verify-db-objects"
...
The new "verify-db-objects" session creates the ORM objects
with `.create_all()` in a temporary database and compares
them with the `CLEAN_SCHEMA` of a "live" database using `sqlalchemy-diff`
2026-12-01 21:53:31 +01:00
69b9d53704
Merge branch 'add-typeguard' into develop
...
CI / Checks (Python 3.13) (push) Successful in 2m47s
Reviewed-on: #15
2026-12-01 17:54:25 +01:00
cfd8d33049
Rename the "doctest" session into "test-docstrings"
CI / Checks (Python 3.13) (push) Successful in 2m46s
2026-12-01 17:14:48 +01:00
f47c87f51f
Add the "test-types" session as a pre-commit hook
2026-12-01 17:14:47 +01:00
2f313e7e3a
Pull out the TEST_DEPENDENCIES
2026-12-01 17:13:14 +01:00
5f7d3108de
Check the type annotations at runtime with typeguard
2026-12-01 17:07:00 +01:00
893b6bd8f1
Seed the random fake data in the tests
2026-12-01 15:51:24 +01:00
e4711875ca
Use a pd.DataFrame as the sentinel in test_totals_is_cached
2026-12-01 15:46:54 +01:00
f92fd35ce3
Revert to bare pd.Series in OrderHistory
...
`typeguard` evaluates the annotations at runtime where `pd.Series[int]` raises a `TypeError`
2026-12-01 15:31:58 +01:00
8abc93987e
Generate the fake coordinates as floats
...
Also, remove the misleading comment in `Location`
2026-12-01 15:27:53 +01:00
3b8b041a3e
Merge branch 'add-pyright' into develop
...
CI / Checks (Python 3.13) (push) Successful in 2m2s
Reviewed-on: #14
2026-12-01 15:18:18 +01:00
9a0dbb8ad8
Introduce TYPECHECK_LOCATIONS in the noxfile
CI / Checks (Python 3.13) (push) Successful in 2m2s
2026-12-01 15:05:54 +01:00
96b5a07f20
Add pyright to the "lint" session
2026-12-01 15:00:26 +01:00
66265c8808
Pass an explicit empty list to OrderedSet()
2026-12-01 14:50:16 +01:00
804a4a0966
Iterate over the rows in Forecast.from_dataframe()
2026-12-01 14:49:15 +01:00
77806b14b9
Declare the name of the forecasting models as a class variable
2026-12-01 14:45:37 +01:00
c74a7b81f1
Merge branch 'stricter-mypy' into develop
...
CI / Checks (Python 3.13) (push) Successful in 1m56s
Reviewed-on: #13
2026-12-01 14:26:52 +01:00
081d6f7fd9
Type the time series of OrderHistory as pd.Series[int]
CI / Checks (Python 3.13) (push) Successful in 1m55s
2026-12-01 14:23:14 +01:00
d6b798a736
Type-check scripts/
2026-12-01 14:05:34 +01:00
f7a6aa1881
Type-check noxfile.py
2026-12-01 14:03:44 +01:00
369957c06b
Narrow the untyped calls of folium.PolyLine
2026-12-01 13:38:00 +01:00
883a3ab8cc
Enable the "truthy-iterable" error code
2026-12-01 13:11:47 +01:00
9da2d0b703
Enable the "truthy-bool" error code
2026-12-01 13:11:46 +01:00
fef268321a
Enable the "redundant-expr" error code
2026-12-01 13:11:45 +01:00
7190724260
Enable the "possibly-undefined" error code
2026-12-01 13:11:32 +01:00
dafc695693
Enable the "mutable-override" error code
2026-12-01 13:11:31 +01:00
a4c1574135
Enable the "deprecated" error code
2026-12-01 13:11:30 +01:00
784d5c8ca0
Enable "warn_unreachable"
...
Also, remove the dead `isinstance()` check in `Location.relate_to()`
2026-12-01 13:07:53 +01:00
0a5f8f6c55
Enable "warn_return_any"
2026-12-01 12:39:45 +01:00
bbc00e2f1c
Enable "disallow_any_unimported"
2026-12-01 12:39:44 +01:00
0d2aab4211
Use t.Self for methods returning their own class
2026-12-01 12:38:04 +01:00
76982126f4
Type the relationships of Restaurant
2026-12-01 12:38:04 +01:00
5ad3fb538d
Type the relationships of ReplaySimulation
2026-12-01 12:38:04 +01:00
4be6078327
Type the relationships of ReplayedOrder
...
Also, move the `db` import to the top, which makes some quotes unnecessary
2026-12-01 12:38:03 +01:00
699e7f0443
Type the relationships of Pixel
2026-12-01 12:38:03 +01:00
af0e3cf1a1
Type the relationships of Path
2026-12-01 12:38:03 +01:00
f45a444f83
Type the relationships of Order
2026-12-01 12:38:02 +01:00
9a2ec3d86b
Type the relationships of Grid
2026-12-01 12:38:02 +01:00
90c0597193
Type the relationships of Forecast
...
Also, move the `db` import to the top
2026-12-01 12:38:02 +01:00
bda9cf69ed
Type the relationships of Customer
2026-12-01 12:38:01 +01:00
99c8c2ac2e
Type the relationships of Courier
2026-12-01 12:38:01 +01:00
8f5d11db7f
Type the relationships of City
2026-12-01 12:38:01 +01:00
de86c2e64d
Type the relationships of AddressPixelAssociation
2026-12-01 12:38:01 +01:00
2e03e58716
Type the relationships of Address
2026-12-01 12:38:00 +01:00
6633067563
Turn the ORM Base into a real class
2026-12-01 12:38:00 +01:00
cd74b343bc
Replace the __future__ imports ...
...
... with quoted annotations where needed
2026-12-01 12:38:00 +01:00
ef0888619e
Enable PYI019 and PYI034
2026-12-01 12:37:54 +01:00
e4016db9fe
Enable "no_implicit_reexport"
...
Also, remove the unused `orm_exc` import alias
2026-12-01 12:37:46 +01:00
d9364eea9e
Set all "strict" options explicitly
2026-12-01 12:37:37 +01:00
7e4fe464f6
Merge branch 'pandas-stubs' into develop
...
CI / Checks (Python 3.13) (push) Successful in 1m55s
Reviewed-on: #12
2026-12-01 00:35:52 +01:00
2bc2408694
Type-check pandas with pandas-stubs
CI / Checks (Python 3.13) (push) Successful in 1m54s
2026-12-01 00:31:21 +01:00
01416a1175
Fix the type annotation of Forecast.from_dataframe()
2026-12-01 00:27:29 +01:00
f835b091b2
Merge branch 'upgrade-dependencies' into develop
...
CI / Checks (Python 3.13) (push) Successful in 1m52s
Reviewed-on: #11
2026-12-01 00:21:02 +01:00
ad56683166
Explain why black stays below v26
CI / Checks (Python 3.13) (push) Successful in 1m53s
2026-12-01 00:18:34 +01:00
83b5bd40a7
Upgrade various MINOR and PATCH versions
2026-12-01 00:05:39 +01:00
927ea56082
Merge branch 'more-lint-rules' into develop
...
CI / Checks (Python 3.13) (push) Successful in 1m53s
Reviewed-on: #10
2026-11-30 23:59:08 +01:00
6ecbd6860a
Add the flake8-only notes to the ruff section
CI / Checks (Python 3.13) (push) Successful in 1m52s
2026-11-30 23:50:12 +01:00
8d843895b7
Complete the ruff-only notes in the flake8 section
2026-11-30 23:50:05 +01:00
567bb713e2
Enable YTT in flake8 and ruff
2026-11-30 23:43:49 +01:00
57ac602612
Enable TRY in flake8 and ruff
2026-11-30 23:42:08 +01:00
1827e02f34
Enable TID in flake8 and ruff
2026-11-30 23:41:42 +01:00
4023f32662
Enable RSE in flake8 and ruff
2026-11-30 23:41:00 +01:00
e612e33f59
Enable PIE in flake8 and ruff
2026-11-30 23:40:15 +01:00
991543046d
Enable PGH in ruff
2026-11-30 23:39:08 +01:00
d55e72e04d
Enable LOG in flake8 and ruff
2026-11-30 23:38:43 +01:00
5c62c9919c
Enable G in ruff
2026-11-30 23:38:28 +01:00
33daa9cda7
Enable FLY in ruff
2026-11-30 23:38:13 +01:00
c32566527a
Enable EXE in flake8 and ruff
2026-11-30 23:37:54 +01:00
6ebcd69524
Enable BLE in ruff
2026-11-30 23:37:20 +01:00
ed53324a1d
Hide the capitalization commit from git blame
2026-11-30 23:28:04 +01:00
0090145b65
Capitalize the explanations after "=>"
2026-11-30 23:27:31 +01:00
c56fe649b7
Enable RUF in ruff
2026-11-30 23:17:41 +01:00
ae2dc8db64
Enable EM in flake8 and ruff
2026-11-30 22:59:41 +01:00
652713e702
Enable NPY in ruff
2026-11-30 22:49:41 +01:00
5beb88559f
Enable FBT in flake8 and ruff
2026-11-30 22:43:35 +01:00
d0326aee4f
Enable SLF in ruff
2026-11-30 22:38:26 +01:00
99dda74a9e
Enable PL in ruff
2026-11-30 22:28:12 +01:00
95f08bc96d
Enable PD in flake8 and ruff
2026-11-30 22:11:10 +01:00
f266adad45
Enable A in flake8 and ruff
2026-11-30 22:06:45 +01:00
00aff456c3
Enable FURB in ruff
2026-11-30 22:06:44 +01:00
0a4fd0edbc
Enable PERF in ruff
2026-11-30 22:06:44 +01:00
9cc21f5b69
Enable PTH in ruff
2026-11-30 22:06:43 +01:00
0cb924b3b6
Enable ISC in flake8 and ruff
2026-11-30 22:06:43 +01:00
3bd7dd5772
Enable RET in flake8 and ruff
2026-11-30 22:06:42 +01:00
007998372f
Enable SIM in flake8 and ruff
2026-11-30 22:06:41 +01:00
5dce8e6645
Enable UP in ruff
2026-11-30 21:28:31 +01:00
d0d5c92c55
Sort the ruff-only rule families by code
2026-11-30 20:50:21 +01:00
75824ea602
Merge branch 'unify-imports' into develop
...
CI / Checks (Python 3.13) (push) Successful in 1m54s
Reviewed-on: #9
2026-11-30 20:30:53 +01:00
31dda815d9
Ignore the import renames in git blame
CI / Checks (Python 3.13) (push) Successful in 1m52s
2026-11-30 20:25:54 +01:00
5c13d719cd
Enforce the established import aliases with ruff
...
These aliases were already in use before this branch
2026-11-30 20:22:06 +01:00
cf2534f41e
Import velofy.config as pkg_config everywhere
2026-11-30 20:19:35 +01:00
de5e49b497
Import alembic.config as alembic_config
2026-11-30 20:13:46 +01:00
dc45c689c4
Import alembic.command as alembic_cmd
2026-11-30 20:12:41 +01:00
e9743eaa01
Import rpy2.robjects.packages as r_packages
2026-11-30 20:06:09 +01:00
8bca30c836
Import rpy2.rinterface_lib.callbacks as r_callbacks
2026-11-30 20:04:44 +01:00
9b844b16e7
Import statsmodels.tsa.api as tsa
...
The alias in the `statsmodels` documentation
2026-11-30 20:03:25 +01:00
07e90b7851
Import click.testing as cli_testing
...
Like `click.core` as `cli_core`
2026-11-30 20:01:43 +01:00
07660ecff9
Import geopy.distance as geo_distance everywhere
2026-11-30 20:01:42 +01:00
d660f0cc4e
Import googlemaps as gm everywhere
2026-11-30 20:01:41 +01:00
d006752194
Enforce the import conventions with ruff
...
flake8 has no plugin with configurable aliases
2026-11-30 17:18:29 +01:00
5ca16ae47c
Import datetime as dt everywhere
2026-11-30 15:50:17 +01:00
f0c617955b
Use the nox module import
2026-11-30 15:44:05 +01:00
9c3b52befb
Import typing as t ...
...
... and `collections.abc` as `cabc`
Linting rule for `velofy`: Import modules instead of objects
2026-11-30 15:42:21 +01:00
c6518f6b39
Use builtin generics and X | None
...
Since Python 3.9 and 3.10, `list`, `tuple`, and `X | None`
replace `typing.List`, `typing.Tuple`, and `typing.Optional`
2026-11-30 15:07:47 +01:00
aa1a7c796f
Register the shared fixtures via pytest_plugins
...
That is the documented way to share fixtures from other modules,
instead of importing them into tests/conftest.py
2026-11-30 15:03:27 +01:00
0b2a1197a2
Import sqlalchemy.ext.hybrid as sa_hybrid
2026-11-30 14:22:42 +01:00
9d3af5e447
Import the postgresql dialect as psql
2026-11-30 14:21:01 +01:00
78e052b668
Use sa.func instead of importing func
...
Naming rule for `velofy`: Import modules instead of objects
2026-11-30 14:19:42 +01:00
e30b3efbe8
Use the sa alias for sqlalchemy everywhere
...
`sa` is the common alias, also in SQLAlchemy's own documentation
2026-11-30 14:18:05 +01:00
a85ba4c4c4
Merge branch 'fix-mypy' into develop
...
CI / Checks (Python 3.13) (push) Successful in 1m52s
Reviewed-on: #8
2026-11-30 14:13:43 +01:00
2b112f46e2
Remove the no longer used engine and connection globals
...
CI / Checks (Python 3.13) (push) Successful in 1m52s
Only `session` is used in the package.
Bound to the `engine`, it connects on its first query
instead of when the package is imported.
2026-11-30 14:03:26 +01:00
e9dbf528d7
Query order history via the db.session
...
The query then runs in the same transaction as the `db.session`
For that, `addresses_mock` now replaces only `session.query()`
instead of the whole `db.session`.
2026-11-30 13:59:34 +01:00
6119064d71
Remove obsolete exceptions from the mypy config
...
`nox` and `pytest` are not imported in the package,
and the other libraries ship their own types by now
2026-11-30 13:23:29 +01:00
570c9c9fcb
Run mypy in the "lint" session
...
It needs the dependencies of `velofy` installed,
and it now also reports "# type: ignore" comments without an error code
or that are not needed anymore
2026-11-30 13:15:27 +01:00
295a271ad7
Remove no longer needed "# type: ignore" comments
...
With the ORM columns annotated, `mypy` understands these lines on its own
2026-11-30 13:11:52 +01:00
607055d55a
Raise an error if Path._directions is not set ...
...
... instead of failing inside `json.loads()` on `None`
2026-11-30 12:50:31 +01:00
744d9a6353
Raise an error if an Order timestamp is not set
...
Like `Order.time_to_delivery` already does,
instead of failing with a `TypeError` on `None`
2026-11-30 12:43:33 +01:00
1c206a715b
Rename the restaurants list ...
...
... because it shadowed the `restaurants` parameter, a `bool`
2026-11-30 12:33:17 +01:00
a4d1f477ae
Return a bool from Order.corrected ...
...
... because the `or` chain over nullable columns could return `None`
2026-11-30 12:29:09 +01:00
e08272e6ab
Use dt for the datetime module in orders.py
...
Like in the other modules
2026-11-30 11:44:34 +01:00
1cc5dcff54
Avoid queries that may return None
...
The last `grid` of the loop already belongs to the `city`,
and `.scalar()` returns the maximum or `None` without indexing a row
2026-11-30 11:39:56 +01:00
82d245836f
Annotate the defaults in Address.draw()
...
The `**kwargs` for `folium.Circle()` are not all strings
2026-11-30 11:38:27 +01:00
a320c1fba5
Type the database placeholders for mypy
...
The test fixtures replace the `None` placeholders, and `velofy.configuration` already ensures that "DATABASE_URI" is set outside of tests
2026-11-30 11:36:01 +01:00
b5a6fb42cc
Accept any arguments in the R console callbacks
...
`rpy2` names the parameter `s`, so `_msg` did not match its signature
2026-11-30 11:33:59 +01:00
27171fe79a
Exclude folium from the "untyped-call" check
...
`folium` has no type annotations, so every call into it counted as untyped
2026-11-30 11:33:19 +01:00
c339719936
Annotate the ORM columns with orm.Mapped
...
Since SQLAlchemy 2.0, `orm.mapped_column()` with an annotation
lets `mypy` see `pixel.id` as an `int` instead of a `Column[int]`.
2026-11-30 11:22:04 +01:00
a8b4bca79d
Merge branch 'fix-sawarnings' into develop
...
CI / Checks (Python 3.13) (push) Successful in 1m44s
Reviewed-on: #7
2026-11-30 11:05:11 +01:00
c3198ecc48
Turn all warnings into errors
...
CI / Checks (Python 3.13) (push) Successful in 1m43s
New warnings, such as deprecations,
then fail right away instead of piling up.
The ignore for `patsy` is obsolete.
2026-11-30 10:56:56 +01:00
e01421bb96
Close the connection after running the migrations
...
The pooled `connection` stayed open until garbage collection,
which emits a `ResourceWarning`
2026-11-30 10:54:36 +01:00
ee5a372b2b
Link new objects from the parent
...
Since SQLAlchemy 2.0, only the parent's end
cascades a new object into the session'
2026-11-30 10:40:27 +01:00
87aaebe475
Join the session into the outer transaction
...
With "create_savepoint", commits inside a test case
only release a savepoint, so the final rollback no longer warns
2026-11-30 10:24:10 +01:00
fb87326d66
Merge branch 'add-ruff' into develop
...
CI / Checks (Python 3.13) (push) Successful in 1m43s
Reviewed-on: #6
2026-11-28 05:01:26 +01:00
a24db98262
Enable PLR in ruff
CI / Checks (Python 3.13) (push) Successful in 1m43s
2026-11-28 04:57:25 +01:00
8f36a740d7
Enable ERA in ruff
...
Dead code belongs in the history, not in comments
2026-11-28 04:55:19 +01:00
707b4ab652
Add flynt to the "format" session
...
`flynt` converts old-style string formatting
into f-strings before `black` formats the result
2026-11-28 04:49:16 +01:00
e451f03d0f
Add ruff to the "format" session
...
`ruff format` adds parentheses around multi-line lambda bodies
and removes blank lines after block openers,
both of which `black` accepts.
Lines with `# type:ignore` are shortened
because `black` counts pragma comments toward the line length
and `ruff` does not.
2026-11-28 04:44:52 +01:00
318dff8fc8
Add ruff to the "lint" session
...
`ruff` runs alongside `flake8` and `isort`,
with the rules aligned to theirs:
- `noqa` comments go where both tools expect them
- `import`s stay sorted case-insensitively,
now stated explicitly in both tools
- `print()` in the "docs" session became `session.log()`
2026-11-28 04:37:25 +01:00
175d722071
Merge branch 'remove-wps' into develop
...
CI / Checks (Python 3.13) (push) Successful in 1m41s
Reviewed-on: #5
2026-11-28 04:16:01 +01:00
88554e3939
Silence the module name notice of bandit
CI / Checks (Python 3.13) (push) Successful in 1m41s
2026-11-28 04:11:56 +01:00
1a4dfb0ee7
Sort the plugins in the "select" list
2026-11-28 04:09:52 +01:00
4a81403f15
Replace darglint with pydoclint
2026-11-28 04:06:53 +01:00
3ec7ec8c98
Add pep8-naming
2026-11-28 03:54:49 +01:00
afe8b3ce90
Apply shared fixtures to whole test classes
2026-11-28 03:52:11 +01:00
882d3c98ba
Add flake8-unused-arguments
...
- Request fixtures only needed for their side effects
via `@pytest.mark.usefixtures()` instead of as arguments
- Remove fixtures that a test does not use at all
- Exempt abstract methods because their arguments define an interface
2026-11-28 03:48:50 +01:00
29a711f049
Add flake8-todos
2026-11-28 03:37:25 +01:00
cb8f919b1f
Add flake8-sfs
2026-11-28 03:34:40 +01:00
650765a9d3
Add flake8-quotes
2026-11-28 03:28:50 +01:00
50a0e45309
Ignore the double quotes commit in git blame
2026-11-28 03:28:49 +01:00
ea8f1a13e3
Use double quotes
2026-11-28 03:26:13 +01:00
7b32ffc599
Add flake8-docstrings
2026-11-28 03:26:12 +01:00
efde4322bf
Add flake8-debugger
2026-11-28 03:26:12 +01:00
08493d1ea1
Add flake8-comprehensions
2026-11-28 03:26:12 +01:00
7f14c9c855
Add flake8-commas
2026-11-28 03:26:11 +01:00
cb110267f0
Add flake8-bugbear
2026-11-28 03:26:11 +01:00
d9d9464f44
Add flake8-broken-line
2026-11-28 03:26:11 +01:00
2000ceca54
Add flake8-bandit
2026-11-28 03:26:10 +01:00
137b3b1e03
Remove the config of flake8-expression-complexity
2026-11-28 03:26:10 +01:00
b24eb80f70
Remove the config of flake8-string-format
2026-11-28 03:26:10 +01:00
13eedbf699
Remove the config of flake8-rst-docstrings
2026-11-28 03:26:10 +01:00
21d6066086
Remove the config of flake8-isort
2026-11-28 03:26:09 +01:00
785bb99c7d
Remove the config of flake8-eradicate
2026-11-28 03:26:04 +01:00
9fcb3c8c14
Remove all "WPS" codes
2026-11-28 03:25:20 +01:00
8a5a652b3e
Run the local nox hooks serially
2026-11-28 02:00:30 +01:00
7c528d327e
Merge branch 'merge-message-template' into develop
...
CI / Checks (Python 3.13) (push) Successful in 1m40s
Reviewed-on: #4
2026-11-28 01:40:15 +01:00
253a12821e
Name merge commits after the merged branch
CI / Checks (Python 3.13) (push) Successful in 1m40s
2026-11-28 01:33:40 +01:00
0dc32da8c1
Merge pull request 'ci-no-merges-in-branches' ( #3 ) from ci-no-merges-in-branches into develop
...
CI / Checks (Python 3.13) (push) Successful in 1m39s
Reviewed-on: #3
2026-11-28 01:28:33 +01:00
30aac8e3c7
Use FORGEJO_... names in CI
CI / Checks (Python 3.13) (push) Successful in 1m40s
2026-11-28 01:26:18 +01:00
d158577984
Reject merge commits in feature branches
2026-11-28 01:24:44 +01:00
9e10a0c9aa
Merge pull request 'Run CI only on pushes' ( #2 ) from ci-push-only into develop
...
CI / Checks (Python 3.13) (push) Successful in 1m40s
Reviewed-on: #2
2026-11-28 01:15:37 +01:00
4fb96ee485
Run CI only on pushes
CI / Checks (Python 3.13) (push) Successful in 1m40s
2026-11-28 01:05:28 +01:00
c6ea7b13ec
Merge pull request 'Use language: unsupported for the local hooks' ( #1 ) from use-language-unsupported into develop
...
CI / Checks (Python 3.13) (push) Successful in 1m44s
Reviewed-on: #1
2026-11-28 01:01:41 +01:00
8265790d5d
Use language: unsupported for the local hooks
CI / Checks (Python 3.13) (push) Successful in 1m40s
CI / Checks (Python 3.13) (pull_request) Successful in 1m41s
2026-11-28 00:57:42 +01:00
5c3a942ad5
Merge branch 'rework-pre-commit' into develop
CI / Checks (Python 3.13) (push) Successful in 1m41s
2026-11-27 16:13:53 +01:00
2f0748e059
Rename ci.yml to ci.yaml
CI / Checks (Python 3.13) (push) Successful in 1m41s
2026-11-27 16:11:46 +01:00
d8edd58fe6
Reformat the pre-commit config
...
CI / Checks (Python 3.13) (push) Successful in 1m41s
Also, drop the no longer needed stage overrides
2026-11-27 16:05:19 +01:00
792da0507f
Run the pre-commit hooks in CI
CI / Checks (Python 3.13) (push) Successful in 1m42s
2026-11-27 15:15:11 +01:00
fbfb79d610
Export requirements.txt with pre-commit
2026-11-27 15:11:39 +01:00
08dd3b8218
Install all hook types with a plain pre-commit install
2026-11-27 14:59:25 +01:00
83007d458c
Add hooks for the "test" and "doctest" sessions
2026-11-27 14:52:05 +01:00
ff53af5001
Run the pre-commit hooks with uv
2026-11-27 14:36:34 +01:00
9adddd7959
Remove trailing whitespace
2026-11-27 14:29:29 +01:00
79f35ae3aa
Add missing newlines
2026-11-27 14:07:03 +01:00
079a9505ff
Update the pre-commit hooks
2026-11-27 13:59:44 +01:00
ed34e05cc7
Migrate the pre-commit config ...
...
... with `pre-commit migrate-config` to the new stage names
2026-11-27 13:56:09 +01:00
44eef9eafc
Remove the orphaned "fix-branch-references" hook
2026-11-27 13:55:26 +01:00
0ce8840bed
Merge branch 'rework-nox' into develop
CI / Checks (Python 3.13) (push) Successful in 1m31s
2026-11-27 13:47:25 +01:00
518811e138
Pin uv to the 0.13 series ...
...
CI / Checks (Python 3.13) (push) Successful in 1m31s
... to make CI more deterministic
2026-11-27 13:41:59 +01:00
b4e22dd0d4
Upgrade actions/checkout to v6
CI / Checks (Python 3.13) (push) Successful in 1m31s
2026-11-27 13:32:27 +01:00
6958cc6a58
Run the nox sessions
CI / Checks (Python 3.13) (push) Successful in 1m31s
2026-11-27 13:29:56 +01:00
045139a933
Rename the setup steps
2026-11-27 13:29:49 +01:00
aaeb9b1e72
Set UV_PYTHON_PREFERENCE for the whole job
2026-11-27 13:29:36 +01:00
a8c0e17bed
Wait for the database
2026-11-27 13:29:32 +01:00
ad8d43815e
Reorder the nox sessions ...
...
CI / Tests (Python 3.13) (push) Successful in 1m6s
... as listed in the module docstring
2026-11-27 12:58:57 +01:00
7c2e21130f
Streamline the names, docstrings, and comments
2026-11-27 12:58:56 +01:00
689c8a8f42
Rewrite the module docstring
2026-11-27 12:58:56 +01:00
32f6540ec3
Add "doctest" session ...
...
... to run `xdoctest` against the `velofy` package.
Also, install `xdoctest` with only its "colors" extra
as the notebooks do not contain doctests.
2026-11-27 12:58:52 +01:00
110c6f755b
Streamline the "test" session
...
Rely on pyproject.toml for the `coverage` options,
and shorten the comments.
2026-11-27 12:48:53 +01:00
e7d93a5496
Do not run mypy for now
2026-11-27 12:48:52 +01:00
50d5b885bf
Rename the nox session functions ...
...
... and add type hints
2026-11-27 12:48:52 +01:00
2147dbf9d0
Replace the "clean-pwd" session with "clean-cwd"
2026-11-27 12:48:52 +01:00
ded4691177
Remove the "fix-branch-references" session ...
...
... and use relative links in the docs from now on.
Forgejo resolves relative links against the branch being viewed.
So, rewriting absolute links per branch is no longer necessary.
2026-11-27 12:48:51 +01:00
5f73b74d69
Add a "deps-upgrade-check" session ...
...
... to report the latest version on PyPI and the age of
every release pinned in uv.lock, using a stdlib-only script.
2026-11-27 12:48:51 +01:00
ebad87b0a3
Add a "deps-lock" session ...
...
... to lock the dependencies
2026-11-27 12:48:51 +01:00
d918063218
Add a "deps-upgrade" session ...
...
... to upgrade the pinned dependencies
2026-11-27 12:48:50 +01:00
f5f24ea611
Add a "venv" session ...
...
... to set up the local develop environment
2026-11-27 12:48:50 +01:00
6d2578ef80
Replace "safety" with "deps-audit"
...
`safety check` is deprecated.
We use `pip-audit` instead, fed with the hashed dependencies
exported from uv.lock.
We ignore the known vulnerabilities in `black` v25 for now.
2026-11-27 12:48:42 +01:00
60aa7911d2
Remove the CI and pre-commit specific nox sessions
2026-11-27 12:39:14 +01:00
99db2dc623
Run only the "format", "lint", and "test" sessions by default
2026-11-27 12:39:14 +01:00
f5a0a91202
Keep temporary files in .cache/tmp
2026-11-27 12:39:10 +01:00
b5db5ab80e
Set the nox options reuse_venv and stop_on_first_error
...
Start with fresh virtual environments explicitly,
and stop at the first failing session.
2026-11-26 13:41:53 +01:00
911107af95
Clarify where pytest gets the "TESTING" variable from
2026-11-26 13:41:53 +01:00
218d1d6078
Skip installs in nox only with the "-R" flag
...
Use `skip_install()` and remove the guards against "-r"
that were only needed for `poetry install --no-dev`.
2026-11-26 13:41:52 +01:00
7ad2e4ee26
Replace _begin() with start()
2026-11-26 13:41:52 +01:00
f6344ac4c5
Use uv in the nox sessions
...
Make `uv` the backend for the virtual environments,
and install the packages with the versions pinned in uv.lock,
exported into a constraints file with `uv export`,
instead of `poetry export` and `poetry install`.
Also, use `uv run` instead of `poetry run`.
2026-11-26 13:41:52 +01:00
935e3e28d6
Read the supported Python versions ...
...
... from pyproject.toml
2026-11-26 13:41:51 +01:00
4495da2b60
Add flake8-pyproject
...
Without it, `flake8` cannot read its config in pyproject.toml.
2026-11-26 13:41:51 +01:00
68ada518ea
Remove the obsolete "--ignore=I0" flag
...
It was only needed while `isort` v4 and v5 disagreed.
2026-11-26 13:41:51 +01:00
c5c8635c09
Remove wemake-python-styleguide
2026-11-26 13:41:51 +01:00
ed510eba7d
Remove the isort workaround
...
The `_isort_fix()` context manager was only needed for isort 4.
2026-11-26 13:41:50 +01:00
1dd2810ac7
Move the autoflake config
2026-11-26 13:41:50 +01:00
c4eae82e4d
Use SemVer-like versioning for the dependencies
2026-11-26 13:41:50 +01:00
355dfd993f
Switch from poetry to uv
...
Use the PEP 735 "[dependency-groups]" (here: "dev", "test", "docs")
instead of Poetry's "dev" group, and `uv_build` as the build backend.
Replace poetry.lock with uv.lock.
Also, adapt CI and the README.
2026-11-26 13:41:49 +01:00
afb17b61da
Merge branch 'integrate-setup-cfg' into develop
CI / Tests (Python 3.13) (push) Successful in 1m13s
2026-11-25 15:09:21 +01:00
3adfa117a5
Remove the empty setup.cfg
CI / Tests (Python 3.13) (push) Successful in 1m15s
2026-11-25 15:03:35 +01:00
c3f82deeab
Move the flake8 config
...
`flake8` cannot read pyproject.toml by itself,
so add `flake8-pyproject`.
2026-11-25 15:03:35 +01:00
c28d702a58
Move the isort config
2026-11-25 15:03:35 +01:00
74ddb54772
Move the mypy config
2026-11-25 15:03:35 +01:00
03617d5bbb
Move the pytest config
2026-11-25 15:03:34 +01:00
8771bb682e
Move the coverage config
2026-11-25 14:38:14 +01:00
63c9453ce7
Merge branch 'upgrade-dependencies-py313' into develop
CI / Tests (Python 3.13) (push) Successful in 1m14s
2026-11-25 14:19:08 +01:00
eb62ff2048
Lock the major versions of all direct dependencies
...
CI / Tests (Python 3.13) (push) Successful in 1m14s
Use ">=installed,<next major" as the version range,
the minor version for 0.x packages, and only
a lower bound for calendar-versioned packages.
`black` stays below v26 to keep 2 lines after the `import`s.
Also, remove the redundant `geopy` entry in the "dev" group.
2026-11-25 14:16:08 +01:00
645802bb7d
Update all transitive dependencies
...
`fonttools` v4.69.0 has no wheels for this environment yet,
so it stays at v4.68.0.
2026-11-25 14:10:41 +01:00
1faf140c30
Upgrade utm
2026-11-25 13:59:32 +01:00
d7c69f3f37
Upgrade statsmodels
2026-11-25 13:59:31 +01:00
0e2b8f75f8
Upgrade sqlalchemy
...
`sqlalchemy` v2.1 uses `psycopg` v3 as the default PostgreSQL driver.
So, we replace `psycopg2` with `psycopg`,
using its binary wheel that bundles `libpq`,
so CI no longer needs `libpq-dev` from `apt`.
2026-11-25 13:58:34 +01:00
f0d04c8a2a
Upgrade sphinx-autodoc-typehints
2026-11-25 13:42:35 +01:00
4be36d527f
Upgrade sphinx
2026-11-25 13:41:52 +01:00
505e29b855
Upgrade Shapely
2026-11-25 13:40:33 +01:00
bbe3f9af28
Upgrade pytest-mock
2026-11-25 13:24:37 +01:00
ec7473e87a
Upgrade pytest-env
2026-11-25 13:23:55 +01:00
dd50d7a62f
Upgrade pytest-cov
2026-11-25 13:23:14 +01:00
fbb7d078fa
Upgrade pytest
2026-11-25 13:22:31 +01:00
ea3e25a85b
Upgrade pre-commit
2026-11-25 13:21:44 +01:00
705955b38b
Upgrade pandas
...
Also, replace the deprecated "T" frequency alias with "min",
and access the trend by position with `.iloc`.
2026-11-25 13:16:55 +01:00
6290d280e2
Upgrade numpy
2026-11-25 12:59:24 +01:00
b6f570e13f
Upgrade mypy
2026-11-25 12:58:10 +01:00
746fe023e6
Upgrade matplotlib
2026-11-25 12:57:25 +01:00
ac3251867f
Upgrade isort
2026-11-25 12:54:53 +01:00
3e11980ab0
Upgrade folium
2026-11-25 12:53:32 +01:00
4516f54236
Upgrade flake8-pytest-style
2026-11-25 12:52:36 +01:00
5189a63bc3
Upgrade flake8-annotations
2026-11-25 12:51:00 +01:00
8cbd1fa979
Upgrade autoflake
...
This needed `flake8` to be upgraded first.
2026-11-25 12:49:47 +01:00
2f085f7450
Upgrade flake8
2026-11-25 12:46:14 +01:00
36264dc49c
Upgrade Faker
2026-11-25 12:46:07 +01:00
c310c335ff
Upgrade click
...
Since `click` v8.2, a `Group` invoked without a subcommand
exits with status code 2 ("usage error") instead of 0.
2026-11-25 12:45:59 +01:00
5710d12e21
Upgrade black
...
Pin to the 2025 series to keep the 2 lines after the `import`s.
Also, target Python 3.13.
2026-11-25 12:45:51 +01:00
5519c9030c
Upgrade alembic
2026-11-25 12:18:04 +01:00
6af7c4437d
Remove wemake-python-styleguide
...
No 0.x release of `wemake-python-styleguide` runs on Python 3.12+.
The current version pins `flake8-commas` to v2.x,
which crashes on the new f-string tokenizer.
The 1.x releases no longer bundle the `flake8` plug-ins this project uses.
The plug-ins are added back explicitly, one by one, on a separate branch.
2026-11-25 12:13:43 +01:00
042256eb99
Switch to Python 3.13
...
CI / Tests (Python 3.13) (push) Successful in 1m17s
The dependencies stay in the same series as on Python 3.8
where those support 3.13.
Only the unavoidable upgrades are taken:
- `matplotlib` to v3.9
- `numpy` to v2.1
- `pandas` to v2.2
- `scipy` (via statsmodels)
Required code changes:
- `numpy` v2.1 prints its scalars as `np.float64(...)`,
which `psycopg2` then writes into the SQL
=> Adjust `Forecast.from_dataframe()` to convert the
rounded values into plain `float`s
- Python 3.12 no longer accepts `float`s in `random.randint()`
=> The test factories now pass the seconds as `int`s
CI and `nox` use a `u`v-managed Python, which ships the C headers
needed to build `psycopg2` and `rpy2`.
`flake8` v4 does not run on Python 3.12+
and is upgraded in a future commit.
2026-11-25 11:30:33 +01:00
34da92102f
Merge branch 'upgrade-dev-tools-py38' into develop
CI / Tests (Python 3.8) (push) Successful in 1m24s
2026-11-25 11:04:24 +01:00
d54f94a998
Upgrade pre-commit
CI / Tests (Python 3.8) (push) Successful in 1m24s
2026-11-25 11:01:35 +01:00
359d7be62a
Upgrade nox
...
The sessions in `noxfile.py` do not work since the migration to
Poetry 2: they use `poetry install --no-dev` and `poetry export`,
which Poetry 2 removed or moved into a plugin. The sessions are
reworked together with the other development tools.
2026-11-25 10:59:03 +01:00
9eecd371bc
Upgrade sphinx and sphinx-autodoc-typehints
2026-11-25 10:51:36 +01:00
94df768f74
Widen the version ranges for autoflake ...
...
... and two flake8 plugins
On Python 3.8, the three packages stay at the newest versions that work
with `flake8` v4, which `wemake-python-styleguide` v0.17 requires.
The lock file now also records their newer releases for newer Python versions.
The actual upgrade follows together with the switch to Python 3.13.
2026-11-25 10:44:08 +01:00
ffd72c9987
Upgrade isort
...
`isort` v5 honors the `single_line_exclusions = typing` setting in
`setup.cfg`, which `isort` v4 ignored.
So, the `typing` imports that were split onto separate lines to satisfy
`isort` v4 are combined again, as the configuration originally intended.
2026-11-25 10:31:24 +01:00
dbdce83067
Upgrade black
2026-11-25 10:30:47 +01:00
fad875b332
Merge branch 'upgrade-dependencies-py38' into develop
CI / Tests (Python 3.8) (push) Successful in 1m23s
2026-11-25 10:17:06 +01:00
685bb872a8
Update all transitive dependencies
CI / Tests (Python 3.8) (push) Successful in 1m24s
2026-11-25 10:09:42 +01:00
fc3fe900f6
Upgrade scipy
2026-11-25 09:19:42 +01:00
d8d5eecac9
Upgrade alembic
2026-11-25 09:18:19 +01:00
b2ce82f431
Upgrade the research extra
2026-11-24 17:29:21 +01:00
d33816302c
Upgrade xdoctest
2026-11-24 17:24:49 +01:00
71544f3088
Upgrade Faker
2026-11-24 17:24:48 +01:00
1d03d09a67
Upgrade factory-boy
2026-11-24 17:24:48 +01:00
b21ae1bf26
Upgrade pytest-mock
2026-11-24 17:24:48 +01:00
af6c639cc1
Upgrade pytest-env
2026-11-24 17:24:47 +01:00
e6130f4253
Upgrade pytest-cov
2026-11-24 17:24:47 +01:00
c895078837
Upgrade pytest
2026-11-24 17:24:43 +01:00
47b56550bc
Upgrade mypy
2026-11-24 17:24:42 +01:00
b7cfdcb1c0
Upgrade sqlalchemy to v2
2026-11-24 17:24:42 +01:00
e94ade4c88
Upgrade wemake-python-styleguide
2026-11-24 17:24:42 +01:00
fb2db07d37
Upgrade sqlalchemy to the latest v1.4
2026-11-24 17:24:41 +01:00
793f3105b1
Use sa.text()
2026-11-24 17:24:41 +01:00
46787de9bc
Use an explicit transaction
2026-11-24 17:24:41 +01:00
d8df96763c
Put each typing import on its own line ...
...
... as configured for `isort`
2026-11-24 17:24:40 +01:00
db1b23cd99
Annotate the type of steps for mypy
2026-11-24 17:24:40 +01:00
39cf160b95
Upgrade stevedore ...
...
... to fix the `bandit` plugin for `flake8`
2026-11-24 17:24:40 +01:00
f736e0e73b
Import declarative_base from sqlalchemy.orm
2026-11-24 17:24:39 +01:00
061832faa6
Upgrade pandas
2026-11-24 17:24:35 +01:00
fb912d12bb
Upgrade alembic
CI / Tests (Python 3.8) (push) Successful in 2m3s
2026-11-24 15:28:51 +01:00
b0cb3b412b
Upgrade folium
2026-11-24 15:27:40 +01:00
d4e8f17f0c
Upgrade click to v8
2026-11-24 15:26:24 +01:00
3e080c71c4
Upgrade shapely to v2
2026-11-24 15:22:58 +01:00
1db69037ba
Upgrade matplotlib
2026-11-24 15:20:55 +01:00
4224776f60
Upgrade numpy
2026-11-24 15:19:23 +01:00
4169da38b1
Upgrade statsmodels
2026-11-24 15:17:07 +01:00
706b0938c2
Upgrade packaging
2026-11-24 12:53:49 +01:00
c7f10f4c7f
Upgrade utm
2026-11-24 12:26:12 +01:00
4bc87eaf18
Upgrade rpy2
2026-11-24 12:22:24 +01:00
b44fc5f826
Upgrade googlemaps
2026-11-24 12:14:55 +01:00
629e3e6e3d
Upgrade geopy
2026-11-24 12:14:06 +01:00
dfc5cb7fb6
Upgrade ordered-set
2026-11-24 12:13:19 +01:00
9801baadee
Upgrade psycopg2
2026-11-24 12:12:10 +01:00
dcb2f82deb
Merge branch 'poetry-2' into develop
CI / Tests (Python 3.8) (push) Successful in 1m22s
2026-11-24 12:03:27 +01:00
95c760a0c3
Migrate to Poetry 2 and the standard [project] table
CI / Tests (Python 3.8) (push) Successful in 1m23s
2026-11-24 11:58:26 +01:00
754303ca71
Update the paper submodule to v1.0.2
2026-11-24 11:41:11 +01:00
5cc8a13719
Update the email address
2026-11-24 11:39:14 +01:00
3c6d3cbc65
Merge branch 'rename-to-velofy' into develop
CI / Tests (Python 3.8) (push) Successful in 1m39s
2026-11-24 11:16:26 +01:00
510c28c91e
Move the paper repository to Forgejo as velofy-forecasting
2026-11-24 11:15:38 +01:00
abc3ec5b3c
Rewrite the Forgejo links instead of GitHub links in the nox session
2026-11-24 11:15:20 +01:00
ce2cdd6f3e
Rename urban-meal-delivery into velofy in texts and notebook outputs
2026-11-24 10:56:25 +01:00
447533cceb
Point the links in the README, docs, and notebooks to Forgejo
2026-11-24 10:55:25 +01:00
8eb0dda0e1
Point the project URLs and texts to velofy
2026-11-24 10:34:32 +01:00
fa5b2690ad
Call the manage CLI in the notebooks
2026-11-24 10:28:38 +01:00
8e2536f45a
Replace the umd alias with velofy
2026-11-24 10:26:51 +01:00
e7a2d4a3cb
Rename the umd CLI into manage
2026-11-24 10:02:34 +01:00
4855209392
Rename the urban_meal_delivery package into velofy
2026-11-23 18:06:53 +01:00
a39d636876
Drop the temporary test schema in its own transaction
CI / Tests (Python 3.8) (push) Successful in 1m39s
2026-11-23 16:45:38 +01:00
f253c09f43
Run the test suite on the Forgejo runner
CI / Tests (Python 3.8) (push) Successful in 1m44s
2026-11-23 16:27:04 +01:00
2a3450f537
Mark the Python 3.8 baseline
CI / fast (without R) (push) Failing after 15s
CI / slow (with R) (push) Failing after 16s
2026-11-23 13:37:46 +01:00
830f44e3cc
Merge branch 'simulation-data' into develop
CI / fast (without R) (push) Has been cancelled
CI / slow (with R) (push) Has been cancelled
2021-09-16 13:21:42 +02:00
419c7e6bf6
Add tests for the Order ORM model
...
- so far, the check constraints were untested
+ the tests mirror the tests for the `ReplayedOrder` model
with some variations
- shorten some import names
- fix some typos
2021-09-16 12:05:22 +02:00
e4e543bd40
Add ORM models for the simulation data
...
- add new ORM models `ReplaySimulation` and `ReplayedOrder`
to store the data generated by the routing simulations
- add migrations script to create the corresponding database tables
+ create "replay_simulations" and "replayed_orders" tables
+ add missing check constraints to "orders" table
+ add unique constraint to "orders" table to enable compound key
+ drop unnecessary check constraints from the "orders" table
- add tests for the new ORM models
+ add `simulation`, `replayed_order`, `make_replay_order()`, and
`pre_order` fixtures
+ add `ReplayedOrderFactor` faker class
- fix some typos
2021-09-16 11:58:55 +02:00
41f75f507d
Use a unified DATE constant for convenience
2021-09-16 11:53:40 +02:00
f0eb9d3b6f
There is no 'too complex function'
...
We check a function's cognitive complexity only with `mccabe` (=C901)
and not with WPS231 as the two overlap in most cases.
2021-09-15 14:51:56 +02:00
6091ad95c6
Fix failing tests due to randomization
2021-09-15 12:00:03 +02:00
f891fac3dc
Refactor tests.db.fake_data.factories into a package
2021-09-15 11:58:17 +02:00
7e23033d84
There is no 'too deep nesting'
2021-09-15 11:58:13 +02:00
5978b0e92f
Modules are never 'too complex'
2021-09-15 11:47:38 +02:00
d03c2f91fb
Merge branch 'main' into develop
2021-09-13 11:37:37 +02:00
0f60640bc0
Show how the Google Maps API is integrated
...
CI / fast (without R) (push) Has been cancelled
CI / slow (with R) (push) Has been cancelled
- show an example order's path from the restaurant to the customer's
delivery address as it is travelled by a courier
- explain how to use the Google Maps API directly
- show how the API is integrated into the data model
2021-09-13 11:30:17 +02:00
f6b331883e
Merge branch 'release-0.4.0' into main
CI / fast (without R) (push) Has been cancelled
CI / slow (with R) (push) Has been cancelled
2021-09-13 11:22:42 +02:00
5eabd541e8
Merge branch 'release-0.4.0' into develop
2021-09-13 11:22:01 +02:00
19d7b6f3cc
Finalize release 0.4.0
2021-09-13 11:20:53 +02:00
97b75f2579
Merge branch 'google-maps' into develop
2021-09-13 11:11:53 +02:00
d83ff2e273
Add Order.draw() and Path.draw()
...
- `Order.draw()` plots a `Courier`'s path from the
`Order.pickup_address` to the `Order.delivery_address`
- `Path.draw()` plots a `Courier`'s path between any two
`Address` objects
2021-09-13 10:33:35 +02:00
2449492aba
Add Path.from_order() convenience method
...
Special case of `Path.from_addresses()` to create a single
`Path` object from an `Order.restaurant` to the `Customer`.
2021-09-13 09:57:25 +02:00
2d324b77eb
Rename DistanceMatrix into Path
...
- a `Path` is a better description for an instance of the model
- the `Location`s en route are renamed into `.waypoints`
- generic `assoc` is renamed into `path` in the test suite
2021-09-12 17:33:48 +02:00
2d08afa309
Upgrade sqlalchemy
...
Adapt code to prevent new warnings and errors (as of SQLAlchemy 1.4):
- Overlapping foreign key columns could be set in a conflicting way
=> This is prevented by the application logic
=> Ignore the warning by setting a `overlaps` flag
- Transaction already rolled back
=> This only happens when tests cause an `IntegrityError` on purpose
=> Filter away the corresponding warning in the fixture
- Query returns `Row` objects and not scalars
=> Add genexpr to pull out `primary_id`
2021-09-12 16:52:51 +02:00
3bef9ca38d
Remove flake8-expression-complexity ...
...
... from the dev dependencies.
Longer queries in SQLAlchemy get flagged even though they are not
complicated. Other expressions are generally not that complicated.
2021-09-12 16:52:44 +02:00
1c19da2f70
Solve all issues detected by PyCharm
...
- as of September 2021, PyCharm is used to write some of the code
- PyCharm's built-in code styler, linter, and type checker issued
some warnings that are resolved in this commit
+ spelling mistakes
+ all instance attributes must be specified explicitly
in a class's __init__() method
=> use `functools.cached_property` for caching
+ make `tuple`s explicit with `(...)`
+ one test failed randomly although everything is ok
=> adjust the fixture's return value (stub for Google Directions API)
+ reformulate SQL so that PyCharm can understand the symbols
2021-09-12 16:51:12 +02:00
1268aba017
Pin the dependencies ...
...
... after upgrading:
- alembic
- geopy
- googlemaps
- psycopg2
- rpy2
- dev dependencies
+ coverage + darglint + flake8 + flake8-annotations
+ flake8-black + flake8-comprehensions + flake8-docstrings
+ flake8-pytest-style + pre-commit + pytest
+ pytest-cov + pytest-mock + sphinx + sphinx-autodoc-typehints
- research dependencies
+ jupyterlab + matplotlib + numpy + pandas
- transient dependencies
+ argcomplete + argon2-cffi + attrs + babel
+ bleach + certifi + cffi + cfgv
+ chardset-normalizer + colorlog + debugpy
+ decorator + defusedxml + distlib + geographiclib
+ gitdb + gitpython + greenlet + identify
+ idna + importlib-resources + ipykernel
+ ipython + jinja2 + json5 + jupyter-client
+ kiwisolver + mako + markupsafe
+ nbclient + nbconvert + nbformat + nodeenv
+ notebook + parso + pathspec + pbr
+ pillow + platformdirs + pluggy + prometheus-client
+ prompt-toolkit + pycodestyle + pydocstyle + pyflakes
+ pygments + pyristent + python-dateutil
+ pywin32 + pywinpty + pyzmq + regex
+ requests + scipy + send2trash + six
+ smmap + sphinxcontrib-htmlhelp
+ sphinxcontrib-serializinghtml + stevedore + terminado
+ textfixtures + testpath + traitlets + typed-ast
+ typing-extensions + tzdata + tzlocal
+ urllib3 + virtualenv + zipp
2021-09-12 16:51:12 +02:00
6636e56ec8
Upgrade flake8-pytest-style
...
The newly introduced "P023" error code must be disabled explicitly.
2021-09-12 16:51:11 +02:00
fa3b761054
Remove pytest-randomly from the dev dependencies
...
- problem: because of the randomization of test cases, every once in a
while, the schema holding the test db already exists and cannot be
created a second time (background: we run all tests against a db
created with `metadate.create_all()` by SQLAlchemy at once and
a db created by running all incremental Alchemy migration scripts)
- quick fix: possible, we could find a way to run all tests against
one of the two test db's in random order and then against the other
=> in the interest of time, we simply do not randomize the test cases
2021-09-12 16:51:11 +02:00
322ce57062
Make mypy a bit stricter
2021-09-12 16:51:11 +02:00
2ba4914af7
Ignore PyCharm's .idea/ folder
2021-09-12 16:51:10 +02:00
db715edd6d
Add constructor for the DistanceMatrix class
...
- `DistanceMatrix.from_addresses()` takes a variable number of
`Address` objects and creates distance matrix entries for them
- as a base measure, the air distance between two `Address`
objects is calculated
- in addition, an integration with the Google Maps Directions API is
implemented that provides a more realistic measure of the distance
and duration a rider on a bicycle would need to travel between two
`Address` objects
- add a `Location.lat_lng` convenience property that provides the
`.latitude` and `.longitude` of an `Address` as a 2-`tuple`
2021-09-12 16:51:10 +02:00
5e9307523c
Add ordered-set to the dependencies
2021-09-12 16:51:10 +02:00
cc75307e5a
Add DistanceMatrix class
...
- the class stores the data of a distance matrix between all addresses
+ air distances
+ bicycle distances
- in addition, the "path" returned by the Google Directions API are
also stored as a JSON serialized sequence of latitude-longitude pairs
- we assume a symmetric graph
2021-09-12 16:51:10 +02:00
28368cc30a
Add geopy to the dependencies
2021-09-12 16:51:09 +02:00
3dd848605c
Add googlemaps to the dependencies
2021-09-12 16:51:09 +02:00
6c03261b07
Merge branch 'main' into develop
2021-03-01 14:45:24 +01:00
f5ced933d6
Merge branch 'tactical-forecasting' into main
CI / fast (without R) (push) Has been cancelled
CI / slow (with R) (push) Has been cancelled
2021-03-01 14:13:21 +01:00
9d6de9d98c
Create tactical demand forecasts
...
- the first notebook runs the tactical-forecasts command
- the second notebook describes the tactical demand forecasting process
+ demand aggregation on a per-pixel level
+ time series generation: horizontal, vertical, and real-time time series
+ STL decomposition into seasonal, trend, and residual components
+ choosing the most promising forecasting model
+ predicting demand with various models
- fix where to re-start the forecasting process after it was interrupted
- enable the heuristic for choosing the most promising model
to also work for 7 training weeks
2021-02-09 17:06:37 +01:00
21d012050c
Add visualization scripts for customers/restaurants
...
- the two notebook files are helpful in visualizing all relevant
pickup (red) or delivery (blue) locations from the point of view
of either e restaurant or a customer
2021-02-04 16:19:12 +01:00
40471b883c
Add infos on tactical demand forecasting
2021-02-04 16:12:25 +01:00
915aa4d3b4
Merge branch 'release-0.3.0' into develop
2021-02-04 13:23:39 +01:00