Desired behaviour
Both 2015 + list(range(2020, 2101, 10)) and 2010 + list(range(2020, 2101, 10)) are supposed to be acceptable inputs.
Issue
With input that has no 2010 value reported, but does have 2015 + list(range(2020, 2101, 10))ar6_minimum_emissions_co2eip.csv, we get an error looking like this (running run-example-fair.ipynb):
run_workflow(
input_emissions_file,
outdir,
model=model,
model_version=model_version,
probabilistic_file=probabilistic_file,
fair_extra_config=fair_extra_config,
num_cfgs=num_cfgs,
infilling_database=infilling_database_file,
scenario_batch_size=scenario_batch_size,
)
2022-12-12 14:31:06 climate_assessment.cli MainThread - INFO: Outputs will be saved in: ..\data\output-fair-example-notebook
2022-12-12 14:31:06 climate_assessment.cli MainThread - INFO: Outputs will be saved with the ID: ar6_minimum_emissions_co2eip
2022-12-12 14:31:06 climate_assessment.cli MainThread - INFO: Loading ..\tests\test-data\ar6_minimum_emissions_co2eip.csv
2022-12-12 14:31:06 climate_assessment.cli MainThread - INFO: Converting to basic columns i.e. removing any extra columns
2022-12-12 14:31:06 climate_assessment.cli MainThread - INFO: Performing input data checks
2022-12-12 14:31:06 climate_assessment.checks MainThread - INFO: CHECK: if no non-co2 negatives are reported.
2022-12-12 14:31:06 climate_assessment.checks MainThread - INFO: CHECK: report emissions for all minimally required years.
2022-12-12 14:31:06 pyam.utils MainThread - WARNING: Formatted data is empty!
2022-12-12 14:31:06 climate_assessment.checks MainThread - INFO: CHECK: combine E&IP if reported separately.
2022-12-12 14:31:06 climate_assessment.checks MainThread - INFO: CHECK: reclassify Waste and Other CO2 under E&IP.
2022-12-12 14:31:06 climate_assessment.checks MainThread - INFO: CHECK: delete rows only reporting zero for the entire timeframe.
2022-12-12 14:31:06 climate_assessment.checks MainThread - INFO: CHECK: check if co2 lead variables are reported.
2022-12-12 14:31:06 climate_assessment.harmonization MainThread - INFO: Using ar6 instance for harmonization
2022-12-12 14:31:06 scmdata.run MainThread - INFO: Reading c:\users\kikstra\documents\github\climate-assessment\src\climate_assessment\harmonization\history_ar6.csv
2022-12-12 14:31:06 climate_assessment.harmonization MainThread - INFO: Not harmonizing set()
2022-12-12 14:31:06 climate_assessment.harmonization MainThread - INFO: harmonization_year 2015
2022-12-12 14:31:06 climate_assessment.harmonization MainThread - INFO: Stripping equivalent units for processing
2022-12-12 14:31:06 climate_assessment.harmonization MainThread - INFO: Creating pd.DataFrame's for aneris
2022-12-12 14:31:06 climate_assessment.harmonization MainThread - INFO: Adding 2015 values based on historical percentage offset from 2010
...
c:\users\kikstra\documents\github\climate-assessment\src\climate_assessment\harmonization_and_infilling.py in harmonization_and_infilling(df, key_string, infilling_database, prefix, instance, outdir, do_harmonization)
68
69 if do_harmonization:
---> 70 harmonized = run_harmonization(df, instance=instance, prefix=prefix)
71 else:
72 LOGGER.info("Not performing harmonization")
c:\users\kikstra\documents\github\climate-assessment\src\climate_assessment\harmonization\__init__.py in run_harmonization(df, instance, prefix)
193 history,
194 yr=historical_offset_add_year,
--> 195 low_yr=historical_offset_base_year,
196 )
197
c:\users\kikstra\documents\github\climate-assessment\src\climate_assessment\harmonization\__init__.py in add_year_historical_percentage_offset(df, dfhist, yr, low_yr)
118 df = pd.concat([df2015, dfno2015])
119 else:
--> 120 raise KeyError(f"{low_yr} not in `dfno2015`")
121
122 return df
KeyError: '2010 not in `dfno2015`'
Proposed minimum solution
In the function def add_year_historical_percentage_offset(), add a check that checks if ALL scenarios have 2015, while NONE have 2010.
Desired behaviour Both
2015 + list(range(2020, 2101, 10))
and2010 + list(range(2020, 2101, 10))
are supposed to be acceptable inputs.Issue With input that has no 2010 value reported, but does have
2015 + list(range(2020, 2101, 10))
ar6_minimum_emissions_co2eip.csv, we get an error looking like this (runningrun-example-fair.ipynb
):...
Proposed minimum solution In the function
def add_year_historical_percentage_offset()
, add a check that checks if ALL scenarios have 2015, while NONE have 2010.Proposed desired solution tbd.