Skip to content

Commit

Permalink
tutorial api client: fix hierachical level definition
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuel-schmid committed Feb 14, 2022
1 parent 5a419b2 commit 96c643c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion climada/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '3.1.1-dev'
__version__ = '3.1.1'
37 changes: 19 additions & 18 deletions doc/tutorial/climada_util_api_client.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
" - [Datasets and Properties](#Datasets-and-Properties)\n",
"- [Basic impact calculation](#Basic-impact-calculation)\n",
" - [Wrapper functions to open datasets as CLIMADA objects](#Wrapper-functions-to-open-datasets-as-CLIMADA-objects)\n",
" - [Calculate the impact](#Calculate-the-impact)\n",
"- [Technical Information](#Technical-Information)\n",
" - [Server](#Server)\n",
" - [Client](#Client)\n",
Expand All @@ -31,7 +32,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Finding datasets"
"## Finding datasets"
]
},
{
Expand All @@ -48,7 +49,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Data types and data type groups\n",
"### Data types and data type groups\n",
"The datasets are first separated into 'data_type_groups', which represent the main classes of CLIMADA (exposures, hazard, vulnerability, ...). So far, data is available for exposures and hazard. Then, data is separated into data_types, representing the different hazards and exposures available in CLIMADA"
]
},
Expand Down Expand Up @@ -173,7 +174,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Datasets and Properties\n",
"### Datasets and Properties\n",
"For each data type, the single datasets can be differentiated based on properties. The following function provides a table listing the properties and possible values. This table does not provide information on properties that can be combined but the search can be refined in order to find properties to query a unique dataset. Note that a maximum of 10 property values are shown here, but many more countries are available for example."
]
},
Expand Down Expand Up @@ -219,7 +220,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Refining the search:"
"#### Refining the search:"
]
},
{
Expand Down Expand Up @@ -280,7 +281,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Basic impact calculation\n",
"## Basic impact calculation\n",
"We here show how to make a basic impact calculation with tropical cyclones for Haiti, for the year 2040, rcp4.5 and generated with 10 synthetic tracks. For more technical details on the API, see below.\n",
"\n"
]
Expand All @@ -289,14 +290,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Wrapper functions to open datasets as CLIMADA objects"
"### Wrapper functions to open datasets as CLIMADA objects"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### The wrapper functions client.get_hazard() \n",
"#### The wrapper functions client.get_hazard() \n",
"gets the dataset information, downloads the data and opens it as a hazard instance\n"
]
},
Expand Down Expand Up @@ -368,7 +369,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### The wrapper functions client.get_litpop_default() \n",
"#### The wrapper functions client.get_litpop_default() \n",
"gets the default litpop, with exponents (1,1) and 'produced capital' as financial mode. If no country is given, the global dataset will be downloaded."
]
},
Expand Down Expand Up @@ -396,7 +397,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Get the default impact function for tropical cyclones"
"#### Get the default impact function for tropical cyclones"
]
},
{
Expand Down Expand Up @@ -459,7 +460,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Getting other Exposures"
"#### Getting other Exposures"
]
},
{
Expand Down Expand Up @@ -500,7 +501,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Technical Information\n",
"## Technical Information\n",
"\n",
"For programmatical access to the CLIMADA data API there is a specific REST call wrapper class: `climada.util.client.Client`."
]
Expand All @@ -509,7 +510,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Server\n",
"### Server\n",
"The CLIMADA data file server is hosted on https://data.iac.ethz.ch that can be accessed via a REST API at https://climada.ethz.ch.\n",
"For REST API details, see the [documentation](https:/climada.ethz.ch/rest/docs)."
]
Expand All @@ -518,7 +519,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Client"
"### Client"
]
},
{
Expand Down Expand Up @@ -595,9 +596,9 @@
"tags": []
},
"source": [
"## Metadata\n",
"### Metadata\n",
"\n",
"### Unique Identifiers\n",
"#### Unique Identifiers\n",
"Any dataset can be identified with **data_type**, **name** and **version**. The combination of the three is unique in the API servers' underlying database.\n",
"However, sometimes the name is already enough for identification.\n",
"All datasets have a UUID, a universally unique identifier, which is part of their individual url. \n",
Expand Down Expand Up @@ -638,7 +639,7 @@
"tags": []
},
"source": [
"### Data Set Status\n",
"#### Data Set Status\n",
"The datasets of climada.ethz.ch may have the following stati:\n",
"- **active**: the deault for real life data\n",
"- **preliminary**: when the dataset is already uploaded but some information or file is still missing\n",
Expand All @@ -651,7 +652,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### DatasetInfo Objects and DataFrames\n",
"#### DatasetInfo Objects and DataFrames\n",
"\n",
"As stated above `get_dataset` (or `get_dataset_by_uuid`) return a `DatasetInfo` object and `get_datasets` a list thereof."
]
Expand Down Expand Up @@ -952,7 +953,7 @@
"tags": []
},
"source": [
"## Download\n",
"### Download\n",
"\n",
"The wrapper functions get_exposures or get_hazard fetch the information, download the file and opens the file as a climada object. But one can also just download dataset files using the method `download_dataset` which takes a `DatasetInfo` object as argument and downloads all files of the dataset to a directory in the local file system."
]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
setup(
name='climada',

version='3.1.1-dev',
version='3.1.1',

description='CLIMADA in Python',

Expand Down

0 comments on commit 96c643c

Please sign in to comment.