| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Discussion of the data-api client requirements and implementation
The data-api client, climada.util.api_client.Client is meant for
The implemented methods are supposed to be as natural as possible and hiding away boilerplate code that downloads files, reads and converts content into CLIMADA objects. Additionally they should take care of caching files on the local filesystem in order to save resources of the api server.
This discussion is based on the most up-to-date implementation of the API client which can currently be found on branch https://github.com/CLIMADA-project/climada_python/tree/feature/data-api-1.0.
only datatype and group
... plus status, description and properties
returns: a list of DataTypeInfo objects
arguments:
purpose: show what kind of datasets are available from climada.ethz.ch
comments:
suggestions:
returns: a DataTypeInfo object
arguments:
purpose: give additional information about a data type: mandatory and optional properties of datasets from this type.
comments:
suggestions:
returns: a dataframe of property values
arguments:
purpose: show properties of a given datatype and a selection of possible values, in order to make meaningful queries
coments:
suggestions:
returns: a list of DatasetInfo objects
arguments:
purpose: query climada.ethz.ch for datasets matching given arguments
comments:
suggestions:
returns: a single DatasetInfo object
arguments: same as list_dataset_infos
purpose: same as list_dataset_info - but raise a descriptive exception if the result of the query doesn't yield exactly 1 dataset.
comments:
suggestions:
list_data_type_infos_exposures = client.list_data_type_infos(data_type_group='exposures') set([data_type_info.data_type for data_type_info in list_data_type_infos_exposures])
returns: the path of the target directory and the downloaded files
arguments:
purpose: download the whole data set (all files) into the given target directory - or just point to the files if they have been downloaded before
comments:
suggestions:
returns:
arguments:
purpose: downloads a single file from a dataset to the given target destination, checking success and retrying in case of failure
comments: used in download_dataset, to_hazard and to_exposures. In the latter two mainly to allow target destination and skip downloads of non-hdf5 files which is a hypothetical use case.
suggestions:
arguments:
purpose: remove inconsistent download pathes from the cache db
suggestions:
returns: a Hazard object
arguments:
purpose: search climada.ethz.ch for a matching hazard, download the file and read it into a Hazard object.
comments:
suggestions:
returns: an Exposures object
arguments:
purpose: search climada.ethz.ch for a matching hazard, download the file and read it into a Hazard object.
comments:
suggestions:
returns: a Litpop object
arguments:
purpose: get the global or country litpop exposures object with fin_mode 'pc' and exponents '(1,1)'
comments:
suggestions:
returns: a Hazard object
arguments:
purpose: used in get_hazard
comments:
suggestions:
returns: an Exposures object
arguments:
purpose: used in get_exposures
comments:
suggestions:
| Back | FazBrowse Home | New Git URL |