From d6d48b8808c70e355f656e3aaed8df7b26c945a5 Mon Sep 17 00:00:00 2001 From: Pontus Lurcock Date: Tue, 30 Jun 2020 17:46:41 +0200 Subject: [PATCH] Various updates for 0.5.0 release - Update readme. - Add CHANGES.md. - Re-run notebooks and fix a bug in example notebook 1. - Bump version number in version.py to 0.5.0. --- CHANGES.md | 3 + README.md | 26 +-- examples/notebooks/Ex0-CDS-store-setup.ipynb | 6 +- examples/notebooks/Ex1-CDS-store-access.ipynb | 194 +++++++++--------- xcube_cds/version.py | 2 +- 5 files changed, 117 insertions(+), 114 deletions(-) create mode 100644 CHANGES.md diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 0000000..1ac3c5e --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,3 @@ +## Changes in 0.5.0 + +Initial released version. diff --git a/README.md b/README.md index 3f50f19..3d93365 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ Currently supported datasets: ## Setup -xcube and cdsapi must be installed before the xcube_cds plugin. +[xcube](https://github.com/dcs4cop/xcube) and cdsapi must be installed +before the xcube_cds plugin. In order to use the xcube_cds plugin, you also need to obtain a CDS API key and write it to a configuration file. Additionally, you need to use the CDS website to agree to the terms of use for any datasets you acccess. These @@ -18,31 +19,30 @@ steps are described in more detail below. ### Install xcube -[xcube](https://github.com/dcs4cop/xcube) can be installed from -[conda-forge](https://conda-forge.org/) using the -conda package manager, like this: +xcube 0.5 can be built from source, like this: ``` -$ conda create --name xcube xcube>=0.4 +$ git clone https://github.com/dcs4cop/xcube.git +$ cd xcube +$ conda env create $ conda activate xcube +$ python setup.py develop ``` -xcube can also be built from source, like this: +Once xcube 0.5 becomes available on [conda-forge](https://conda-forge.org/), +it can be installed using the conda package manager, like this: ``` -$ git clone https://github.com/dcs4cop/xcube.git -$ cd xcube -$ conda env create +$ conda create --name xcube xcube>=0.5 $ conda activate xcube -$ python setup.py develop ``` ### Install cdsapi xcube_cds makes use of the -[cdsapi Python library](https://github.com/ecmwf/cdsapi) to connect to the CDS -API, which is also available from conda-forge. You can install it into an -xcube environment like this: +[cdsapi Python library](https://github.com/ecmwf/cdsapi), +which is available from conda-forge, to connect to the CDS API. +You can install it into an xcube environment like this: ``` $ conda activate xcube diff --git a/examples/notebooks/Ex0-CDS-store-setup.ipynb b/examples/notebooks/Ex0-CDS-store-setup.ipynb index 9ea9d43..d593c9a 100644 --- a/examples/notebooks/Ex0-CDS-store-setup.ipynb +++ b/examples/notebooks/Ex0-CDS-store-setup.ipynb @@ -44,7 +44,7 @@ { "data": { "text/plain": [ - "'0.0.0.dev0'" + "'0.5.0'" ] }, "execution_count": 1, @@ -83,7 +83,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -92,7 +92,7 @@ "('dataset',)" ] }, - "execution_count": 5, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } diff --git a/examples/notebooks/Ex1-CDS-store-access.ipynb b/examples/notebooks/Ex1-CDS-store-access.ipynb index 513d75d..d6bd400 100644 --- a/examples/notebooks/Ex1-CDS-store-access.ipynb +++ b/examples/notebooks/Ex1-CDS-store-access.ipynb @@ -18,7 +18,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Before using this notebook, ensure that you have set up xcube, the CDS plugin, and Jupyter Lab as described in the [Ex0-CDS-Setup](./Ex0-CDS-Setup.ipynb) notebook." + "Before using this notebook, ensure that you have set up xcube, the CDS plugin, and Jupyter Lab as described in the [Ex0-CDS-store-Setup](./Ex0-CDS-store-setup.ipynb) notebook." ] }, { @@ -78,13 +78,69 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "cds_store = CDSDataStore(normalize_names=True)" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Find out which datasets are available from this store. We get a list of tuples; the first member of each tuple is the data ID, and the second member is a short description of the dataset. We pick the third: ‘ERA5 monthly averaged data on single levels – Monthly averaged reanalysis’." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[('reanalysis-era5-single-levels-monthly-means:monthly_averaged_ensemble_members',\n", + " 'ERA5 monthly averaged data on single levels – Monthly averaged ensemble members'),\n", + " ('reanalysis-era5-single-levels-monthly-means:monthly_averaged_ensemble_members_by_hour_of_day',\n", + " 'ERA5 monthly averaged data on single levels – Monthly averaged ensemble members by hour of day'),\n", + " ('reanalysis-era5-single-levels-monthly-means:monthly_averaged_reanalysis',\n", + " 'ERA5 monthly averaged data on single levels – Monthly averaged reanalysis'),\n", + " ('reanalysis-era5-single-levels-monthly-means:monthly_averaged_reanalysis_by_hour_of_day',\n", + " 'ERA5 monthly averaged data on single levels – Monthly averaged reanalysis by hour of day')]" + ] + }, + "execution_count": 4, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data_ids = list(cds_store.get_data_ids())\n", + "data_ids" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "'reanalysis-era5-single-levels-monthly-means:monthly_averaged_reanalysis'" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "data_id = data_ids[2][0]\n", + "data_id" + ] + }, { "cell_type": "markdown", "metadata": {}, @@ -94,7 +150,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -476,18 +532,18 @@ } }, "required": [ - "time_range", "spatial_res", + "variable_names", "bbox", - "variable_names" + "time_range" ], "type": "object" }, "text/plain": [ - "" + "" ] }, - "execution_count": 18, + "execution_count": 6, "metadata": {}, "output_type": "execute_result" } @@ -498,7 +554,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -514,7 +570,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 8, "metadata": {}, "outputs": [], "source": [ @@ -535,7 +591,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -593,7 +649,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -609,7 +665,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -625,7 +681,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -634,7 +690,7 @@ "('dataset:netcdf:cds',)" ] }, - "execution_count": 7, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -647,69 +703,13 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "opener = openers[0]" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Find out which datasets are available from this store. We get a list of tuples; the first member of each tuple is the data ID, and the second member is a short description of the dataset. We pick the third: ‘ERA5 monthly averaged data on single levels – Monthly averaged reanalysis’." - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[('reanalysis-era5-single-levels-monthly-means:monthly_averaged_ensemble_members',\n", - " 'ERA5 monthly averaged data on single levels – Monthly averaged ensemble members'),\n", - " ('reanalysis-era5-single-levels-monthly-means:monthly_averaged_ensemble_members_by_hour_of_day',\n", - " 'ERA5 monthly averaged data on single levels – Monthly averaged ensemble members by hour of day'),\n", - " ('reanalysis-era5-single-levels-monthly-means:monthly_averaged_reanalysis',\n", - " 'ERA5 monthly averaged data on single levels – Monthly averaged reanalysis'),\n", - " ('reanalysis-era5-single-levels-monthly-means:monthly_averaged_reanalysis_by_hour_of_day',\n", - " 'ERA5 monthly averaged data on single levels – Monthly averaged reanalysis by hour of day')]" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "data_ids = list(cds_store.get_data_ids())\n", - "data_ids" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'reanalysis-era5-single-levels-monthly-means:monthly_averaged_reanalysis'" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "data_id = data_ids[2][0]\n", - "data_id" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -719,18 +719,18 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ - "2020-06-30 16:14:04,192 INFO Welcome to the CDS\n", - "2020-06-30 16:14:04,193 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/reanalysis-era5-single-levels-monthly-means\n", - "2020-06-30 16:14:04,922 INFO Request is completed\n", - "2020-06-30 16:14:04,923 INFO Downloading http://136.156.132.201/cache-compute-0004/cache/data3/adaptor.mars.internal-1593507171.6620858-19187-3-5f30ef70-2d78-4558-b052-8551d560c654.nc to /tmp/tmp02tysyfl/tmpiji5ab10/data.nc (3.7M)\n", - "2020-06-30 16:14:08,075 INFO Download rate 1.2M/s \n" + "2020-06-30 17:39:17,887 INFO Welcome to the CDS\n", + "2020-06-30 17:39:17,890 INFO Sending request to https://cds.climate.copernicus.eu/api/v2/resources/reanalysis-era5-single-levels-monthly-means\n", + "2020-06-30 17:39:18,435 INFO Request is completed\n", + "2020-06-30 17:39:18,436 INFO Downloading http://136.156.132.201/cache-compute-0004/cache/data3/adaptor.mars.internal-1593507171.6620858-19187-3-5f30ef70-2d78-4558-b052-8551d560c654.nc to /tmp/tmp77vefh8y/tmp9nexlwf3/data.nc (3.7M)\n", + "2020-06-30 17:39:19,087 INFO Download rate 5.7M/s \n" ] } ], @@ -752,16 +752,16 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "[]" + "[]" ] }, - "execution_count": 12, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" }, @@ -786,21 +786,21 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "We can explore these data by plotting temperature map for selected time points. First, we select January 2001. Land areas – and mountain ranges in particular – show up on the map as colder regions." + "We can explore these data by plotting a temperature map for selected time points. First, we select January 2001. Land areas – and mountain ranges in particular – show up on the map as colder regions." ] }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 37, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" }, @@ -831,16 +831,16 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 38, + "execution_count": 17, "metadata": {}, "output_type": "execute_result" }, @@ -871,16 +871,16 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 40, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" }, @@ -910,7 +910,7 @@ }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ @@ -929,16 +929,16 @@ }, { "cell_type": "code", - "execution_count": 46, + "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 46, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" }, @@ -968,16 +968,16 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 47, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" }, diff --git a/xcube_cds/version.py b/xcube_cds/version.py index 5d1fc1c..c9ab11c 100644 --- a/xcube_cds/version.py +++ b/xcube_cds/version.py @@ -20,4 +20,4 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -version = '0.0.0.dev0' +version = '0.5.0'