Skip to main content

No project description provided

Project description

Unit Tests Code style: black

eflips-eval


Part of the eFLIPS/simBA list of projects.


This repository contains code to evaluate an eflips/simBA simulation. It provides the eflips.evalpackage, which contains functions to prepare (database -> pandas DataFrame) and visualize (pandas DataFrame -> plotly) simulation results.

It is organized hierarchically as follows:

  • eflips.eval.input contains functions to prepare and visualize simulation input data. That means it does not access any data from the Event or Vehicle classes.
  • eflips.eval.output contains functions to prepare and visualize simulation output data. That means these functions all access the Event or Vehicle classes.
  • within each package, there is a prepare and a visualize module. The prepare module contains functions to prepare the data, the visualize module contains functions to visualize the data. The functions must conform tp a naming convention, in which for the eflips.eval.input.preapre.foo(), there must also exist a eflips.eval.input.visualize.foo() method and vice versa. However, when the exact same data can be visualized in multiple ways, there can also be a eflips.eval.input.visualize.foo_scatter() and a eflips.eval.input.visualize.foo_hist() method.
  • the signature of a prepare method is always prepare(identifier(s), session) -> pd.DataFrame, where identifier(s) is a single or tuple of ints identifying a specific database object and session is a sqlalchemy.orm.session.Session object that is used to access the database.
  • the signature of a visualize method is always visualize(df: pd.DataFrame, **kwargs) -> plotly.graph_objects.Figure, where df is the DataFrame that is to be visualized and kwargs are additional arguments that can be used to customize the visualization. it does however create a legend (if necessary) and sets axis labels.
  • a visualize function does not make assumptions about the size of the viewport and does not set the title of the plot.
  • The resulting plots should be in english, with proper names (e.g. "Distance [km]" instead of total_dist) for the values that would be shown to the user.

Installation

TODO

Usage

TODO

Testing

TODO

Documentation

The documentation is generated using sphinx. To generate the documentation, execute the following command in the root directory of the repository:

sphinx-build doc/ doc/_build -W

Development

We utilize the GitHub Flow branching structure. This means that the main branch is always deployable and that all development happens in feature branches. The feature branches are merged into main via pull requests. We utilize the semantic versioning scheme for versioning.

Dependencies are managed using poetry. To install the dependencies, execute the following command in the root directory of the repository:

poetry install

We use black for code formatting. You can use black . to format the code.

We use MyPy for static type checking. You can use mypy --strict --explicit-package-bases eflips/ to run MyPy on the code.

Please make sure that your poetry.lock and pyproject.toml files are consistent before committing. You can use poetry check to check this. This is also checked by pre-commit.

You can use pre-commit to ensure that MyPy, Black, and Poetry are run before committing. To install pre-commit, execute the following command in the root directory of the repository:

We recommend utilizing linters such as PyLint for static code analysis (but not doing everything it says blindly).

Usage Example

In examples an example script can be found that generates a report.

License

This project is licensed under the AGPLv3 license - see the LICENSE file for details.

Funding Notice

This code was developed as part of the project eBus2030+ funded by the Federal German Ministry for Digital and Transport (BMDV) under grant number 03EMF0402.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eflips_eval-1.7.4.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eflips_eval-1.7.4-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file eflips_eval-1.7.4.tar.gz.

File metadata

  • Download URL: eflips_eval-1.7.4.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for eflips_eval-1.7.4.tar.gz
Algorithm Hash digest
SHA256 aeded0b9af87ce27c0c8a3492ea96d7583b956056477f61abf2b1489a69d9a5c
MD5 5e4f67a25c65f8e5873f748dde508b24
BLAKE2b-256 dc22f3ff36b03f20e350301a3727b47766a26ffec11d6be59872df64f403be3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for eflips_eval-1.7.4.tar.gz:

Publisher: release.yml on mpm-tu-berlin/eflips-eval

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file eflips_eval-1.7.4-py3-none-any.whl.

File metadata

  • Download URL: eflips_eval-1.7.4-py3-none-any.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for eflips_eval-1.7.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2f325dc1e12c3a449ab5667480eb335cce70585fc67b33225df614351e07e6c3
MD5 ac6c97b4aefee8b8890f26a10570c0e5
BLAKE2b-256 57eb362ba18fc5f2bdd2d0957d29a89442be179a91c7f38277fd1fb8c376554b

See more details on using hashes here.

Provenance

The following attestation bundles were made for eflips_eval-1.7.4-py3-none-any.whl:

Publisher: release.yml on mpm-tu-berlin/eflips-eval

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page