Commit graph velofy/src
Author SHA1 Message Date
0a5f8f6c55
Enable "warn_return_any" 2026-12-01 12:39:45 +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
e4016db9fe
Enable "no_implicit_reexport"
Also, remove the unused `orm_exc` import alias
2026-12-01 12:37:46 +01:00
2bc2408694
Type-check pandas with pandas-stubs
All checks were successful
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
e612e33f59
Enable PIE in flake8 and ruff 2026-11-30 23:40:15 +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
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
0a4fd0edbc
Enable PERF in ruff 2026-11-30 22:06:44 +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
cf2534f41e
Import velofy.config as pkg_config everywhere 2026-11-30 20:19:35 +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
5ca16ae47c
Import datetime as dt everywhere 2026-11-30 15:50:17 +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
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
2b112f46e2
Remove the no longer used engine and connection globals
All checks were successful
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
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