diff --git a/.copyright.tmpl b/.copyright.tmpl new file mode 100644 index 0000000..8ce39c4 --- /dev/null +++ b/.copyright.tmpl @@ -0,0 +1,6 @@ +Copyright (c) 2023-${edit_year} Blue Brain Project, EPFL. + +This file is part of region-grower. +See https://github.com/BlueBrain/region-grower for further info. + +SPDX-License-Identifier: Apache-2.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6e8187f..dd82e85 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,3 +39,11 @@ repos: rev: 7.1.1 hooks: - id: flake8 + - repo: https://github.com/arkinmodi/add-license-header + rev: v2.2.0 + hooks: + - id: add-license-header + args: + - --license-file + - .copyright.tmpl + files: \.py$ diff --git a/docs/source/conf.py b/docs/source/conf.py index 6020073..8c41fe5 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,5 +1,15 @@ """Configuration file for the Sphinx documentation builder.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html diff --git a/region_grower/__init__.py b/region_grower/__init__.py index 3aa4a54..035228a 100644 --- a/region_grower/__init__.py +++ b/region_grower/__init__.py @@ -3,6 +3,16 @@ Synthesize cells in a given spatial context. """ +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + import importlib.metadata __version__ = importlib.metadata.version("region-grower") diff --git a/region_grower/atlas_helper.py b/region_grower/atlas_helper.py index 87884f7..8e45ec5 100644 --- a/region_grower/atlas_helper.py +++ b/region_grower/atlas_helper.py @@ -3,6 +3,16 @@ This helper allows simple lookups without having to reason in term of [PH][1-6] and [PH]y. """ +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + import operator from pathlib import Path from typing import List diff --git a/region_grower/cli.py b/region_grower/cli.py index 8051574..9e9abcf 100644 --- a/region_grower/cli.py +++ b/region_grower/cli.py @@ -1,5 +1,15 @@ """Command Line Interface for the region_grower package.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + # pylint: disable=redefined-outer-name import importlib.metadata import json diff --git a/region_grower/context.py b/region_grower/context.py index 75c545f..819ce25 100644 --- a/region_grower/context.py +++ b/region_grower/context.py @@ -7,6 +7,16 @@ the placement_algorithm package to synthesize circuit morphologies. """ +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + import os from collections import defaultdict from copy import deepcopy diff --git a/region_grower/generate.py b/region_grower/generate.py index e3fee42..2271c92 100644 --- a/region_grower/generate.py +++ b/region_grower/generate.py @@ -1,5 +1,15 @@ """Functions to generate parameters and distributions.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + import json import logging import multiprocessing diff --git a/region_grower/modify.py b/region_grower/modify.py index 4fe22aa..e538929 100644 --- a/region_grower/modify.py +++ b/region_grower/modify.py @@ -1,5 +1,15 @@ """Use spatial properties to modify synthesis input.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + from typing import Dict from typing import List from typing import Optional diff --git a/region_grower/morph_io.py b/region_grower/morph_io.py index 9af6d68..3e14a71 100644 --- a/region_grower/morph_io.py +++ b/region_grower/morph_io.py @@ -1,5 +1,15 @@ """Module to load and write morphologies.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + import os import random import uuid diff --git a/region_grower/synthesize_morphologies.py b/region_grower/synthesize_morphologies.py index 2cff011..d1fd162 100644 --- a/region_grower/synthesize_morphologies.py +++ b/region_grower/synthesize_morphologies.py @@ -7,6 +7,16 @@ - optional axon grafting "on-the-fly" """ +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + import json import logging import os diff --git a/region_grower/utils.py b/region_grower/utils.py index fee03ee..30d769a 100644 --- a/region_grower/utils.py +++ b/region_grower/utils.py @@ -1,5 +1,15 @@ """Utils module.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + import json import logging import os diff --git a/region_grower/version.py b/region_grower/version.py index 6641e6b..7e033fc 100644 --- a/region_grower/version.py +++ b/region_grower/version.py @@ -1,3 +1,13 @@ """Version of the region-grower package.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + VERSION = "1.4.0" # pragma: no cover diff --git a/scripts/distribution_definition/add_diameter_info.py b/scripts/distribution_definition/add_diameter_info.py index 7faa845..7b8ea3d 100755 --- a/scripts/distribution_definition/add_diameter_info.py +++ b/scripts/distribution_definition/add_diameter_info.py @@ -1,5 +1,15 @@ """Script to add the diameter distributions to another distribution.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + import argparse import json import os diff --git a/scripts/distribution_definition/generate_synthesis_distributions.py b/scripts/distribution_definition/generate_synthesis_distributions.py index 126bf31..856496d 100755 --- a/scripts/distribution_definition/generate_synthesis_distributions.py +++ b/scripts/distribution_definition/generate_synthesis_distributions.py @@ -1,5 +1,15 @@ """Extract TNS distributions used by NeuroTS.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + from __future__ import print_function import argparse diff --git a/scripts/parameter_definition/generate_synthesis_recipe.py b/scripts/parameter_definition/generate_synthesis_recipe.py index c5da268..dc4ae3c 100644 --- a/scripts/parameter_definition/generate_synthesis_recipe.py +++ b/scripts/parameter_definition/generate_synthesis_recipe.py @@ -1,5 +1,15 @@ """Script to generate a synthesis recipe.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + import copy import json diff --git a/setup.py b/setup.py index 5370e39..cc4aec3 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,15 @@ """Setup for the region-grower package.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + from pathlib import Path from setuptools import find_namespace_packages diff --git a/tests/__init__.py b/tests/__init__.py index e194b5b..e5357c0 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1 +1,11 @@ """Tests suite for the region-grower package.""" + +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# diff --git a/tests/conftest.py b/tests/conftest.py index dfc4f9a..8d748af 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,5 +1,15 @@ """Configuration for the pytest test suite.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + # pylint: disable=redefined-outer-name # pylint: disable=missing-function-docstring from pathlib import Path diff --git a/tests/data_factories.py b/tests/data_factories.py index bbcbc8d..1f13f70 100644 --- a/tests/data_factories.py +++ b/tests/data_factories.py @@ -1,5 +1,15 @@ """Generate atlas for tests.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + # pylint: disable=missing-function-docstring import json import os diff --git a/tests/test_atlas_helper.py b/tests/test_atlas_helper.py index bda8a75..ac147c2 100644 --- a/tests/test_atlas_helper.py +++ b/tests/test_atlas_helper.py @@ -1,5 +1,15 @@ """Test the region_grower.atlas_helper.AtlasHelper module.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + from pathlib import Path import pytest diff --git a/tests/test_cli.py b/tests/test_cli.py index 9210dd4..6e91d9d 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,5 +1,15 @@ """Tests for the region_grower.cli module.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + # pylint: disable=missing-function-docstring import json from pathlib import Path diff --git a/tests/test_context.py b/tests/test_context.py index 8edba71..93004c4 100644 --- a/tests/test_context.py +++ b/tests/test_context.py @@ -1,5 +1,15 @@ """Test the region_grower.context module.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + # pylint: disable=missing-function-docstring # pylint: disable=use-implicit-booleaness-not-comparison diff --git a/tests/test_modify.py b/tests/test_modify.py index 2d3dd70..edb79c7 100644 --- a/tests/test_modify.py +++ b/tests/test_modify.py @@ -1,5 +1,15 @@ """Test the region_grower.modify module.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + # pylint: disable=missing-function-docstring from copy import deepcopy diff --git a/tests/test_morph_io.py b/tests/test_morph_io.py index 727e82e..0895864 100644 --- a/tests/test_morph_io.py +++ b/tests/test_morph_io.py @@ -1,5 +1,15 @@ """Test the region_grower.utils module.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + # pylint: disable=missing-function-docstring # pylint: disable=protected-access from pathlib import Path diff --git a/tests/test_synthesize_morphologies.py b/tests/test_synthesize_morphologies.py index 16ce3f4..590c4ec 100644 --- a/tests/test_synthesize_morphologies.py +++ b/tests/test_synthesize_morphologies.py @@ -1,5 +1,15 @@ """Test the region_grower.synthesize_morphologies module.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + # pylint: disable=missing-function-docstring import json import logging diff --git a/tests/test_utils.py b/tests/test_utils.py index 0b2297b..15fc15b 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,5 +1,15 @@ """Test the region_grower.utils module.""" +# LICENSE HEADER MANAGED BY add-license-header +# +# Copyright (c) 2023-2024 Blue Brain Project, EPFL. +# +# This file is part of region-grower. +# See https://github.com/BlueBrain/region-grower for further info. +# +# SPDX-License-Identifier: Apache-2.0 +# + # pylint: disable=missing-function-docstring import json import logging