diff --git a/.gitattributes b/.gitattributes index 44068b06..4c7c6326 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + # Normalize line endings to LF for all text files, overriding core.autocrlf * text=auto eol=lf diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 517fc090..2aaf591c 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + version: 2 updates: - package-ecosystem: "pip" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7615c80a..0b709c9e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + name: pedpy-ci on: @@ -56,6 +60,15 @@ jobs: run: | ${{github.workspace}}/scripts/ci.sh + spdx-check: + runs-on: ubuntu-24.04 + steps: + - name: Check out repository code + uses: actions/checkout@v7 + + - name: Check SPDX / REUSE compliance + uses: fsfe/reuse-action@v6 + build: needs: pre-build-checks diff --git a/.github/workflows/weekly-dispatch-latest-release.yml b/.github/workflows/weekly-dispatch-latest-release.yml index 0d6b1d88..527af261 100644 --- a/.github/workflows/weekly-dispatch-latest-release.yml +++ b/.github/workflows/weekly-dispatch-latest-release.yml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + on: schedule: - cron: '0 3 * * 0' # weekly Sunday 03:00 UTC — adjust as needed diff --git a/.gitignore b/.gitignore index aa0cd0ed..b070cbbe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + # Created by https://www.toptal.com/developers/gitignore/api/python,visualstudiocode,pycharm,jupyternotebooks # Edit at https://www.toptal.com/developers/gitignore?templates=python,visualstudiocode,pycharm,jupyternotebooks diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d186491e..79821840 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.17.3 @@ -60,3 +64,10 @@ repos: - id: destroyed-symlinks - id: mixed-line-ending args: ['--fix=lf'] + + - repo: https://github.com/fsfe/reuse-tool + rev: v6.2.0 + hooks: + - id: reuse + name: Check SPDX headers (reuse) + additional_dependencies: ["charset-normalizer"] diff --git a/.readthedocs.yaml b/.readthedocs.yaml index d3259b7d..dcdf83ff 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + # .readthedocs.yaml # Read the Docs configuration file # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details diff --git a/CITATION.cff b/CITATION.cff index 18c3b21b..c8d50153 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + cff-version: 1.2.0 message: "If you use PedPy in your work, please cite it as below." diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt new file mode 100644 index 00000000..0831050e --- /dev/null +++ b/LICENSES/MIT.txt @@ -0,0 +1,22 @@ +MIT License + +Copyright (c) 2022-2025 Forschungszentrum Jülich GmbH, IAS-7 +Copyright (c) 2024-2025 Tobias Schrödter + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/REUSE.toml b/REUSE.toml new file mode 100644 index 00000000..fd5b521d --- /dev/null +++ b/REUSE.toml @@ -0,0 +1,22 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + +version = 1 + +[[annotations]] +path = [ + "LICENSE", + "*.md", + ".github/**", + "docs/**", + "figs/**", + "notebooks/**", + "tests/**", +] +precedence = "closest" +SPDX-FileCopyrightText = [ + "2022-2026 Forschungszentrum Jülich GmbH, IAS-7", + "2024-2026 Tobias Schrödter", +] +SPDX-License-Identifier = "MIT" diff --git a/codecov.yml b/codecov.yml index b6fc63c2..5edc5090 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + coverage: ignore: - "pedpy/plotting/*" # Exclude plotting for coverage, as we will not test it diff --git a/docs/requirements.txt b/docs/requirements.txt index 75e19b68..49e6b2fd 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + sphinx~=9.0.4 sphinx-copybutton==0.5.2 sphinx_design==0.7.0 diff --git a/docs/source/_static/css/custom.css b/docs/source/_static/css/custom.css index b9995a44..448d57ca 100644 --- a/docs/source/_static/css/custom.css +++ b/docs/source/_static/css/custom.css @@ -1,3 +1,9 @@ +/* + * SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 + * SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter + * SPDX-License-Identifier: MIT + */ + /* Provided by Sphinx's 'basic' theme, and included in the final set of assets */ @import "../basic.css"; diff --git a/docs/source/conf.py b/docs/source/conf.py index 082971a9..ab8d21e3 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + # Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the documentation: diff --git a/helper/__init__.py b/helper/__init__.py index e69de29b..b5f9479a 100644 --- a/helper/__init__.py +++ b/helper/__init__.py @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT diff --git a/helper/create_trajectories.py b/helper/create_trajectories.py index 50367d31..e226ad4f 100755 --- a/helper/create_trajectories.py +++ b/helper/create_trajectories.py @@ -1,4 +1,7 @@ #! /usr/bin/env python3 +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT import argparse import pathlib diff --git a/pedpy/__init__.py b/pedpy/__init__.py index 6dd82288..91c3b99b 100644 --- a/pedpy/__init__.py +++ b/pedpy/__init__.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Top level imports, for easier usage.""" try: diff --git a/pedpy/column_identifier.py b/pedpy/column_identifier.py index bde0ee2f..4eb968da 100644 --- a/pedpy/column_identifier.py +++ b/pedpy/column_identifier.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Description of the used columns names in PedPy.""" from typing import Final diff --git a/pedpy/data/geometry.py b/pedpy/data/geometry.py index 842def25..ad8c7868 100644 --- a/pedpy/data/geometry.py +++ b/pedpy/data/geometry.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Module handling the geometrical environment of the analysis.""" from dataclasses import dataclass diff --git a/pedpy/data/trajectory_data.py b/pedpy/data/trajectory_data.py index dfddf0ee..fb814b81 100644 --- a/pedpy/data/trajectory_data.py +++ b/pedpy/data/trajectory_data.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Module handling the trajectory data of the analysis.""" from __future__ import annotations diff --git a/pedpy/errors.py b/pedpy/errors.py index b8dc5c78..0d7ce647 100644 --- a/pedpy/errors.py +++ b/pedpy/errors.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Custom exception classes for PedPy. This module defines a hierarchy of exceptions for clear and specific diff --git a/pedpy/internal/utils.py b/pedpy/internal/utils.py index 701518c5..507e462b 100644 --- a/pedpy/internal/utils.py +++ b/pedpy/internal/utils.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Module containing internal utilities.""" import functools diff --git a/pedpy/io/crowdit_loader.py b/pedpy/io/crowdit_loader.py index 2255a1df..428a8fab 100644 --- a/pedpy/io/crowdit_loader.py +++ b/pedpy/io/crowdit_loader.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Load crowd:it trajectories to the internal trajectory data format.""" import pathlib diff --git a/pedpy/io/helper.py b/pedpy/io/helper.py index ec6a695d..46a064ed 100644 --- a/pedpy/io/helper.py +++ b/pedpy/io/helper.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Helper functions for data loading methods.""" import math diff --git a/pedpy/io/jupedsim_loader.py b/pedpy/io/jupedsim_loader.py index 817fb37d..edac7671 100644 --- a/pedpy/io/jupedsim_loader.py +++ b/pedpy/io/jupedsim_loader.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Load JuPedSim trajectories to the internal trajectory data format.""" import pathlib diff --git a/pedpy/io/pathfinder_loader.py b/pedpy/io/pathfinder_loader.py index 1702ef8c..b4d742a1 100644 --- a/pedpy/io/pathfinder_loader.py +++ b/pedpy/io/pathfinder_loader.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Load Pathfinder trajectories to the internal trajectory data format.""" import json diff --git a/pedpy/io/ped_data_archive_loader.py b/pedpy/io/ped_data_archive_loader.py index 932f7fc3..f9271ea0 100644 --- a/pedpy/io/ped_data_archive_loader.py +++ b/pedpy/io/ped_data_archive_loader.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Load trajectories from the Pedestrian Dynamics Data Archive to the internal trajectory data format.""" import pathlib diff --git a/pedpy/io/trajectory_loader.py b/pedpy/io/trajectory_loader.py index e252413b..36d75094 100644 --- a/pedpy/io/trajectory_loader.py +++ b/pedpy/io/trajectory_loader.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Load trajectories to the internal trajectory data format.""" import pathlib diff --git a/pedpy/io/vadere_loader.py b/pedpy/io/vadere_loader.py index 524e9f6b..fd35d58e 100644 --- a/pedpy/io/vadere_loader.py +++ b/pedpy/io/vadere_loader.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Load Vadere trajectories to the internal trajectory data format.""" import json diff --git a/pedpy/io/viswalk_loader.py b/pedpy/io/viswalk_loader.py index 36a31eae..8a06f2a1 100644 --- a/pedpy/io/viswalk_loader.py +++ b/pedpy/io/viswalk_loader.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Load Viswalk trajectories to the internal trajectory data format.""" import pathlib diff --git a/pedpy/methods/acceleration_calculator.py b/pedpy/methods/acceleration_calculator.py index fee9ed47..d652c706 100644 --- a/pedpy/methods/acceleration_calculator.py +++ b/pedpy/methods/acceleration_calculator.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Module containing functions to compute accelerations.""" from typing import Optional diff --git a/pedpy/methods/density_calculator.py b/pedpy/methods/density_calculator.py index 35a36455..72972faa 100644 --- a/pedpy/methods/density_calculator.py +++ b/pedpy/methods/density_calculator.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Module containing functions to compute densities.""" from typing import Tuple diff --git a/pedpy/methods/flow_calculator.py b/pedpy/methods/flow_calculator.py index 62dfb533..c7d2ecdd 100644 --- a/pedpy/methods/flow_calculator.py +++ b/pedpy/methods/flow_calculator.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Module containing functions to compute flows.""" from typing import Tuple diff --git a/pedpy/methods/method_utils.py b/pedpy/methods/method_utils.py index 76bb0464..8082ae75 100644 --- a/pedpy/methods/method_utils.py +++ b/pedpy/methods/method_utils.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Helper functions for the analysis methods.""" # pylint: disable=C0302 diff --git a/pedpy/methods/profile_calculator.py b/pedpy/methods/profile_calculator.py index e1ee2911..b39e26ce 100644 --- a/pedpy/methods/profile_calculator.py +++ b/pedpy/methods/profile_calculator.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Module containing functions to compute profiles. For the computation of the profiles the given :class:`~geometry.WalkableArea` diff --git a/pedpy/methods/spatial_analysis.py b/pedpy/methods/spatial_analysis.py index 4fa5a060..afc5a769 100644 --- a/pedpy/methods/spatial_analysis.py +++ b/pedpy/methods/spatial_analysis.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Module containing functions to compute spatial analysis methods. For example: the pair distribution function. diff --git a/pedpy/methods/speed_calculator.py b/pedpy/methods/speed_calculator.py index 4f269360..0de0115a 100644 --- a/pedpy/methods/speed_calculator.py +++ b/pedpy/methods/speed_calculator.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Module containing functions to compute velocities.""" from typing import Optional diff --git a/pedpy/plotting/plotting.py b/pedpy/plotting/plotting.py index 78539c7d..da57b620 100644 --- a/pedpy/plotting/plotting.py +++ b/pedpy/plotting/plotting.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Module containing plotting functionalities.""" # pylint: disable=C0302 diff --git a/pedpy/preprocessing/trajectory_outlier_detection.py b/pedpy/preprocessing/trajectory_outlier_detection.py index 7f9bf02f..5d97e8f7 100644 --- a/pedpy/preprocessing/trajectory_outlier_detection.py +++ b/pedpy/preprocessing/trajectory_outlier_detection.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Provides functions for detecting and correcting anomalies.""" import copy diff --git a/pedpy/preprocessing/trajectory_projector.py b/pedpy/preprocessing/trajectory_projector.py index f4d30147..ec03b12e 100644 --- a/pedpy/preprocessing/trajectory_projector.py +++ b/pedpy/preprocessing/trajectory_projector.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Provides functions for projecting trajectories.""" import copy diff --git a/pyproject.toml b/pyproject.toml index df4cbfac..2203d74c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + [project] name = "PedPy" dynamic = ['version'] diff --git a/requirements.txt b/requirements.txt index caf47cd7..85371403 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + numpy>=2.1,<3.0 pandas>=3.0,<4.0 Shapely>=2.1,<3.0 diff --git a/scripts/ci.sh b/scripts/ci.sh index 6a565c0a..5bc8b27c 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -1,4 +1,7 @@ #!/bin/bash +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT check_for_failure() { "$@" || failure=1 diff --git a/scripts/format.sh b/scripts/format.sh index 498df26b..8d5a38e4 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -1,4 +1,7 @@ #! /bin/bash +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT set -e diff --git a/scripts/generate_bibtex.py b/scripts/generate_bibtex.py index 3feb2599..73fd0a8e 100644 --- a/scripts/generate_bibtex.py +++ b/scripts/generate_bibtex.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import pathlib import textwrap import time diff --git a/scripts/update_spdx_year.py b/scripts/update_spdx_year.py new file mode 100644 index 00000000..7234e71e --- /dev/null +++ b/scripts/update_spdx_year.py @@ -0,0 +1,58 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + +"""Update the end year in SPDX-FileCopyrightText headers of modified files.""" + +import datetime +import pathlib +import re +import subprocess +import sys + +_YEAR_RANGE_RE = re.compile(r"(SPDX-FileCopyrightText:\s*)(\d{4})(?:-(\d{4}))?(\s+)") + + +def _update_file_year(path: pathlib.Path, current_year: int) -> bool: + if not path.is_file() or path.is_symlink(): + return False + try: + content = path.read_text(encoding="utf-8") + except UnicodeDecodeError: + return False + + def _repl(match: re.Match[str]) -> str: + prefix, start_str, end_str, suffix = match.groups() + start_year = int(start_str) + if start_year >= current_year: + return match.group(0) + if end_str is not None and int(end_str) >= current_year: + return match.group(0) + return f"{prefix}{start_year}-{current_year}{suffix}" + + updated = _YEAR_RANGE_RE.sub(_repl, content) + if updated != content: + path.write_text(updated, encoding="utf-8", newline="\n") + return True + return False + + +def main(argv: list[str]) -> int: + """Update SPDX copyright end-years on passed paths or git-modified files.""" + current_year = datetime.date.today().year + if argv: + targets = [pathlib.Path(arg) for arg in argv] + else: + changed = subprocess.check_output( + ["git", "diff", "--name-only", "--cached"], + text=True, + ).splitlines() + targets = [pathlib.Path(rel) for rel in changed] + + for target in targets: + _update_file_year(target, current_year) + return 0 + + +if __name__ == "__main__": + raise SystemExit(main(sys.argv[1:])) diff --git a/tests/__init__.py b/tests/__init__.py index e69de29b..b5f9479a 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT diff --git a/tests/reference_tests/reference_test.py b/tests/reference_tests/reference_test.py index 09311bc9..4b942bce 100644 --- a/tests/reference_tests/reference_test.py +++ b/tests/reference_tests/reference_test.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import pathlib import numpy as np diff --git a/tests/unit_tests/data/test_geometry.py b/tests/unit_tests/data/test_geometry.py index 0d6e0cbb..013c0c01 100644 --- a/tests/unit_tests/data/test_geometry.py +++ b/tests/unit_tests/data/test_geometry.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import numpy as np import pytest import shapely diff --git a/tests/unit_tests/data/test_trajectory_data.py b/tests/unit_tests/data/test_trajectory_data.py index 44c5c669..51d0dc8c 100644 --- a/tests/unit_tests/data/test_trajectory_data.py +++ b/tests/unit_tests/data/test_trajectory_data.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + from dataclasses import FrozenInstanceError import pandas as pd diff --git a/tests/unit_tests/io/test_crowdit_loader.py b/tests/unit_tests/io/test_crowdit_loader.py index 37a62133..3205cf7e 100644 --- a/tests/unit_tests/io/test_crowdit_loader.py +++ b/tests/unit_tests/io/test_crowdit_loader.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import pathlib import pytest diff --git a/tests/unit_tests/io/test_jupedsim_loader.py b/tests/unit_tests/io/test_jupedsim_loader.py index 2a1376ca..faa65118 100644 --- a/tests/unit_tests/io/test_jupedsim_loader.py +++ b/tests/unit_tests/io/test_jupedsim_loader.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import pathlib import sqlite3 from typing import List, Optional diff --git a/tests/unit_tests/io/test_pathfinder_loader.py b/tests/unit_tests/io/test_pathfinder_loader.py index 535f94d8..b6227c0f 100644 --- a/tests/unit_tests/io/test_pathfinder_loader.py +++ b/tests/unit_tests/io/test_pathfinder_loader.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import json import pathlib from typing import List, Optional diff --git a/tests/unit_tests/io/test_ped_data_archive_loader.py b/tests/unit_tests/io/test_ped_data_archive_loader.py index 27825c7a..8e28999d 100644 --- a/tests/unit_tests/io/test_ped_data_archive_loader.py +++ b/tests/unit_tests/io/test_ped_data_archive_loader.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import pathlib from typing import Any, List, Optional diff --git a/tests/unit_tests/io/test_trajectory_loader.py b/tests/unit_tests/io/test_trajectory_loader.py index 7eddeef8..cb887dae 100644 --- a/tests/unit_tests/io/test_trajectory_loader.py +++ b/tests/unit_tests/io/test_trajectory_loader.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import pathlib from typing import List diff --git a/tests/unit_tests/io/test_vadere_loader.py b/tests/unit_tests/io/test_vadere_loader.py index b3432df5..3a8c2e27 100644 --- a/tests/unit_tests/io/test_vadere_loader.py +++ b/tests/unit_tests/io/test_vadere_loader.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import json import math import pathlib diff --git a/tests/unit_tests/io/test_viswalk_loader.py b/tests/unit_tests/io/test_viswalk_loader.py index 492d95e5..2b6f6fa9 100644 --- a/tests/unit_tests/io/test_viswalk_loader.py +++ b/tests/unit_tests/io/test_viswalk_loader.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import pathlib import re import textwrap diff --git a/tests/unit_tests/io/utils.py b/tests/unit_tests/io/utils.py index a13fc997..0b6e08bf 100644 --- a/tests/unit_tests/io/utils.py +++ b/tests/unit_tests/io/utils.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import pandas as pd from pedpy.column_identifier import * diff --git a/tests/unit_tests/methods/test_compute_individual_voronoi_polygons.py b/tests/unit_tests/methods/test_compute_individual_voronoi_polygons.py index df49209e..9c50de3a 100644 --- a/tests/unit_tests/methods/test_compute_individual_voronoi_polygons.py +++ b/tests/unit_tests/methods/test_compute_individual_voronoi_polygons.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Unit tests for compute_individual_voronoi_polygons.""" import warnings diff --git a/tests/unit_tests/methods/test_density_calculator.py b/tests/unit_tests/methods/test_density_calculator.py index 8b05b6b7..6f2d6880 100644 --- a/tests/unit_tests/methods/test_density_calculator.py +++ b/tests/unit_tests/methods/test_density_calculator.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import numpy as np import pandas as pd import pytest diff --git a/tests/unit_tests/methods/test_flow_calculator.py b/tests/unit_tests/methods/test_flow_calculator.py index 8eaee3b9..ce09829c 100644 --- a/tests/unit_tests/methods/test_flow_calculator.py +++ b/tests/unit_tests/methods/test_flow_calculator.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import numpy as np import pandas as pd import pytest diff --git a/tests/unit_tests/methods/test_method_utils.py b/tests/unit_tests/methods/test_method_utils.py index a25315fd..d7adc20b 100644 --- a/tests/unit_tests/methods/test_method_utils.py +++ b/tests/unit_tests/methods/test_method_utils.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + from unittest.mock import MagicMock import numpy as np diff --git a/tests/unit_tests/methods/test_profile_calculator.py b/tests/unit_tests/methods/test_profile_calculator.py index 0664a6ac..de17e682 100644 --- a/tests/unit_tests/methods/test_profile_calculator.py +++ b/tests/unit_tests/methods/test_profile_calculator.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import numpy as np import pandas as pd import pytest diff --git a/tests/unit_tests/methods/test_rset_map.py b/tests/unit_tests/methods/test_rset_map.py index a61c77be..a5404945 100644 --- a/tests/unit_tests/methods/test_rset_map.py +++ b/tests/unit_tests/methods/test_rset_map.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Unit tests for compute_rset_map function in pedpy.methods.profile_calculator.""" import numpy as np diff --git a/tests/unit_tests/methods/test_speed_calculator.py b/tests/unit_tests/methods/test_speed_calculator.py index d5cd5037..24be12c6 100644 --- a/tests/unit_tests/methods/test_speed_calculator.py +++ b/tests/unit_tests/methods/test_speed_calculator.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import numpy as np import pandas as pd import pytest diff --git a/tests/unit_tests/methods/test_trajectory_data_type_check.py b/tests/unit_tests/methods/test_trajectory_data_type_check.py index 662d68ad..61178895 100644 --- a/tests/unit_tests/methods/test_trajectory_data_type_check.py +++ b/tests/unit_tests/methods/test_trajectory_data_type_check.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + """Tests that public API functions reject non-TrajectoryData inputs.""" import pandas as pd diff --git a/tests/unit_tests/preprocessing/test_trajectory_outlier_detection.py b/tests/unit_tests/preprocessing/test_trajectory_outlier_detection.py index 268e8f25..e29724ee 100644 --- a/tests/unit_tests/preprocessing/test_trajectory_outlier_detection.py +++ b/tests/unit_tests/preprocessing/test_trajectory_outlier_detection.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import logging import pathlib diff --git a/tests/unit_tests/preprocessing/test_trajectory_projector.py b/tests/unit_tests/preprocessing/test_trajectory_projector.py index 49756e1a..6fa357a8 100644 --- a/tests/unit_tests/preprocessing/test_trajectory_projector.py +++ b/tests/unit_tests/preprocessing/test_trajectory_projector.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + import pathlib import numpy as np diff --git a/tests/utils/__init__.py b/tests/utils/__init__.py index e69de29b..b5f9479a 100644 --- a/tests/utils/__init__.py +++ b/tests/utils/__init__.py @@ -0,0 +1,3 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT diff --git a/tests/utils/utils.py b/tests/utils/utils.py index 80831b7c..32a2319b 100644 --- a/tests/utils/utils.py +++ b/tests/utils/utils.py @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2022-2026 Forschungszentrum Jülich GmbH, IAS-7 +# SPDX-FileCopyrightText: 2024-2026 Tobias Schrödter +# SPDX-License-Identifier: MIT + from typing import List import numpy as np