Contributing to the Project

In order to contribute, please follow these steps:

  • Install PlaFoSim from source (see Extending PlaFoSim)

  • Make desired changes and adjust the documentation if required

  • Run the tests located in tests as well as the validation scripts located in scripts (see .drone.yml for details)

  • Submit a Pull Request (PR)

Documenting

When making changes to the code, make sure to add or adjust corresponding documentation in form of python docstrings. Those should use the Numpy docstring format for Sphinx and follow the style guide by numpydoc to ensure consistency and compatibility. See also the style guide by pandas. You can build the documentation using Sphinx make -C docs.

Testing

When adding methods and functions, make sure to add corresponding unit tests for py.test. The tests are located under tests and can be executed with ./scripts/run-pytest.sh. This will also generate a test coverage report.

Validation

To validate the behavior of PlaFoSim, it is compared to SUMO 1.6.0 by means of simulation results (e.g., vehicle traces). The corresponding scripts are located under scripts and executed withn CI/CD pipelines. You can have a look at .drone.yml for details regarding the execution.

Profiling

You can profile the runtime of PlaFoSim’s code by using cProfile:

poetry run python -m cProfile -o profile.out -m plafosim.cli.plafosim

You can visualize the results of the profiling run by using SnakeViz:

snakeviz profile.out