|
1 | | - |
2 | 1 | <div align="center"> |
3 | | - <img src="docs/source/_static/logo_text.svg" height="100px" alt="PedPy Logo"> |
| 2 | + <img src="https://raw.githubusercontent.com/PedestrianDynamics/PedPy/refs/heads/main/docs/source/_static/logo_text.svg" height="100px" alt="PedPy Logo"> |
4 | 3 | </div> |
5 | 4 |
|
6 | | ------------------ |
| 5 | +<div align="center"> |
| 6 | + |
7 | 7 | [](https://pypi.org/project/pedpy/) |
8 | 8 |  |
9 | 9 | [](https://doi.org/10.5281/zenodo.7194992) |
10 | 10 | [](https://github.com/PedestrianDynamics/pedpy/blob/main/LICENSE) |
11 | | - |
| 11 | + |
12 | 12 | [](https://codecov.io/gh/PedestrianDynamics/PedPy) |
13 | 13 | [](https://github.com/astral-sh/ruff) |
14 | 14 | [](http://pedpy.readthedocs.io/?badge=latest) |
15 | 15 | [](https://bestpractices.coreinfrastructure.org/projects/7046) |
16 | 16 | [](https://fair-software.eu) |
17 | 17 | [](https://www.fz-juelich.de/en/rse/jurse-community/jurse-code-of-the-month/july-2025) |
18 | 18 |
|
19 | | -# PedPy: Analysis of pedestrian dynamics based on trajectory files. |
| 19 | +</div> |
20 | 20 |
|
21 | | -*PedPy* is a python module for pedestrian movement analysis. |
22 | | -It implements different measurement methods for density, velocity and flow. |
| 21 | +# PedPy |
23 | 22 |
|
24 | | -If you use *PedPy* in your work, please cite it using the following information from zenodo: |
| 23 | +**PedPy** is a Python library for quantitative analysis of pedestrian dynamics from trajectory data. |
25 | 24 |
|
26 | | -[](https://doi.org/10.5281/zenodo.7194992) |
| 25 | +It provides a high-level interface for extracting fundamental measures (density, velocity, flow) and advanced analyses such as Voronoi-based methods, profiles, and pair-distribution functions, which can be combined to derive fundamental diagrams. |
27 | 26 |
|
28 | 27 |
|
29 | | -## Getting started |
| 28 | +## Features |
30 | 29 |
|
31 | | -### Setup Python |
| 30 | +- Compute core pedestrian measures: density, velocity, flow |
| 31 | +- Advanced analyses: Voronoi-based density, profiles, pair-distribution functions |
| 32 | +- Directly load trajectory data from multiple tools: Crowdit, Viswalk, JuPedSim, Vadere, Pathfinder |
| 33 | +- Easy-to-use API for loading, processing, and visualizing data |
| 34 | +- Built-in plotting for quick inspection and comparison of results |
| 35 | +- Open-source, tested, and aligned with FAIR and OpenSSF best practices |
32 | 36 |
|
33 | | -For setting up your Python Environment a Python version >= 3.11 is recommended (our code is tested with 3.11, 3.12, and 3.13). |
34 | | -To avoid conflicts with other libraries/applications the usage of virtual environments is recommended, see [Python Documentation](https://docs.python.org/3/library/venv.html) for more detail. |
| 37 | +## Getting Started |
35 | 38 |
|
36 | | -### Installing PedPy |
| 39 | +### Installation |
| 40 | + |
| 41 | +**PedPy** requires Python >= 3.11. |
| 42 | +It is recommended to use a [virtual environment](https://docs.python.org/3/library/venv.html). |
| 43 | + |
| 44 | +Install the latest stable release from PyPI: |
37 | 45 |
|
38 | | -To install the latest **stable** version of *PedPy* and its dependencies from PyPI: |
39 | 46 | ```bash |
40 | 47 | python3 -m pip install pedpy |
41 | 48 | ``` |
42 | 49 |
|
43 | | -You can also install the latest version of *PedPy* directly from the repository, by following these steps: |
| 50 | +To install the latest development version from the repository: |
44 | 51 |
|
45 | | -1. Uninstall an installed version of *PedPy*: |
46 | 52 | ```bash |
47 | | -python3 -m pip uninstall pedpy |
| 53 | +python3 -m pip install --force-reinstall git+https://github.com/PedestrianDynamics/PedPy.git |
48 | 54 | ``` |
49 | 55 |
|
50 | | -2. Install latest version of *PedPy* from repository: |
51 | | -``` |
52 | | -python3 -m pip install git+https://github.com/PedestrianDynamics/PedPy.git |
| 56 | +> [!IMPORTANT] |
| 57 | +> The latest repository version may be unstable. Use with caution. |
| 58 | +
|
| 59 | +### Quickstart |
| 60 | + |
| 61 | +```python |
| 62 | +from pedpy import * |
| 63 | + |
| 64 | +# Load trajectory data from file |
| 65 | +traj = load_trajectory( |
| 66 | + trajectory_file=pathlib.Path("some_trajectory_data.txt") |
| 67 | +) |
| 68 | + |
| 69 | +# Create measurement area |
| 70 | +measurement_area = MeasurementArea( |
| 71 | + [(-0.4, 0.5), (0.4, 0.5), (0.4, 1.3), (-0.4, 1.3)] |
| 72 | +) |
| 73 | + |
| 74 | +# Compute classic density in the measurement area |
| 75 | +classic_density = compute_classic_density( |
| 76 | + traj_data=traj, measurement_area=measurement_area |
| 77 | +) |
| 78 | + |
| 79 | +plot_density(density=classic_density, title="Classic density") |
53 | 80 | ``` |
54 | 81 |
|
| 82 | +See the [Getting Started Guide](https://pedpy.readthedocs.io/stable/getting_started.html) for a step-by-step introduction. |
| 83 | +A more extensive documentation and demonstration of **PedPy**'s capabilities can be found in the [User Guide](https://pedpy.readthedocs.io/stable/user_guide.html). |
| 84 | + |
| 85 | + |
55 | 86 | ### Usage |
56 | 87 |
|
57 | | -For first time users, have a look at the [getting started notebook](notebooks/getting_started.ipynb), as it shows the first steps to start an analysis with *PedPy*. |
58 | | -A more detailed overview of *PedPy* is demonstrated in the [user guide notebook](notebooks/user_guide.ipynb). |
59 | | -The [fundamental diagram notebook](notebooks/fundamental_diagram.ipynb) shows how to use *PedPy* for computing the fundamental diagram of a series of experiments. |
| 88 | +PedPy is designed to be used in scripts or interactive Jupyter notebooks. |
60 | 89 |
|
61 | | -#### Interactive online session |
| 90 | +- Explore [getting started](notebooks/getting_started.ipynb), [user guide](https://github.com/PedestrianDynamics/PedPy/blob/main/notebooks/user_guide.ipynb), and [fundamental diagram](https://github.com/PedestrianDynamics/PedPy/blob/main/notebooks/fundamental_diagram.ipynb) notebooks. |
| 91 | +- For local usage, clone the repository and install the extra requirements for notebooks and plotting: |
62 | 92 |
|
63 | | -If you want to try out *PedPy* for the first time, you can find an interactive online environments for both notebooks here: |
| 93 | + ```bash |
| 94 | + git clone https://github.com/PedestrianDynamics/pedpy.git |
| 95 | + python3 -m pip install jupyter matplotlib |
| 96 | + ``` |
64 | 97 |
|
65 | | -- Getting started: [](https://mybinder.org/v2/gh/PedestrianDynamics/PedPy/main?labpath=notebooks%2Fgetting_started.ipynb) |
66 | | -- User guide: [](https://mybinder.org/v2/gh/PedestrianDynamics/PedPy/main?labpath=notebooks%2Fuser_guide.ipynb) |
67 | | -- Fundamental diagram: [](https://mybinder.org/v2/gh/PedestrianDynamics/PedPy/main?labpath=notebooks%2Ffundamental_diagram.ipynb) |
| 98 | + Then start a Jupyter server: |
68 | 99 |
|
69 | | -**Note:** |
70 | | -The execution might be slower compared to a local usage, as only limited resources are available. |
71 | | -It is possible to also upload different trajectory files and run the analysis completely online, but this might not be advisable for long computations. |
| 100 | + ```bash |
| 101 | + jupyter notebook |
| 102 | + ``` |
72 | 103 |
|
73 | | -#### Local usage of the notebooks |
| 104 | +## Example Visualizations |
74 | 105 |
|
75 | | -For local usage of the notebooks, you can either download the notebooks and [demo files](notebooks/demo-data) from the GitHub repository or clone the whole repository with: |
76 | | -```bash |
77 | | -git clone https://github.com/PedestrianDynamics/pedpy.git |
78 | | -``` |
79 | 106 |
|
80 | | -For using either of the notebook some additional libraries need to be installed, mainly for plotting. |
81 | | -You can install the needed libraries with: |
| 107 | +<div align="center"> |
| 108 | +<table style="border-collapse: collapse; border: none;"> |
| 109 | + <tr style="border: none;"> |
| 110 | + <td style="border: none;"><img src="https://raw.githubusercontent.com/PedestrianDynamics/PedPy/refs/heads/main/figs/bottleneck_setup.png" width="400" alt="Bottleneck Setup Example"/></td> |
| 111 | + <td style="border: none;"> |
| 112 | + <img src="https://raw.githubusercontent.com/PedestrianDynamics/PedPy/refs/heads/main/figs/voronoi_cells.png" width="400" alt="Voronoi-based Density Analysis"/> |
| 113 | + <img src="https://raw.githubusercontent.com/PedestrianDynamics/PedPy/refs/heads/main/figs/speed_density_profile.png" width="400" alt="Speed-Density Profile"/> |
| 114 | + </td> |
| 115 | + </tr> |
| 116 | +</table> |
| 117 | +<table style="border-collapse: collapse; border: none;"> |
| 118 | + <tr style="border: none;"> |
| 119 | + <td style="border: none;" width="50%"><img src="https://raw.githubusercontent.com/PedestrianDynamics/PedPy/refs/heads/main/figs/density_comparison.png" width="500" alt="Density Comparison Methods"/></td> |
| 120 | + <td style="border: none;" width="50%"><img src="https://raw.githubusercontent.com/PedestrianDynamics/PedPy/refs/heads/main/figs/time_distance.png" width="500" alt="Time-Distance Analysis"/></td> |
| 121 | + </tr> |
| 122 | +</table> |
| 123 | +</div> |
82 | 124 |
|
83 | | -```bash |
84 | | -python3 -m pip install jupyter matplotlib |
85 | | -``` |
86 | 125 |
|
87 | | -Afterward, you can start a jupyter server with: |
| 126 | +## Documentation |
88 | 127 |
|
89 | | -```bash |
90 | | -jupyter notebook |
| 128 | +- [Full Documentation](https://pedpy.readthedocs.io/) |
| 129 | +- [Getting Started Guide](https://pedpy.readthedocs.io/stable/getting_started.html) |
| 130 | +- [Extensive User Guide](https://pedpy.readthedocs.io/stable/user_guide.html) |
| 131 | +- [API Reference](https://pedpy.readthedocs.io/stable/api/index.html) |
| 132 | + |
| 133 | + |
| 134 | +## Citation |
| 135 | + |
| 136 | +If you use **PedPy** in your work, please cite: |
| 137 | + |
| 138 | +[](https://doi.org/10.5281/zenodo.7194992) |
| 139 | + |
| 140 | +For the latest release (v.1.3.2) the BibTeX entry is: |
| 141 | +``` |
| 142 | +@software{schrodter_2025_15337052, |
| 143 | + author = {Schrödter, Tobias and |
| 144 | + The PedPy Development Team}, |
| 145 | + title = {PedPy - Pedestrian Trajectory Analyzer}, |
| 146 | + month = may, |
| 147 | + year = 2025, |
| 148 | + publisher = {Zenodo}, |
| 149 | + version = {v1.3.2}, |
| 150 | + doi = {10.5281/zenodo.15337052}, |
| 151 | + url = {https://doi.org/10.5281/zenodo.15337052}, |
| 152 | +} |
91 | 153 | ``` |
92 | 154 |
|
93 | | -After navigating to one of the notebooks, you can see how the library can be used for different kinds of analysis. |
| 155 | +If you used a different version, please use Zenodo to get the citation information. |
| 156 | +
|
| 157 | +## Contributing |
| 158 | +
|
| 159 | +Contributions are welcome and we are looking forward to any contribution from the community! |
| 160 | +Take a look at our [Developer Guide](https://pedpy.readthedocs.io/stable/developer_guide.html) to check out different ways to contribute to **PedPy**. |
| 161 | +See the [contributing guidelines](CONTRIBUTING.md) and open an issue or pull request on [GitHub](https://github.com/PedestrianDynamics/PedPy/issues). |
| 162 | +
|
| 163 | +## Getting Help |
| 164 | +
|
| 165 | +If you find yourself in a position where you need assistance from us, don't hesitate to contact us. |
| 166 | +- GitHub Issues: Report bugs or unexpected behavior |
| 167 | +- GitHub Discussions: Ask questions, share ideas, request features |
94 | 168 |
|
95 | | -Some examples how the computed values can be visualized are also shown in the notebooks, e.g., density/velocity profiles, fundamental diagrams, N-T-diagrams, etc. |
| 169 | +## License |
96 | 170 |
|
97 | | - |
| 171 | +**PedPy** is released under the [MIT License](LICENSE). |
98 | 172 |
|
99 | | - |
|
0 commit comments