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
This commit is contained in:
parent
1268aba017
commit
1c19da2f70
1 changed files with 136 additions and 151 deletions
|
|
@ -34,8 +34,9 @@ def gridify() -> None: # pragma: no cover note:b1f68d24
|
|||
|
||||
click.echo(f' -> created {len(grid.pixels)} pixels')
|
||||
|
||||
# The number of assigned addresses is the same across different `side_length`s.
|
||||
db.session.flush() # necessary for the query to work
|
||||
# Because the number of assigned addresses is the same across
|
||||
# different `side_length`s, we can take any `grid` from the `city`.
|
||||
grid = db.session.query(db.Grid).filter_by(city=city).first()
|
||||
n_assigned = (
|
||||
db.session.query(db.AddressPixelAssociation)
|
||||
.filter(db.AddressPixelAssociation.grid_id == grid.id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue