Merge pull request #975 from PyPSA/dedicated-shared-resource

scenario management: reenable shared resources in one folder
This commit is contained in:
Fabian Hofmann 2024-03-20 13:06:52 +01:00 committed by GitHub
commit 31c4eb98a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -102,19 +102,16 @@ def get_run_path(fn, dir, rdir, shared_resources):
"add_electricity" "add_electricity"
) )
is_shared = no_relevant_wildcards and no_elec_rule is_shared = no_relevant_wildcards and no_elec_rule
rdir = "" if is_shared else rdir
elif isinstance(shared_resources, str): elif isinstance(shared_resources, str):
rdir = shared_resources + "/" rdir = shared_resources + "/"
is_shared = False
elif isinstance(shared_resources, bool): elif isinstance(shared_resources, bool):
is_shared = shared_resources rdir = ""
else: else:
raise ValueError( raise ValueError(
"shared_resources must be a boolean, str, or 'base' for special handling." "shared_resources must be a boolean, str, or 'base' for special handling."
) )
if is_shared:
return f"{dir}{fn}"
else:
return f"{dir}{rdir}{fn}" return f"{dir}{rdir}{fn}"