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

KeyError: "'rcp' is not a valid dimension or coordinate" when running with non-RCP spec #45

Closed
kemccusker opened this issue Sep 20, 2022 · 0 comments · Fixed by #46
Closed

Comments

@kemccusker
Copy link
Member

This is probably related to Merge Request #44.
When calling with a non-RCP configuration, emissions_scenarios should be None and we should not be selecting anything with an rcp dimension.

Traceback (most recent call last):
  File "/Users/kellymccusker/Dropbox (Rhodium Group)/Kelly Workspace/ClimateImpactLab/analysis/ClimateImpactLab/Impacts/TESTINSTALL/dscim-epa/damage_fun_runs/command_line_scc.py", line 461, in <module>
    epa_sccs(sector,
  File "/Users/kellymccusker/Dropbox (Rhodium Group)/Kelly Workspace/ClimateImpactLab/analysis/ClimateImpactLab/Impacts/TESTINSTALL/dscim-epa/damage_fun_runs/command_line_scc.py", line 288, in epa_sccs
    df_single_scc, df_single_gcnp, meta = epa_scc(sector = sector,
  File "/Users/kellymccusker/Dropbox (Rhodium Group)/Kelly Workspace/ClimateImpactLab/analysis/ClimateImpactLab/Impacts/TESTINSTALL/dscim-epa/damage_fun_runs/command_line_scc.py", line 223, in epa_scc
    df = menu_item_global.uncollapsed_discount_factors
  File "/Users/kellymccusker/opt/miniconda3/envs/dscim-epa/lib/python3.9/site-packages/dscim/descriptors.py", line 18, in __get__
    setattr(instance, self.__func__.__name__, self.__func__(instance))
  File "/Users/kellymccusker/opt/miniconda3/envs/dscim-epa/lib/python3.9/site-packages/dscim/menu/decorators.py", line 26, in save_wrap
    out = func(self, *args, **kwargs)
  File "/Users/kellymccusker/opt/miniconda3/envs/dscim-epa/lib/python3.9/site-packages/dscim/menu/main_recipe.py", line 1354, in uncollapsed_discount_factors
    self.global_consumption_no_pulse / pop
  File "/Users/kellymccusker/opt/miniconda3/envs/dscim-epa/lib/python3.9/site-packages/dscim/descriptors.py", line 18, in __get__
    setattr(instance, self.__func__.__name__, self.__func__(instance))
  File "/Users/kellymccusker/opt/miniconda3/envs/dscim-epa/lib/python3.9/site-packages/dscim/menu/decorators.py", line 26, in save_wrap
    out = func(self, *args, **kwargs)
  File "/Users/kellymccusker/opt/miniconda3/envs/dscim-epa/lib/python3.9/site-packages/dscim/menu/main_recipe.py", line 968, in global_consumption_no_pulse
    fair_control = self.climate.fair_control
  File "/Users/kellymccusker/opt/miniconda3/envs/dscim-epa/lib/python3.9/site-packages/dscim/menu/simple_storage.py", line 226, in fair_control
    ds = self.anomalies[[f"control_{var}" for var in self.anomaly_vars]]
  File "/Users/kellymccusker/opt/miniconda3/envs/dscim-epa/lib/python3.9/site-packages/dscim/descriptors.py", line 18, in __get__
    setattr(instance, self.__func__.__name__, self.__func__(instance))
  File "/Users/kellymccusker/opt/miniconda3/envs/dscim-epa/lib/python3.9/site-packages/dscim/menu/simple_storage.py", line 200, in anomalies
    anomaly = anomaly.sel(rcp=self.emission_scenarios)
  File "/Users/kellymccusker/opt/miniconda3/envs/dscim-epa/lib/python3.9/site-packages/xarray/core/dataset.py", line 2533, in sel
    query_results = map_index_queries(
  File "/Users/kellymccusker/opt/miniconda3/envs/dscim-epa/lib/python3.9/site-packages/xarray/core/indexing.py", line 175, in map_index_queries
    grouped_indexers = group_indexers_by_index(obj, indexers, options)
  File "/Users/kellymccusker/opt/miniconda3/envs/dscim-epa/lib/python3.9/site-packages/xarray/core/indexing.py", line 139, in group_indexers_by_index
    raise KeyError(f"{key!r} is not a valid dimension or coordinate")
KeyError: "'rcp' is not a valid dimension or coordinate"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant