Skip to content
  1. Sep 13, 2021
  2. Sep 12, 2021
    • Alexander Hess's avatar
      Rename `DistanceMatrix` into `Path` · 2d324b77
      Alexander Hess authored
      - a `Path` is a better description for an instance of the model
      - the `Location`s en route are renamed into `.waypoints`
      - generic `assoc` is renamed into `path` in the test suite
      2d324b77
    • Alexander Hess's avatar
      Upgrade sqlalchemy · 2d08afa3
      Alexander Hess authored
      Adapt code to prevent new warnings and errors (as of SQLAlchemy 1.4):
      - Overlapping foreign key columns could be set in a conflicting way
        => This is prevented by the application logic
        => Ignore the warning by setting a `overlaps` flag
      - Transaction already rolled back
        => This only happens when tests cause an `IntegrityError` on purpose
        => Filter away the corresponding warning in the fixture
      - Query returns `Row` objects and not scalars
        => Add genexpr to pull out `primary_id`
      2d08afa3
    • Alexander Hess's avatar
      Remove flake8-expression-complexity ... · 3bef9ca3
      Alexander Hess authored
      ... from the dev dependencies.
      
      Longer queries in SQLAlchemy get flagged even though they are not
      complicated. Other expressions are generally not that complicated.
      3bef9ca3
    • Alexander Hess's avatar
      Solve all issues detected by PyCharm · 1c19da2f
      Alexander Hess authored
      - 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
      1c19da2f
    • Alexander Hess's avatar
      Pin the dependencies ... · 1268aba0
      Alexander Hess authored
      ... after upgrading:
      - alembic
      - geopy
      - googlemaps
      - psycopg2
      - rpy2
      - dev dependencies
        + coverage       + darglint      + flake8      + flake8-annotations
        + flake8-black   + flake8-comprehensions       + flake8-docstrings
        + flake8-pytest-style            + pre-commit  + pytest
        + pytest-cov     + pytest-mock   + sphinx      + sphinx-autodoc-typehints
      - research dependencies
        + jupyterlab     + matplotlib    + numpy       + pandas
      - transient dependencies
        + argcomplete    + argon2-cffi   + attrs       + babel
        + bleach         + certifi       + cffi        + cfgv
        + chardset-normalizer            + colorlog    + debugpy
        + decorator      + defusedxml    + distlib     + geographiclib
        + gitdb          + gitpython     + greenlet    + identify
        + idna           + importlib-resources         + ipykernel
        + ipython        + jinja2        + json5       + jupyter-client
        + kiwisolver     + mako          + markupsafe
        + nbclient       + nbconvert     + nbformat    + nodeenv
        + notebook       + parso         + pathspec    + pbr
        + pillow         + platformdirs  + pluggy      + prometheus-client
        + prompt-toolkit + pycodestyle   + pydocstyle  + pyflakes
        + pygments       + pyristent     + python-dateutil
        + pywin32        + pywinpty      + pyzmq       + regex
        + requests       + scipy         + send2trash  + six
        + smmap          + sphinxcontrib-htmlhelp
        + sphinxcontrib-serializinghtml  + stevedore   + terminado
        + textfixtures   + testpath      + traitlets   + typed-ast
        + typing-extensions              + tzdata      + tzlocal
        + urllib3        + virtualenv    + zipp
      1268aba0
    • Alexander Hess's avatar
      Upgrade flake8-pytest-style · 6636e56e
      Alexander Hess authored
      The newly introduced "P023" error code must be disabled explicitly.
      6636e56e
    • Alexander Hess's avatar
      Remove pytest-randomly from the dev dependencies · fa3b7610
      Alexander Hess authored
      - problem: because of the randomization of test cases, every once in a
        while, the schema holding the test db already exists and cannot be
        created a second time (background: we run all tests against a db
        created with `metadate.create_all()` by SQLAlchemy at once and
        a db created by running all incremental Alchemy migration scripts)
      - quick fix: possible, we could find a way to run all tests against
        one of the two test db's in random order and then against the other
        => in the interest of time, we simply do not randomize the test cases
      fa3b7610
    • Alexander Hess's avatar
      Make mypy a bit stricter · 322ce570
      Alexander Hess authored
      322ce570
    • Alexander Hess's avatar
      Ignore PyCharm's .idea/ folder · 2ba4914a
      Alexander Hess authored
      2ba4914a
    • Alexander Hess's avatar
      Add constructor for the `DistanceMatrix` class · db715edd
      Alexander Hess authored
      - `DistanceMatrix.from_addresses()` takes a variable number of
        `Address` objects and creates distance matrix entries for them
      - as a base measure, the air distance between two `Address`
        objects is calculated
      - in addition, an integration with the Google Maps Directions API is
        implemented that provides a more realistic measure of the distance
        and duration a rider on a bicycle would need to travel between two
        `Address` objects
      - add a `Location.lat_lng` convenience property that provides the
        `.latitude` and `.longitude` of an `Address` as a 2-`tuple`
      db715edd
    • Alexander Hess's avatar
      Add ordered-set to the dependencies · 5e930752
      Alexander Hess authored
      5e930752
    • Alexander Hess's avatar
      Add `DistanceMatrix` class · cc75307e
      Alexander Hess authored
      - the class stores the data of a distance matrix between all addresses
        + air distances
        + bicycle distances
      - in addition, the "path" returned by the Google Directions API are
        also stored as a JSON serialized sequence of latitude-longitude pairs
      - we assume a symmetric graph
      cc75307e
    • Alexander Hess's avatar
      Add geopy to the dependencies · 28368cc3
      Alexander Hess authored
      28368cc3
    • Alexander Hess's avatar
      Add googlemaps to the dependencies · 3dd84860
      Alexander Hess authored
      3dd84860
  3. Mar 01, 2021
  4. Feb 09, 2021
    • Alexander Hess's avatar
      Create tactical demand forecasts · 9d6de9d9
      Alexander Hess authored
      - the first notebook runs the tactical-forecasts command
      - the second notebook describes the tactical demand forecasting process
        + demand aggregation on a per-pixel level
        + time series generation: horizontal, vertical, and real-time time series
        + STL decomposition into seasonal, trend, and residual components
        + choosing the most promising forecasting model
        + predicting demand with various models
      - fix where to re-start the forecasting process after it was interrupted
      - enable the heuristic for choosing the most promising model
        to also work for 7 training weeks
      9d6de9d9
  5. Feb 04, 2021
  6. Feb 02, 2021
  7. Feb 01, 2021
    • Alexander Hess's avatar
      Fix nox session for slow CI tests · 8926e9ff
      Alexander Hess authored
      - when running tests marked with "r" we still must not run tests
        marked with "db" on the CI server
      8926e9ff
    • Alexander Hess's avatar
      Add `OrderHistory.avg_daily_demand()` · cb7611d5
      Alexander Hess authored
      - the method calculates the number of daily `Order`s in a `Pixel`
        withing the `train_horizon` preceding the `predict_day`
      cb7611d5
    • Alexander Hess's avatar
      Add `urban_meal_delivery.forecasts.models` sub-package · 67cd58cf
      Alexander Hess authored
      - `*Model`s use the `methods.*.predict()` functions to predict demand
        given an order time series generated by `timify.OrderHistory`
      - `models.base.ForecastingModelABC` unifies how all `*Model`s work
        and implements a caching strategy
      - implement three `*Model`s for tactical forecasting, based on the
        hets, varima, and rtarima models described in the first research paper
      - add overall documentation for `urban_meal_delivery.forecasts` package
      - move the fixtures in `tests.forecasts.timify.conftest` to
        `tests.forecasts.conftest` and adjust the horizon of the test horizon
        from two to three weeks
      67cd58cf
Loading