Add ORM models for the pixel grids

- add Grid, Pixel, and AddressPixelAssociation ORM models
- each Grid belongs to a City an is characterized by the side_length
  of all the square Pixels contained in it
- Pixels aggregate Addresses => many-to-many relationship (that is
  modeled with SQLAlchemy's Association Pattern to implement a couple
  of constraints)
This commit is contained in:
Alexander Hess 2021-01-03 19:33:36 +01:00
commit f996376b13
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
15 changed files with 665 additions and 36 deletions

View file

@ -89,6 +89,8 @@ extend-ignore =
# Comply with black's style.
# Source: https://github.com/psf/black/blob/master/docs/compatible_configs.md#flake8
E203, W503, WPS348,
# String constant over-use is checked visually by the programmer.
WPS226,
# Allow underscores in numbers.
WPS303,
# f-strings are ok.
@ -114,8 +116,6 @@ per-file-ignores =
WPS114,WPS118,
# Revisions may have too many expressions.
WPS204,WPS213,
# No overuse of string constants (e.g., 'RESTRICT').
WPS226,
# Too many noqa's are ok.
WPS402,
noxfile.py:
@ -125,8 +125,6 @@ per-file-ignores =
WPS202,
# TODO (isort): Remove after simplifying the nox session "lint".
WPS213,
# No overuse of string constants (e.g., '--version').
WPS226,
# The noxfile is rather long => allow many noqa's.
WPS402,
src/urban_meal_delivery/configuration.py:
@ -134,13 +132,9 @@ per-file-ignores =
WPS115,
# Numbers are normal in config files.
WPS432,
# No real string constant over-use.
src/urban_meal_delivery/db/addresses.py:
WPS226,
src/urban_meal_delivery/db/cities.py:
WPS226,
src/urban_meal_delivery/db/orders.py:
WPS226,
src/urban_meal_delivery/db/__init__.py:
# Top-level of a sub-packages is intended to import a lot.
F401,
tests/*.py:
# Type annotations are not strictly enforced.
ANN0, ANN2,
@ -158,14 +152,15 @@ per-file-ignores =
WPS202,WPS204,WPS214,
# Do not check for Jones complexity in the test suite.
WPS221,
# No overuse of string constants (e.g., '__version__').
WPS226,
# We do not care about the number of "# noqa"s in the test suite.
WPS402,
# Allow closures.
WPS430,
# Numbers are normal in test cases as expected results.
WPS432,
tests/db/fake_data/__init__.py:
# Top-level of a sub-packages is intended to import a lot.
F401,WPS201,
# Explicitly set mccabe's maximum complexity to 10 as recommended by
# Thomas McCabe, the inventor of the McCabe complexity, and the NIST.