Adjust flake8 to not consider constants magic
This commit is contained in:
parent
a1da1e9af8
commit
de3e489b39
7 changed files with 13 additions and 17 deletions
|
@ -107,13 +107,13 @@ def upgrade():
|
|||
sa.Column('id', sa.Integer(), autoincrement=False, nullable=False),
|
||||
sa.Column('primary_id', sa.Integer(), nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=False),
|
||||
sa.Column('place_id', sa.Unicode(length=120), nullable=False), # noqa:WPS432
|
||||
sa.Column('place_id', sa.Unicode(length=120), nullable=False),
|
||||
sa.Column('latitude', postgresql.DOUBLE_PRECISION(), nullable=False),
|
||||
sa.Column('longitude', postgresql.DOUBLE_PRECISION(), nullable=False),
|
||||
sa.Column('city_id', sa.SmallInteger(), nullable=False),
|
||||
sa.Column('city', sa.Unicode(length=25), nullable=False), # noqa:WPS432
|
||||
sa.Column('city', sa.Unicode(length=25), nullable=False),
|
||||
sa.Column('zip_code', sa.Integer(), nullable=False),
|
||||
sa.Column('street', sa.Unicode(length=80), nullable=False), # noqa:WPS432
|
||||
sa.Column('street', sa.Unicode(length=80), nullable=False),
|
||||
sa.Column('floor', sa.SmallInteger(), nullable=True),
|
||||
sa.CheckConstraint(
|
||||
'-180 <= longitude AND longitude <= 180',
|
||||
|
@ -192,7 +192,7 @@ def upgrade():
|
|||
'restaurants',
|
||||
sa.Column('id', sa.SmallInteger(), autoincrement=False, nullable=False),
|
||||
sa.Column('created_at', sa.DateTime(), nullable=False),
|
||||
sa.Column('name', sa.Unicode(length=45), nullable=False), # noqa:WPS432
|
||||
sa.Column('name', sa.Unicode(length=45), nullable=False),
|
||||
sa.Column('address_id', sa.Integer(), nullable=False),
|
||||
sa.Column('estimated_prep_duration', sa.SmallInteger(), nullable=False),
|
||||
sa.CheckConstraint(
|
||||
|
|
|
@ -31,7 +31,7 @@ def upgrade():
|
|||
sa.Column('start_at', sa.DateTime(), nullable=False),
|
||||
sa.Column('time_step', sa.SmallInteger(), nullable=False),
|
||||
sa.Column('training_horizon', sa.SmallInteger(), nullable=False),
|
||||
sa.Column('method', sa.Unicode(length=20), nullable=False), # noqa:WPS432
|
||||
sa.Column('method', sa.Unicode(length=20), nullable=False),
|
||||
sa.Column('prediction', postgresql.DOUBLE_PRECISION(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id', name=op.f('pk_forecasts')),
|
||||
sa.ForeignKeyConstraint(
|
||||
|
|
|
@ -105,6 +105,8 @@ extend-ignore =
|
|||
WPS412,
|
||||
# Allow multiple assignment, e.g., x = y = 123
|
||||
WPS429,
|
||||
# There are no magic numbers.
|
||||
WPS432,
|
||||
|
||||
per-file-ignores =
|
||||
# Top-levels of a sub-packages are intended to import a lot.
|
||||
|
@ -137,8 +139,6 @@ per-file-ignores =
|
|||
src/urban_meal_delivery/configuration.py:
|
||||
# Allow upper case class variables within classes.
|
||||
WPS115,
|
||||
# Numbers are normal in config files.
|
||||
WPS432,
|
||||
src/urban_meal_delivery/forecasts/decomposition.py:
|
||||
# The module does not have a high cognitive complexity.
|
||||
WPS232,
|
||||
|
@ -166,8 +166,6 @@ per-file-ignores =
|
|||
WPS402,
|
||||
# Allow closures.
|
||||
WPS430,
|
||||
# Numbers are normal in test cases as expected results.
|
||||
WPS432,
|
||||
# When testing, it is normal to use implementation details.
|
||||
WPS437,
|
||||
|
||||
|
|
|
@ -18,15 +18,13 @@ class Address(meta.Base):
|
|||
id = sa.Column(sa.Integer, primary_key=True, autoincrement=False) # noqa:WPS125
|
||||
_primary_id = sa.Column('primary_id', sa.Integer, nullable=False, index=True)
|
||||
created_at = sa.Column(sa.DateTime, nullable=False)
|
||||
place_id = sa.Column(
|
||||
sa.Unicode(length=120), nullable=False, index=True, # noqa:WPS432
|
||||
)
|
||||
place_id = sa.Column(sa.Unicode(length=120), nullable=False, index=True)
|
||||
latitude = sa.Column(postgresql.DOUBLE_PRECISION, nullable=False)
|
||||
longitude = sa.Column(postgresql.DOUBLE_PRECISION, nullable=False)
|
||||
city_id = sa.Column(sa.SmallInteger, nullable=False, index=True)
|
||||
city_name = sa.Column('city', sa.Unicode(length=25), nullable=False) # noqa:WPS432
|
||||
city_name = sa.Column('city', sa.Unicode(length=25), nullable=False)
|
||||
zip_code = sa.Column(sa.Integer, nullable=False, index=True)
|
||||
street = sa.Column(sa.Unicode(length=80), nullable=False) # noqa:WPS432
|
||||
street = sa.Column(sa.Unicode(length=80), nullable=False)
|
||||
floor = sa.Column(sa.SmallInteger)
|
||||
|
||||
# Constraints
|
||||
|
|
|
@ -21,7 +21,7 @@ class Forecast(meta.Base):
|
|||
start_at = sa.Column(sa.DateTime, nullable=False)
|
||||
time_step = sa.Column(sa.SmallInteger, nullable=False)
|
||||
training_horizon = sa.Column(sa.SmallInteger, nullable=False)
|
||||
model = sa.Column(sa.Unicode(length=20), nullable=False) # noqa:WPS432
|
||||
model = sa.Column(sa.Unicode(length=20), nullable=False)
|
||||
# Raw `.prediction`s are stored as `float`s (possibly negative).
|
||||
# The rounding is then done on the fly if required.
|
||||
prediction = sa.Column(postgresql.DOUBLE_PRECISION, nullable=False)
|
||||
|
|
|
@ -51,7 +51,7 @@ class Grid(meta.Base):
|
|||
@property
|
||||
def pixel_area(self) -> float:
|
||||
"""The area of a `Pixel` on the grid in square kilometers."""
|
||||
return round((self.side_length ** 2) / 1_000_000, 1) # noqa:WPS432
|
||||
return round((self.side_length ** 2) / 1_000_000, 1)
|
||||
|
||||
@classmethod
|
||||
def gridify(cls, city: db.City, side_length: int) -> db.Grid:
|
||||
|
|
|
@ -21,7 +21,7 @@ class Restaurant(meta.Base):
|
|||
sa.SmallInteger, primary_key=True, autoincrement=False,
|
||||
)
|
||||
created_at = sa.Column(sa.DateTime, nullable=False)
|
||||
name = sa.Column(sa.Unicode(length=45), nullable=False) # noqa:WPS432
|
||||
name = sa.Column(sa.Unicode(length=45), nullable=False)
|
||||
address_id = sa.Column(sa.Integer, nullable=False, index=True)
|
||||
estimated_prep_duration = sa.Column(sa.SmallInteger, nullable=False)
|
||||
|
||||
|
|
Loading…
Reference in a new issue