Add aggregate_orders() function

- the function queries the database and aggregates the ad-hoc orders
  by pixel and time steps into a demand time series
- implement "heavy" integration tests for `aggregate_orders()`
- make `pandas` a package dependency
- streamline the `Config`
This commit is contained in:
Alexander Hess 2021-01-07 23:18:40 +01:00
commit d5b3efbca1
Signed by: alexander
GPG key ID: 344EA5AB10D868E0
10 changed files with 460 additions and 6 deletions

View file

@ -43,7 +43,7 @@ class Grid(meta.Base):
def __repr__(self) -> str:
"""Non-literal text representation."""
return '<{cls}: {area}>'.format(
return '<{cls}: {area} sqr. km>'.format(
cls=self.__class__.__name__, area=self.pixel_area,
)
@ -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 (self.side_length ** 2) / 1_000_000 # noqa:WPS432
return round((self.side_length ** 2) / 1_000_000, 1) # noqa:WPS432
@classmethod
def gridify(cls, city: db.City, side_length: int) -> db.Grid: