Version Checks (indicate both or one)
Issue Description
When a renewable technology sets corine: false in the config (typical for offshore technologies), the script crashes with TypeError: argument of type 'bool' is not iterable at every line that checks "key" in corine.
This affects determine_availability_matrix_MD_UA.py.
Reproducible Example
1. Set `corine: false` for any offwind technology in the config:
renewable:
'offwind-dc':
corine: false
copernicus: {}
2. Run the availability matrix rule:
snakemake solve_elec_networks --configfile ./config/config.yaml --cores 14
3. Produces the following error traceback:
File "determine_availability_matrix_MD_UA.py", line 63, in <module>
if "grid_codes" in corine:
^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'bool' is not iterable
Expected Behavior
Proposed fix:
After the line where corine is read from the config, add a type guard that converts non-dict values to an empty dict. This way all downstream "key" in corine checks simply evaluate to False, which is the intended skip behavior.
corine = config.get("corine", {})
# Add this line
if not isinstance(corine, dict):
corine = {}
Installed Versions
Details
Replace this line.
Version Checks (indicate both or one)
I have confirmed this bug exists on the lastest release of PyPSA-Eur.
I have confirmed this bug exists on the current
masterbranch of PyPSA-Eur.Issue Description
When a renewable technology sets
corine: falsein the config (typical for offshore technologies), the script crashes withTypeError: argument of type 'bool' is not iterableat every line that checks"key" in corine.This affects
determine_availability_matrix_MD_UA.py.Reproducible Example
Expected Behavior
Proposed fix:
After the line where
corineis read from the config, add a type guard that converts non-dict values to an empty dict. This way all downstream"key" in corinechecks simply evaluate toFalse, which is the intended skip behavior.Installed Versions
Details
Replace this line.