diff --git a/data/custom_extra_functionality.py b/data/custom_extra_functionality.py new file mode 100644 index 00000000..98b0c026 --- /dev/null +++ b/data/custom_extra_functionality.py @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: : 2023- The PyPSA-Eur Authors +# +# SPDX-License-Identifier: MIT + +def custom_extra_functionality(n, snapshots): + """ + Add custom extra functionality constraints. + """ + pass diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 539c4e72..ed28c51c 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -796,6 +796,7 @@ def extra_functionality(n, snapshots): if snakemake.params.custom_extra_functionality: source_path = snakemake.params.custom_extra_functionality + assert os.path.exists(source_path), f"{source_path} does not exist" module_name = os.path.splitext(os.path.basename(source_path))[0] module = importlib.import_module(module_name) module.custom_extra_functionality(n, snapshots)