add dummy file and assert path exists
This commit is contained in:
parent
8a11bdb4b1
commit
4b6dd29083
9
data/custom_extra_functionality.py
Normal file
9
data/custom_extra_functionality.py
Normal 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
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user