Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various errors related to incorrect recognition of the ISO-2 country code "NA" as NaN value #266

Closed
2 tasks
doneachh opened this issue Jan 26, 2024 · 0 comments · Fixed by #273
Closed
2 tasks
Assignees
Labels
bug Something isn't working

Comments

@doneachh
Copy link
Collaborator

Checklist

  • I am using the current main branch or the latest release. Please indicate.
  • I am running on an up-to-date pypsa-africa environment. Update via conda env update -f envs/environment.yaml.

Describe the Bug

Country Code "NA" gets recognized as NaN Value

Error Message

Traceback (most recent call last):
File "/mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/.snakemake/scripts/tmpaobgxggx.build_industry_demand.py", line 158, in
AL_prod_tom = AL["production[ktons/a]"].loc[countries]
File "/home/aca39878/anaconda3/envs/pypsa-earth/lib/python3.10/site-packages/pandas/core/indexing.py", line 1153, in getitem
return self._getitem_axis(maybe_callable, axis=axis)
File "/home/aca39878/anaconda3/envs/pypsa-earth/lib/python3.10/site-packages/pandas/core/indexing.py", line 1382, in _getitem_axis
return self._getitem_iterable(key, axis=axis)
File "/home/aca39878/anaconda3/envs/pypsa-earth/lib/python3.10/site-packages/pandas/core/indexing.py", line 1322, in _getitem_iterable
keyarr, indexer = self._get_listlike_indexer(key, axis)
File "/home/aca39878/anaconda3/envs/pypsa-earth/lib/python3.10/site-packages/pandas/core/indexing.py", line 1520, in _get_listlike_indexer
keyarr, indexer = ax._get_indexer_strict(key, axis_name)
File "/home/aca39878/anaconda3/envs/pypsa-earth/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 6115, in _get_indexer_strict
self._raise_if_missing(keyarr, indexer, axis_name)
File "/home/aca39878/anaconda3/envs/pypsa-earth/lib/python3.10/site-packages/pandas/core/indexes/base.py", line 6176, in _raise_if_missing
raise KeyError(f"None of [{key}] are in the [{axis_name}]")
KeyError: "None of [Index(['NA'], dtype='object', name='country')] are in the [index]"
[Fri Jan 26 14:22:07 2024]
INFO:snakemake.logging:[Fri Jan 26 14:22:07 2024]
Error in rule build_industry_demand:
jobid: 18
input: resources/demand/industrial_distribution_key_elec_s_10.csv, resources/demand/base_industry_totals_2030_DF.csv, data/industrial_database.csv, data/costs_2030.csv
output: resources/demand/industrial_energy_demand_per_node_elec_s_10_2030_DF.csv

ERROR:snakemake.logging:Error in rule build_industry_demand:
jobid: 18
input: resources/demand/industrial_distribution_key_elec_s_10.csv, resources/demand/base_industry_totals_2030_DF.csv, data/industrial_database.csv, data/costs_2030.csv
output: resources/demand/industrial_energy_demand_per_node_elec_s_10_2030_DF.csv

RuleException:
CalledProcessError in file /mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/Snakefile, line 681:
Command 'set -euo pipefail; /home/aca39878/anaconda3/envs/pypsa-earth/bin/python3.10 /mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/.snakemake/scripts/tmpaobgxggx.build_industry_demand.py' returned non-zero exit status 1.
File "/mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/Snakefile", line 681, in __rule_build_industry_demand
File "/home/aca39878/anaconda3/envs/pypsa-earth/lib/python3.10/concurrent/futures/thread.py", line 58, in run
ERROR:snakemake.logging:RuleException:
CalledProcessError in file /mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/Snakefile, line 681:
Command 'set -euo pipefail; /home/aca39878/anaconda3/envs/pypsa-earth/bin/python3.10 /mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/.snakemake/scripts/tmpaobgxggx.build_industry_demand.py' returned non-zero exit status 1.
File "/mnt/c/Users/aca39878/Documents/Git/Namibia/pypsa-earth-sec/Snakefile", line 681, in __rule_build_industry_demand
File "/home/aca39878/anaconda3/envs/pypsa-earth/lib/python3.10/concurrent/futures/thread.py", line 58, in run
Shutting down, this might take some time.
WARNING:snakemake.logging:Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message

<paste here>
@doneachh doneachh added the bug Something isn't working label Jan 26, 2024
@doneachh doneachh self-assigned this Jan 26, 2024
@doneachh doneachh linked a pull request Jan 31, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant