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
|
|
@ -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…
Add table
Add a link
Reference in a new issue