Skip to content

DATA API LitPop data for Turkey fails for unclear reason #1043

@spjuhel

Description

@spjuhel

Describe the bug
A clear and concise description of what the bug is:

Trying to fetch the LitPop Exposures object for Turkey fails and state that there is no dataset meeting the requirements, though Turkey is listed in the available countries.

To Reproduce
Steps to reproduce the behavior/error:

Running the following:

from climada.util.api_client import Client
client.get_litpop("TUR")

Raises the following error:

---------------------------------------------------------------------------
NoResult                                  Traceback (most recent call last)
Cell In[18], line 1
----> 1 client.get_litpop("TUR")

File [~/miniforge3/envs/climada6/lib/python3.11/site-packages/climada/util/api_client.py:982](http://localhost:8888/lab/tree/Repos/interoperability_sandbox/miniforge3/envs/climada6/lib/python3.11/site-packages/climada/util/api_client.py#line=981), in Client.get_litpop(self, country, exponents, version, dump_dir)
    980 else:
    981     raise ValueError("country must be string")
--> 982 return self.get_exposures(
    983     exposures_type="litpop",
    984     properties=properties,
    985     version=version,
    986     dump_dir=dump_dir,
    987 )

File [~/miniforge3/envs/climada6/lib/python3.11/site-packages/climada/util/api_client.py:878](http://localhost:8888/lab/tree/Repos/interoperability_sandbox/miniforge3/envs/climada6/lib/python3.11/site-packages/climada/util/api_client.py#line=877), in Client.get_exposures(self, exposures_type, name, version, properties, status, dump_dir)
    873 if not exposures_type in EXP_TYPES:
    874     raise ValueError(
    875         "Valid exposures types are a subset of CLIMADA exposures types."
    876         f" Currently these types are supported: {EXP_TYPES}"
    877     )
--> 878 dataset = self.get_dataset_info(
    879     data_type=exposures_type,
    880     name=name,
    881     version=version,
    882     properties=properties,
    883     status=status,
    884 )
    885 return self.to_exposures(dataset, dump_dir)

File [~/miniforge3/envs/climada6/lib/python3.11/site-packages/climada/util/api_client.py:478](http://localhost:8888/lab/tree/Repos/interoperability_sandbox/miniforge3/envs/climada6/lib/python3.11/site-packages/climada/util/api_client.py#line=477), in Client.get_dataset_info(self, data_type, name, version, properties, status)
    476     data_info = self.list_dataset_infos(data_type)
    477     properties = self.get_property_values(data_info)
--> 478     raise Client.NoResult(
    479         "there is no dataset meeting the requirements, the following"
    480         f" property values are available for {data_type}: {properties}"
    481     )
    482 return jarr[0]

NoResult: there is no dataset meeting the requirements, the following property values are available for litpop: {'res_arcsec': ['150'], 'exponents': ['(3,0)', '(0,1)', '(1,1)'], 'fin_mode': ['pc', 'pop'], 'spatial_coverage': ['country', 'global'], 'country_iso3alpha': ['SUR', 'SOM', 'ECU', 'ISL', 'KHM', 'FRO', 'IRL', 'ESP', 'SVN', 'DNK', 'RUS', 'LUX', 'COD', 'VGB', 'USA', 'URY', 'ALB', 'CHE', 'KEN', 'IMN', 'PRT', 'QAT', 'EST', 'DEU', 'MEX', 'MOZ', 'TCA', 'UGA', 'BRB', 'LVA', 'CZE', 'ARE', 'GNQ', 'IRQ', 'SVK', 'FJI', 'ETH', 'UZB', 'MDA', 'ZAF', 'CUB', 'NLD', 'CAF', 'HTI', 'SEN', 'GEO', 'PRI', 'JPN', 'GBR', 'ROU', 'PLW', 'ERI', 'SDN', 'MNG', 'TCD', 'LCA', 'GUY', 'IND', 'GRD', 'JEY', 'MDV', 'WSM', 'ABW', 'MUS', 'NCL', 'LSO', 'BHR', 'OMN', 'CMR', 'LBR', 'TTO', 'GMB', 'TKM', 'MSR', 'LBN', 'MNP', 'AUS', 'MCO', 'BDI', 'MLT', 'NRU', 'SYC', 'RWA', 'FRA', 'DMA', 'DZA', 'GNB', 'CIV', 'CHN', 'MAR', 'VUT', 'VCT', 'MHL',  'NAM', 'CRI', 'TWN', 'COK',

 'TUR', # Indeed present

 'SWE', 'GGY', 'SLB', 'MLI', 'TGO', 'TUN', 'BEL', 'LAO', 'BHS', 'BLR', 'NPL', 'TUV', 'AGO', 'NOR', 'VIR', 'HND', 'SSD', 'SLE', 'KGZ', 'BMU', 'MWI', 'NFK', 'BTN', 'BLM', 'CYP', 'CUW', 'TON', 'CPV', 'PYF', 'SWZ', 'UKR', 'YEM', 'VEN', 'BIH', 'MMR', 'TJK', 'COL', 'MRT', 'GHA', 'ITA', 'KAZ', 'AUT', 'BRN', 'BEN', 'CAN', 'BOL', 'BGR', 'CYM', 'COM', 'NER', 'NZL', 'NIU', 'VNM', 'HKG', 'PRY', 'KNA', 'GRC', 'SRB', 'TLS', 'LTU', 'MYS', 'ARM', 'CHL', 'ASM', 'EGY', 'PNG', 'PSE', 'GAB', 'ZWE', 'AIA', 'BRA', 'THA', 'POL', 'GTM', 'DOM', 'HUN', 'GUM', 'FIN', 'ISR', 'SHN', 'SPM', 'AND', 'ZMB', 'NGA', 'BFA', 'ATG', 'GRL', 'IDN', 'FSM', 'IRN', 'PAK', 'KOR', 'STP', 'FLK', 'PER', 'AFG', 'SMR', 'SGP', 'DJI', 'JOR', 'SAU', 'PRK', 'HRV', 'PHL', 'MDG', 'BLZ', 'MAF', 'AZE', 'MNE', 'COG', 'MKD', 'LKA', 'BWA', 'NIC', 'ARG', 'TZA', 'GIN', 'JAM', 'SLV', 'KIR', 'PAN', 'KWT', 'BGD', 'LIE', 'WLF', 'HMD', 'UMI', 'LBY', 'SGS', 'ESH', 'PCN', 'ATF', 'SYR', 'ALA', 'IOT'], 'country_name': ['Suriname', 'Somalia', 'Ecuador', 'Iceland', 'Cambodia', 'Faroe Islands', 'Ireland', 'Spain', 'Slovenia', 'Denmark', 'Russian Federation', 'Luxembourg', 'Congo, The Democratic Republic of the', 'Virgin Islands, British', 'United States', 'Uruguay', 'Albania', 'Switzerland', 'Kenya', 'Isle of Man', 'Portugal', 'Qatar', 'Estonia', 'Germany', 'Mexico', 'Mozambique', 'Turks and Caicos Islands', 'Uganda', 'Barbados', 'Latvia', 'Czechia', 'United Arab Emirates', 'Equatorial Guinea', 'Iraq', 'Slovakia', 'Fiji', 'Ethiopia', 'Uzbekistan', 'Moldova, Republic of', 'South Africa', 'Cuba', 'Netherlands', 'Central African Republic', 'Haiti', 'Senegal', 'Georgia', 'Puerto Rico', 'Japan', 'United Kingdom', 'Romania', 'Palau', 'Eritrea', 'Sudan', 'Mongolia', 'Chad', 'Saint Lucia', 'Guyana', 'India', 'Grenada', 'Jersey', 'Maldives', 'Samoa', 'Aruba', 'Mauritius', 'New Caledonia', 'Lesotho', 'Bahrain', 'Oman', 'Cameroon', 'Liberia', 'Trinidad and Tobago', 'Gambia', 'Turkmenistan', 'Montserrat', 'Lebanon', 'Northern Mariana Islands', 'Australia', 'Monaco', 'Burundi', 'Malta', 'Nauru', 'Seychelles', 'Rwanda', 'France', 'Dominica', 'Algeria', 'Guinea-Bissau', "Côte d'Ivoire", 'China', 'Morocco', 'Vanuatu', 'Saint Vincent and the Grenadines', 'Marshall Islands', 'Namibia', 'Costa Rica', 'Taiwan, Province of China', 'Cook Islands', 'Turkey', 'Sweden', 'Guernsey', 'Solomon Islands', 'Mali', 'Togo', 'Tunisia', 'Belgium', "Lao People's Democratic Republic", 'Bahamas', 'Belarus', 'Nepal', 'Tuvalu', 'Angola', 'Norway', 'Virgin Islands, U.S.', 'Honduras', 'South Sudan', 'Sierra Leone', 'Kyrgyzstan', 'Bermuda', 'Malawi', 'Norfolk Island', 'Bhutan', 'Saint Barthélemy', 'Cyprus', 'Curaçao', 'Tonga', 'Cabo Verde', 'French Polynesia', 'Eswatini', 'Ukraine', 'Yemen', 'Venezuela, Bolivarian Republic of', 'Bosnia and Herzegovina', 'Myanmar', 'Tajikistan', 'Colombia', 'Mauritania', 'Ghana', 'Italy', 'Kazakhstan', 'Austria', 'Brunei Darussalam', 'Benin', 'Canada', 'Bolivia, Plurinational State of', 'Bulgaria', 'Cayman Islands', 'Comoros', 'Niger', 'New Zealand', 'Niue', 'Viet Nam', 'Hong Kong', 'Paraguay', 'Saint Kitts and Nevis', 'Greece', 'Serbia', 'Timor-Leste', 'Lithuania', 'Malaysia', 'Armenia', 'Chile', 'American Samoa', 'Egypt', 'Papua New Guinea', 'Palestine, State of', 'Gabon', 'Zimbabwe', 'Anguilla', 'Brazil', 'Thailand', 'Poland', 'Guatemala', 'Dominican Republic', 'Hungary', 'Guam', 'Finland', 'Israel', 'Saint Helena, Ascension and Tristan da Cunha', 'Saint Pierre and Miquelon', 'Andorra', 'Zambia', 'Nigeria', 'Burkina Faso', 'Antigua and Barbuda', 'Greenland', 'Indonesia', 'Micronesia, Federated States of', 'Iran, Islamic Republic of', 'Pakistan', 'Korea, Republic of', 'Sao Tome and Principe', 'Falkland Islands (Malvinas)', 'Peru', 'Afghanistan', 'San Marino', 'Singapore', 'Djibouti', 'Jordan', 'Saudi Arabia', "Korea, Democratic People's Republic of", 'Croatia', 'Philippines', 'Madagascar', 'Belize', 'Saint Martin (French part)', 'Azerbaijan', 'Montenegro', 'Congo', 'North Macedonia', 'Sri Lanka', 'Botswana', 'Nicaragua', 'Argentina', 'Tanzania, United Republic of', 'Guinea', 'Jamaica', 'El Salvador', 'Kiribati', 'Panama', 'Kuwait', 'Bangladesh', 'Liechtenstein', 'Wallis and Futuna', 'Heard Island and McDonald Islands', 'United States Minor Outlying Islands', 'Libya', 'South Georgia and the South Sandwich Islands', 'Western Sahara', 'Pitcairn', 'French Southern Territories', 'Syrian Arab Republic', 'Åland Islands', 'British Indian Ocean Territory'], 'country_iso3num': ['740', '706', '218', '352', '116', '234', '372', '724', '705', '208', '643', '442', '180', '092', '840', '858', '008', '756', '404', '833', '620', '634', '233', '276', '484', '508', '796', '800', '052', '428', '203', '784', '226', '368', '703', '242', '231', '860', '498', '710', '192', '528', '140', '332', '686', '268', '630', '392', '826', '642', '585', '232', '729', '496', '148', '662', '328', '356', '308', '832', '462', '882', '533', '480', '540', '426', '048', '512', '120', '430', '780', '270', '795', '500', '422', '580', '036', '492', '108', '470', '520', '690', '646', '250', '212', '012', '624', '384', '156', '504', '548', '670', '584', '516', '188', '158', '184', '792', '752', '831', '090', '466', '768', '788', '056', '418', '044', '112', '524', '798', '024', '578', '850', '340', '728', '694', '417', '060', '454', '574', '064', '652', '196', '531', '776', '132', '258', '748', '804', '887', '862', '070', '104', '762', '170', '478', '288', '380', '398', '040', '096', '204', '124', '068', '100', '136', '174', '562', '554', '570', '704', '344', '600', '659', '300', '688', '626', '440', '458', '051', '152', '016', '818', '598', '275', '266', '716', '660', '076', '764', '616', '320', '214', '348', '316', '246', '376', '654', '666', '020', '894', '566', '854', '028', '304', '360', '583', '364', '586', '410', '678', '238', '604', '004', '674', '702', '262', '400', '682', '408', '191', '608', '450', '084', '663', '031', '499', '178', '807', '144', '072', '558', '032', '834', '324', '388', '222', '296', '591', '414', '050', '438', '876', '334', '581', '434', '239', '732', '612', '260', '760', '248', '086']}

Expected behavior
A clear and concise description of what you expected to happen.

The function should return the LitPop Exposures object for Turkey?

Climada Version: version 6.0.1

System Information (please complete the following information):

  • Operating system: Ubuntu
  • Python version: 3.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    Data APIRelated to the Data API, not to this code base directlybug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions