util.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. from pathlib import Path
  2. # 4 for use from nbs, fix
  3. root_path = Path(__file__).parents[2].absolute()
  4. root_path = root_path.resolve()
  5. log_path = root_path / "log"
  6. code_path = root_path / "code"
  7. downloaded_data_path = root_path / "downloaded_data" / "UNFCCC"
  8. extracted_data_path = root_path / "extracted_data" / "UNFCCC"
  9. # TODO: move this to a more general location as we can't import it
  10. # to get_submissions_info
  11. custom_country_mapping = {
  12. "EUA": "European Union",
  13. "EUC": "European Union",
  14. "FRK": "France",
  15. "DKE": "Denmark",
  16. "DNM": "Denmark",
  17. "GBK": "United Kingdom of Great Britain and Northern Ireland",
  18. }
  19. all_crf_countries = [
  20. 'AUS', 'AUT', 'BEL', 'BGR', 'BLR',
  21. 'CAN', 'CHE', 'CYP', 'CZE', 'DEU', # 10
  22. 'DKE', 'DNK', 'DNM', 'ESP', 'EST',
  23. 'EUA', 'EUC', 'FIN', 'FRA', 'FRK', # 20
  24. 'GBK', 'GBR', 'GRC', 'HRV', 'HUN',
  25. 'IRL', 'ISL', 'ITA', 'JPN', 'KAZ', # 30
  26. 'LIE', 'LTU', 'LUX', 'LVA', 'MCO',
  27. 'MLT', 'NLD', 'NOR', 'NZL', 'POL', # 40
  28. 'PRT', 'ROU', 'RUS', 'SVK', 'SVN',
  29. 'SWE', 'TUR', 'UKR', 'USA', # 49
  30. ]
  31. class NoCRFFilesError(Exception):
  32. pass