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

ValueError: Harmonization failed with method reduce_ratio_2080 harmonized values != historical values #48

Closed
hljia opened this issue Apr 19, 2022 · 5 comments

Comments

@hljia
Copy link

hljia commented Apr 19, 2022

I am now trying to harmony SSP emissions to the new version CEDS v_2021_04_21 historical emissions with a base year of 2019. When I used the test data, the aneris run smoothly. But when I replaced the test data by real annual BC emission over U.S. from CEDS and SSP245 (aneris ssp245_EU_BC.xls --history history_EU_BC.xls --regions regions_mapping_unused.csv --rc aneris_regions_sectors.yaml), the following error occurred:

INFO:root:Downselecting prefix|suffix variables
INFO:root:Translating to standard format
INFO:root:Aggregating historical values to native regions
WARNING:root:Removing regions without direct mapping: ['EU']
INFO:root:Harmonizing (with example methods):
INFO:root:region gas sector units
World BC prefix|sector1|suffix kt reduce_ratio_2080
Name: method, dtype: object
INFO:root:Harmonizing with reduce_ratio_2080
Traceback (most recent call last):
File "/home/b/b381315/.conda/envs/hjia/bin/aneris", line 33, in
sys.exit(load_entry_point('aneris-iamc==0.3.0', 'console_scripts', 'aneris')())
File "/home/b/b381315/.conda/envs/hjia/lib/python3.9/site-packages/aneris/cli.py", line 90, in main
harmonize(args.input_file, args.history, args.regions,
File "/home/b/b381315/.conda/envs/hjia/lib/python3.9/site-packages/aneris/cli.py", line 64, in harmonize
driver.harmonize(scenario)
File "/home/b/b381315/.conda/envs/hjia/lib/python3.9/site-packages/aneris/harmonize.py", line 489, in harmonize
self._model, self._meta = _harmonize_regions(
File "/home/b/b381315/.conda/envs/hjia/lib/python3.9/site-packages/aneris/harmonize.py", line 619, in _harmonize_regions
model = harmonizer.harmonize(overrides=overrides)
File "/home/b/b381315/.conda/envs/hjia/lib/python3.9/site-packages/aneris/harmonize.py", line 261, in harmonize
raise ValueError(msg.format(method, report))
ValueError: Harmonization failed with method reduce_ratio_2080 harmonized values != historical values. This is likely due to an override in the following variables:

region gas sector units 2019
0 World BC prefix|sector1|suffix kt 53369.230769

I searched on the offical website and github of aneris, but couldn't find a solution. The input data are also attached (data_aneris.zip). Many thanks!

data_aneris.zip

@gidden
Copy link
Member

gidden commented Apr 19, 2022

Hi @hljia - thanks for creating this issue! At first glance from the output and files you provided, it seems that the mapping of regions provided to aneris does not match with the historical and model data.

Specifically, you need to develop a mapping file that maps the ISO Code in your historical data to the Native Region values of your modelled data.

I also can not seem to open the relevant history and model data files (they have no extension).

@hljia
Copy link
Author

hljia commented Apr 20, 2022

Hi @gidden,

Many thanks for you reply! I tried to modify the mapping file as following, but unfortunately it doesn't work also with the same error.

ISO Code,Country,Native Region Code,5_region
EU,EU,EU,EU
World,World,World,World

I am now attaching history and model data files for your information.
history_EU_BC.xls
ssp245_EU_BC.xls

@gidden
Copy link
Member

gidden commented Apr 20, 2022

Hi @hljia - I was not able to reproduce the specific error you report here, but after investigating your example data, I was able to produce harmonized results with the attached data set (regions.csv and rc.yaml have been updated, other files are as you provided) and the below command

$ aneris --history history_EU_BC.xls --regions regions.csv --rc rc.yaml ssp245_EU_BC.xls

test-aneris.zip

@gidden
Copy link
Member

gidden commented Apr 20, 2022

If you can confirm, feel free to close this issue, please!

@hljia
Copy link
Author

hljia commented Apr 20, 2022

Hi@gidden Many thanks for you help.

@hljia hljia closed this as completed Apr 20, 2022
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

No branches or pull requests

2 participants