add dummy file and assert path exists

This commit is contained in:
Fabian Neumann 2023-12-29 17:23:11 +01:00
parent 8a11bdb4b1
commit 4b6dd29083
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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)