it-is-me-mario / MARIO

Multifunctional Analysis of Regions through Input-Output
GNU General Public License v3.0
41 stars 13 forks source link

Misleading error message for `parse_eurostat` #2

Closed maximikos closed 2 years ago

maximikos commented 2 years ago

Following the documentation for the Eurostat-parsing functionality, I ran into below error ("non-corresponding years"). This is unexpected since I was strictly following the documentation, i.e. did everything as described there. Any ideas why that happens and how to get my SUTs?

`--------------------------------------------------------------------------- WrongInput Traceback (most recent call last) c:\Users\maximiko\IO-testbed\Eurostat_MARIO.py in ----> 18 italy_sut = parse_eurostat( 19 supply_path = supply_path, 20 use_path = use_path, 21 region = "Italy", 22 year = 2011

~\Anaconda3\envs\pymrio\lib\site-packages\mario\tools\parsersclass.py in parse_eurostat(supply_path, use_path, region, year, consumption_categories, factors_of_production, imports, model, name, calc_all, **kwargs) 432 table = "SUT" 433 if table == "SUT": --> 434 matrices, indeces, units = eurostat_sut( 435 supply_path, 436 use_path,

~\Anaconda3\envs\pymrio\lib\site-packages\mario\tools\tableparser.py in eurostat_sut(supply_path, use_path, region, selected_year, consumption_categories, factors_of_production, imports) 992 years = supply_years 993 else: --> 994 raise WrongInput("No correspondance between years of use and supply tables") 995 996 "Warning on supply in IxP format, Use in PxI format"

WrongInput: No correspondance between years of use and supply tables`

mohammadamint commented 2 years ago

Dear @maximikos this error should happen when the giver year does not correspond to the table you downloaded from Eurostat. but there is the possibility that the error is not handled correctly due to the structure of the database downloaded. would you please send your database then I can check and we may improve the error message to be more clear?

LorenzoRinaldi commented 2 years ago

Dear @maximikos I tested the function and it works if you download tables in M€ only (so selecting just one unit of measure). We will improve the example provided on the documentation and certainly we will also work on making the eurostat parser more general and flexible to different table formats. In case you face the same issue, please send your database we will test it together with @mohammadamint.

maximikos commented 2 years ago

Hi Mohammad,

Thanks for your reply! I downloaded the two files according to how it is described in the documentation. After the import with those did not work, I removed the entries for the national currencies so that only the tables in € were left (see attached) – but that also did not work.

Any idea what might have gone wrong?

Max

From: Mohammad Amin Tahavori @.> Sent: Tuesday, November 9, 2021 11:12 PM To: SESAM-Polimi/MARIO @.> Cc: maximikos @.>; Mention @.> Subject: Re: [SESAM-Polimi/MARIO] Misleading error message for parse_eurostat (Issue #2)

Dear @maximikos https://github.com/maximikos this error should happen when the giver year does not correspond to the table you downloaded from Eurostat. but there is the possibility that the error is not handled correctly due to the structure of the database download. would you please send your database then I can check and we may improve the error message to be more clear?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SESAM-Polimi/MARIO/issues/2#issuecomment-964592565 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ARSJGO6PA26I423RHJZO3BTULGMBVANCNFSM5HTAJX7A . https://github.com/notifications/beacon/ARSJGO3W7LJIRGRGJ57K2XLULGMBVA5CNFSM5HTAJX7KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHF7IHNI.gif

mohammadamint commented 2 years ago

@maximikos there are a couple of small issues with the validation of the database format from Eurostat. we are fixing the issues and the new version will be uploaded very soon. AS we just published the first release there are minor issues with some of the functions and we are fixing them. Unfortunately, I can't find the attached file. Would you please send it by email? so we can spot the error. Moreover, you can also reshape your database to the acceptable excel format for mario. Looking forward to your email!!