From 7774b0e1878c021e87578dd3b68b217e88981244 Mon Sep 17 00:00:00 2001 From: tejas Date: Thu, 22 Sep 2022 14:35:03 +0200 Subject: [PATCH 01/13] added setup guide for xcube-cmems --- README.md | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 95 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e80705c..7454869 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,97 @@ +[![Build Status](https://github.com/dcs4cop/xcube-cmems/actions/workflows/unitest-workflow.yml/badge.svg)](https://github.com/dcs4cop/xcube-cmems/actions/workflows/unitest-workflow.yml) # xcube-cmems -A[xcube plugin](https://xcube.readthedocs.io/en/latest/plugins.html) that that allows generating data cubes from the -CMEMS API ![example workflow](https://github.com/dcs4cop/xcube-cmems/actions/workflows/unitest-workflow.yml/badge.svg) \ No newline at end of file +A [xcube plugin](https://xcube.readthedocs.io/en/latest/plugins.html) that that allows generating +data cubes from the CMEMS API. + +## Setup + +### Configuring access to the CMEMS API + +In order to access the CMEMS API via xcube_cmems plugin, you need to create a +[cmems account](https://resources.marine.copernicus.eu/registration-form) + +### Installing the xcube-cmems plugin +This section describes three alternative methods you can use to install the +xcube-cmems plugin. + +conda can sometimes be inconveniently slow when resolving an environment. +If this causes problems, consider using +[mamba](https://github.com/mamba-org/mamba) as a much faster drop-in +alternative to conda. + +#### Installation into a new environment with conda + +xcube-cmems and all necessary dependencies (including xcube itself) are available +on [conda-forge](https://conda-forge.org/), and can be installed using the +[conda package manager](https://docs.conda.io/projects/conda/en/latest/). +The conda package manager itself can be obtained in the [miniconda +distribution](https://docs.conda.io/en/latest/miniconda.html). +Once conda is installed, xcube-cmems can be installed like this: + +``` +$ conda create --name xcube-cmems-environment --channel conda-forge xcube-cmems +$ conda activate xcube-cmems-environment +``` +The name of the environment may be freely chosen. + +#### Installation into an existing environment with conda + +This method assumes that you have an existing conda environment, and you want +to install xcube-cmems into it. + +xcube-cmems can also be installed into an existing conda environment. +With the existing environment activated, execute this command: + +``` +$ conda install --channel conda-forge xcube-cmems +``` +Once again, xcube and any other necessary dependencies will be installed +automatically if they are not already installed. + +#### Installation into an existing environment from the repository + +If you want to install xcube-cmems directly from the git repository (for example +if order to use an unreleased version or to modify the code), you can +do so as follows: + +``` +$ conda create --name xcube-cmems-environment --channel conda-forge --only-deps xcube-cmems +$ conda activate xcube-cmems-environment +$ git clone https://github.com/dcs4cop/xcube-cmems.git +$ python -m pip install --no-deps --editable xcube-cmems/ +``` +This installs all the dependencies of xcube-cmems into a fresh conda environment, +then installs xcube-cmems into this environment from the repository. + +# Testing + +You can run the unit tests for xcube-cmems by executing + +``` +$ pytest +``` + +in the `xcube-cmems` repository. Note that, in order to successfully run the +tests using the current repository version of xcube-cmems, you may also need to +install the repository version of xcube rather than its latest conda-forge +release. + +To create a test coverage report, you can use + +``` +coverage run --include='xcube_cmems/**' --module pytest +coverage html +``` + +This will write a coverage report to `htmlcov/index.html`. + +## Use + +Jupyter notebooks demonstrating the use of the xcube-cmems plugin can be found +in the `examples/notebooks/` subdirectory of the repository. + +## Releasing + +To release `xcube-cmems`, please follow the steps outlined in the +[xcube Developer Guide](https://github.com/dcs4cop/xcube/blob/master/docs/source/devguide.md#release-process). \ No newline at end of file From 9ba6e26006790c0eaa3408d421951f9721c4bf4c Mon Sep 17 00:00:00 2001 From: tejas Date: Thu, 22 Sep 2022 14:37:13 +0200 Subject: [PATCH 02/13] changed the name of workflow --- .github/workflows/unitest-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unitest-workflow.yml b/.github/workflows/unitest-workflow.yml index 13492f8..1ed9ac9 100644 --- a/.github/workflows/unitest-workflow.yml +++ b/.github/workflows/unitest-workflow.yml @@ -1,4 +1,4 @@ -name: Unittest +name: Build on: push: From 70d8be9abda276575492a953d35973b11df067f2 Mon Sep 17 00:00:00 2001 From: tejas Date: Thu, 22 Sep 2022 14:47:41 +0200 Subject: [PATCH 03/13] moved the pydap-zaar JNB to examples/notebook subdir --- {notebooks => examples/notebooks}/pydap-zarr-store.ipynb | 0 notebooks/.gitignore | 3 --- 2 files changed, 3 deletions(-) rename {notebooks => examples/notebooks}/pydap-zarr-store.ipynb (100%) delete mode 100644 notebooks/.gitignore diff --git a/notebooks/pydap-zarr-store.ipynb b/examples/notebooks/pydap-zarr-store.ipynb similarity index 100% rename from notebooks/pydap-zarr-store.ipynb rename to examples/notebooks/pydap-zarr-store.ipynb diff --git a/notebooks/.gitignore b/notebooks/.gitignore deleted file mode 100644 index 3facc7e..0000000 --- a/notebooks/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.ipynb_checkpoints/ -cmems-credentials.json - From 89199d10ead9c128cb85b910ca2c8e43dc452bdb Mon Sep 17 00:00:00 2001 From: Tejas Morbagal Harish Date: Thu, 22 Sep 2022 15:44:39 +0200 Subject: [PATCH 04/13] Update README.md Co-authored-by: Norman Fomferra --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7454869..dda2939 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ data cubes from the CMEMS API. ### Configuring access to the CMEMS API -In order to access the CMEMS API via xcube_cmems plugin, you need to create a +In order to access the CMEMS API via the `xcube-cmems` plugin, you need to create a [cmems account](https://resources.marine.copernicus.eu/registration-form) ### Installing the xcube-cmems plugin From 25abdebef55a669dda69a4b26cc2ba6e69db3053 Mon Sep 17 00:00:00 2001 From: Tejas Morbagal Harish Date: Thu, 22 Sep 2022 15:44:58 +0200 Subject: [PATCH 05/13] Update README.md Co-authored-by: Norman Fomferra --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index dda2939..9c1b6ca 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ data cubes from the CMEMS API. ### Configuring access to the CMEMS API In order to access the CMEMS API via the `xcube-cmems` plugin, you need to create a -[cmems account](https://resources.marine.copernicus.eu/registration-form) +[cmems account](https://resources.marine.copernicus.eu/registration-form) +first, if you not do already have one. ### Installing the xcube-cmems plugin This section describes three alternative methods you can use to install the From aeb976c61366081203315a487438f1a1eba87efc Mon Sep 17 00:00:00 2001 From: Tejas Morbagal Harish Date: Thu, 22 Sep 2022 15:45:07 +0200 Subject: [PATCH 06/13] Update README.md Co-authored-by: Norman Fomferra --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c1b6ca..7bab685 100644 --- a/README.md +++ b/README.md @@ -89,7 +89,7 @@ This will write a coverage report to `htmlcov/index.html`. ## Use -Jupyter notebooks demonstrating the use of the xcube-cmems plugin can be found +Jupyter notebooks demonstrating the use of the `xcube-cmems` plugin can be found in the `examples/notebooks/` subdirectory of the repository. ## Releasing From fb658909bbf6e66fd349a8b00cbd5c45102a0d1f Mon Sep 17 00:00:00 2001 From: Tejas Morbagal Harish Date: Thu, 22 Sep 2022 15:45:16 +0200 Subject: [PATCH 07/13] Update README.md Co-authored-by: Norman Fomferra --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 7bab685..a2e816a 100644 --- a/README.md +++ b/README.md @@ -81,8 +81,7 @@ release. To create a test coverage report, you can use ``` -coverage run --include='xcube_cmems/**' --module pytest -coverage html +pytest --cov xcube_cmems --cov-report html ``` This will write a coverage report to `htmlcov/index.html`. From 59f21a5ed57b47a45a106fdb8df3c314ecc479a3 Mon Sep 17 00:00:00 2001 From: Tejas Morbagal Harish Date: Thu, 22 Sep 2022 15:45:30 +0200 Subject: [PATCH 08/13] Update README.md Co-authored-by: Norman Fomferra --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a2e816a..78dc51c 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ alternative to conda. #### Installation into a new environment with conda -xcube-cmems and all necessary dependencies (including xcube itself) are available +`xcube-cmems` and all necessary dependencies (including xcube itself) are available on [conda-forge](https://conda-forge.org/), and can be installed using the [conda package manager](https://docs.conda.io/projects/conda/en/latest/). The conda package manager itself can be obtained in the [miniconda From 6ffe42d8efc35475218070e50964d493d38a585a Mon Sep 17 00:00:00 2001 From: Tejas Morbagal Harish Date: Thu, 22 Sep 2022 15:46:35 +0200 Subject: [PATCH 09/13] Update README.md Co-authored-by: Norman Fomferra --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 78dc51c..7e2daef 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ The name of the environment may be freely chosen. #### Installation into an existing environment with conda This method assumes that you have an existing conda environment, and you want -to install xcube-cmems into it. +to install `xcube-cmems` into it. xcube-cmems can also be installed into an existing conda environment. With the existing environment activated, execute this command: From 4b5071ca37ea4b17c5a4057d9b2cbb00d26ac753 Mon Sep 17 00:00:00 2001 From: Tejas Morbagal Harish Date: Thu, 22 Sep 2022 15:46:51 +0200 Subject: [PATCH 10/13] Update README.md Co-authored-by: Norman Fomferra --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7e2daef..7a933c7 100644 --- a/README.md +++ b/README.md @@ -62,7 +62,7 @@ $ conda activate xcube-cmems-environment $ git clone https://github.com/dcs4cop/xcube-cmems.git $ python -m pip install --no-deps --editable xcube-cmems/ ``` -This installs all the dependencies of xcube-cmems into a fresh conda environment, +This installs all the dependencies of `xcube-cmems` into a fresh conda environment, then installs xcube-cmems into this environment from the repository. # Testing From b76604967b3e8dd05addb5d32e47f2fce2a65359 Mon Sep 17 00:00:00 2001 From: Tejas Morbagal Harish Date: Thu, 22 Sep 2022 15:46:59 +0200 Subject: [PATCH 11/13] Update README.md Co-authored-by: Norman Fomferra --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a933c7..ed2085d 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ then installs xcube-cmems into this environment from the repository. # Testing -You can run the unit tests for xcube-cmems by executing +You can run the unit tests for `xcube-cmems` by executing ``` $ pytest From 3fc52e73847e1d90b02a6644218cc61b2b23c128 Mon Sep 17 00:00:00 2001 From: Tejas Morbagal Harish Date: Thu, 22 Sep 2022 15:47:08 +0200 Subject: [PATCH 12/13] Update README.md Co-authored-by: Norman Fomferra --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ed2085d..8277c7a 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ $ pytest ``` in the `xcube-cmems` repository. Note that, in order to successfully run the -tests using the current repository version of xcube-cmems, you may also need to +tests using the current repository version of `xcube-cmems`, you may also need to install the repository version of xcube rather than its latest conda-forge release. From f6ff79145c25813cd4d83a2498dc9711f2952534 Mon Sep 17 00:00:00 2001 From: Tejas Morbagal Harish Date: Thu, 22 Sep 2022 15:47:29 +0200 Subject: [PATCH 13/13] Update README.md Co-authored-by: Norman Fomferra --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8277c7a..fa23814 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ $ pytest in the `xcube-cmems` repository. Note that, in order to successfully run the tests using the current repository version of `xcube-cmems`, you may also need to -install the repository version of xcube rather than its latest conda-forge +install the repository source version of `xcube` rather than its latest conda-forge release. To create a test coverage report, you can use