changeset 2:21e8386cf36f draft default tip

planemo upload for repository https://github.com/NordicESMhub/galaxy-tools/tree/master/tools/c3s commit e8074c9f6817bba5ca6cb322434ca5e4412b34cf
author climate
date Fri, 27 Sep 2024 19:34:36 +0000
parents bd153c794da1
children
files c3s.xml test-data/input.txt
diffstat 2 files changed, 49 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/c3s.xml	Thu Feb 08 17:58:54 2024 +0000
+++ b/c3s.xml	Fri Sep 27 19:34:36 2024 +0000
@@ -1,9 +1,18 @@
-<tool id="c3s" name="Copernicus Climate Data Store" version="0.2.0">
+<tool id="c3s" name="Copernicus Climate Data Store" version="0.3.0" profile="23.0">
     <description>for retrieving climate data</description>
+    <edam_topics>
+        <edam_topic>topic_3855</edam_topic>
+        <edam_topic>topic_3318</edam_topic>
+      </edam_topics>
+      <edam_operations>
+        <edam_operation>operation_2422</edam_operation>
+        <edam_operation>operation_3357</edam_operation>
+        <edam_operation>operation_0335</edam_operation>
+      </edam_operations>
     <requirements>
-        <requirement type="package" version="3">python</requirement>
-        <requirement type="package" version="0.5.1">cdsapi</requirement>
-        <requirement type="package" version="1.9.9">cdo</requirement>
+        <requirement type="package" version="3.8">python</requirement>
+        <requirement type="package" version="0.7.3">cdsapi</requirement>
+        <requirement type="package" version="2.4.4">cdo</requirement>
         <requirement type="package" version="1.34">tar</requirement>
         <requirement type="package" version="6.0">unzip</requirement>
     </requirements>
@@ -11,24 +20,24 @@
        export HOME=`pwd`  &&
        #set $c3s_cds_apikey = $__user__.extra_preferences.get('c3s_account|c3s_cds_apikey', "")
        #if $c3s_cds_apikey == ""
-	    echo "Error. Set your credentials via: User -> Preferences -> Manage Information"  &&
+	    echo "Error. Set your credentials via: User -> Preferences -> Manage Information" &&
        #else
             cp '$cds_key_file' .cdsapirc &&
        #end if
        #if str($is_file.has_req).strip() == 'yes'
             python3 '$__tool_directory__/c3s_retrieve.py' 
-	             --request '$is_file.api_req_file' --output request.txt       &&
+	             --request '$is_file.api_req_file' --output request.txt  &&
        #else
             python3 '$__tool_directory__/c3s_retrieve.py' 
-	             --request $req_from_paste --output request.txt               &&
+	             --request $req_from_paste --output request.txt &&
        #end if
-       bash $__tool_directory__/c3s.sh                                    &&
+       bash $__tool_directory__/c3s.sh &&
        echo "C3S data retrieval is done"
     ]]></command>
     <configfiles>
         <configfile name="cds_key_file"><![CDATA[
 #set $c3s_cds_apikey = $__user__.extra_preferences.get('c3s_account|c3s_cds_apikey', "")
-         url: https://cds.climate.copernicus.eu/api/v2
+         url: https://cds.climate.copernicus.eu/api
          key: $c3s_cds_apikey
         ]]></configfile>
         <configfile name="req_from_paste"><![CDATA[
@@ -52,8 +61,8 @@
         </conditional>
     </inputs>
     <outputs>
-        <data name="request" format="txt" from_work_dir="request.txt"/>
-        <data name="ofilename" format="netcdf" from_work_dir="tmp.nc"/>
+        <data name="request" format="txt" from_work_dir="request.txt" label="${tool.name} on ${on_string}: request script"/>
+        <data name="ofilename" format="netcdf" from_work_dir="tmp.nc" label="${tool.name} on ${on_string}: NC"/>
     </outputs>
     <tests>
         <test>
@@ -61,7 +70,7 @@
             <output name="request" ftype="txt">
               <assert_contents>
                   <has_text text="dataset to retrieve: reanalysis-era5-single-levels-monthly-means" />
-                  <has_text text="'format': 'netcdf'" />
+                  <has_text text="'data_format': 'netcdf'" />
                   <has_text text="'product_type': 'monthly_averaged_reanalysis'" />
                   <has_text text="'variable': '2m_temperature'" />
                   <has_text text="'year': '2020'" />
@@ -81,34 +90,45 @@
     <help><![CDATA[
 
 **Copernicus Climate Data Store (C3S)**
-=======================================================================================================
+=======================================
 
 This tool is a wrapper to retrieve data from the Copernicus Climate Data Store.
 
 - It allows to retrieve data from the Copernicus climate Data Store.
-- Any user willing to use this tool needs to `create a new account <https://cds.climate.copernicus.eu/user/register?destination=%2F%23!%2Fhome>`_.
+- Any user willing to use this tool needs to `create a new account <https://cds.climate.copernicus.eu/>`_.
 - Set your CDS API Key via: User -> Preferences -> Manage Information"
-- Documentation on where to get the CDS API key can be found `here <https://cds.climate.copernicus.eu/api-how-to>`_.
-- Compose your request directly on C3S and copy/paste it in the input field "Request" or save it in a file.
-- Be aware that for being able to download dataset from C3S, users also need to agree to their term of use (Licence to use Copernicus Products) on the C3S website.
+- Documentation on where to get the CDS API key can be found `here <https://cds.climate.copernicus.eu/how-to-api>`_.
+- Compose your request directly on C3S and extract the relevant information, which should be put in the input field "Request" or saved in a file. The format should be, for example::
+
+
+    import cdsapi
+    
+    c = cdsapi.Client()
+    c.retrieve(
+        'reanalysis-era5-single-levels-monthly-means',
+        {
+            'data_format': 'netcdf',
+            'product_type': 'monthly_averaged_reanalysis',
+            'variable': '2m_temperature',
+            'year': '2020',
+            'month': '12',
+            'time': '00:00',
+            'area': [60, 10, 59.5, 10.5],
+        },
+        'download.nc')
+
+
+- Be aware that for being able to download dataset from C3S, users also need to agree to licensing terms for each dataset of interest on the C3S website.
 
 License:
 ~~~~~~~~
 
-Generated using Copernicus Climate Change Service information [2021]
+Generated using Copernicus Climate Change Service information [2024]
 Neither the European Commission nor ECMWF is responsible for any use 
 that may be made of the Copernicus information or data it contains.
     ]]></help>
     <citations>
-
+	<citation type="bibtex">
+	@misc{C3S2024,author={Copernicus Climate Change Service},year={2024}}</citation>
     </citations>
-    <edam_topics>
-      <edam_topic>topic_3855</edam_topic>
-      <edam_topic>topic_3318</edam_topic>
-    </edam_topics>
-    <edam_operations>
-      <edam_operation>operation_2422</edam_operation>
-      <edam_operation>operation_3357</edam_operation>
-      <edam_operation>operation_0335</edam_operation>
-    </edam_operations>
 </tool>
--- a/test-data/input.txt	Thu Feb 08 17:58:54 2024 +0000
+++ b/test-data/input.txt	Fri Sep 27 19:34:36 2024 +0000
@@ -5,7 +5,7 @@
 c.retrieve(
     'reanalysis-era5-single-levels-monthly-means',
     {
-        'format': 'netcdf',
+        'data_format': 'netcdf',
         'product_type': 'monthly_averaged_reanalysis',
         'variable': '2m_temperature',
         'year': '2020',