diff xarray_select.xml @ 2:123a9a629bef draft

"planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/data_manipulation/xarray/ commit 57b6d23e3734d883e71081c78e77964d61be82ba"
author ecology
date Sun, 06 Jun 2021 08:51:41 +0000
parents 6baac361495b
children bf595d613af4
line wrap: on
line diff
--- a/xarray_select.xml	Sat Oct 31 11:00:25 2020 +0000
+++ b/xarray_select.xml	Sun Jun 06 08:51:41 2021 +0000
@@ -1,14 +1,21 @@
-<tool id="xarray_select" name="NetCDF xarray Selection" version="0.15.1">
+<tool id="xarray_select" name="NetCDF xarray Selection" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@">
     <description>extracts variable values with custom conditions on dimensions</description>
+    <macros>
+        <import>macros.xml</import>
+    </macros>
+    <expand macro="edam_ontology"/>
     <requirements>
         <requirement type="package" version="3">python</requirement>
-        <requirement type="package" version="1.5.3">netcdf4</requirement>
-        <requirement type="package" version="0.15.1">xarray</requirement>
-        <requirement type="package" version="0.7.0">geopandas</requirement>
-        <requirement type="package" version="1.7.0">shapely</requirement>
+        <requirement type="package" version="1.5.6">netcdf4</requirement>
+        <requirement type="package" version="@TOOL_VERSION@">xarray</requirement>
+        <requirement type="package" version="0.9.0">geopandas</requirement>
+        <requirement type="package" version="1.7.1">shapely</requirement>
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
     mkdir output_dir &&
+    #if $condi_source_coord.coord_source=="coord_from_file"
+       echo "Galaxy xarray version @TOOL_VERSION@" > output_dir/version.tabular &&
+    #end if
     python '$__tool_directory__/xarray_tool.py' '$input' --select '$var'
            --verbose
            --filter
@@ -33,6 +40,9 @@
          --coords '$coord_tabular'
          --latname '$condi_source_coord.lat_dim' --lonname '$condi_source_coord.lon_dim'
          --outputdir output_dir
+         #if $condi_source_coord.tolerance
+             --tolerance '$condi_source_coord.tolerance'
+         #end if
     #else
          --outfile 'final.tabular'
         #if $condi_source_coord.condi_coord.coord=='single'
@@ -40,6 +50,12 @@
            --latvalN $condi_source_coord.condi_coord.lat_val
            --lonname $condi_source_coord.condi_coord.lon_dim
            --lonvalE $condi_source_coord.condi_coord.lon_val
+	    #if $condi_source_coord.condi_coord.no_missing
+	        --no_missing
+	    #end if
+            #if $condi_source_coord.condi_coord.tolerance
+                --tolerance '$condi_source_coord.condi_coord.tolerance'
+            #end if
         #elif $condi_source_coord.condi_coord.coord=='subregion'
            --latname $condi_source_coord.condi_coord.lat_dim
            --latvalN $condi_source_coord.condi_coord.lat_valN
@@ -79,6 +95,7 @@
                         <column name="value" index="0"/>
                     </options>
                 </param>
+                <param type="float" name="tolerance" optional="true" label="Maximum distance between original and selected value for inexact matches e.g. abs(original, index) is lower or equal to tolerance"/>
             </when>
 
             <when value="coord_from_stdin">
@@ -101,6 +118,8 @@
                             </options>
                         </param>
                         <param name="lon_val" type="float" value="0" label="Longitude"/>
+                        <param name="no_missing" type="boolean" value="false" label="Do not handle null/missing values (only valid for single location and multiple columns)"/>
+                        <param name="tolerance" type="float" optional="true" label="Maximum distance between original and selected value for inexact matches e.g. abs(original, index) is lower or equal to tolerance"/>
                     </when>
                     <when value="subregion">
                         <param name="lat_dim" type="select" label="Name of latitude coordinate" >
@@ -210,13 +229,13 @@
              <param name="var_tab" value="var_tab_dataset-ibi"/>
              <conditional name="condi_source_coord">
                  <param name="coord_source" value="coord_from_stdin"/>
-                  <conditional name="condi_coord">
-                    <param name="coord" value="single"/>
-                    <param name="lat_dim" value="latitude"/>
-                    <param name="lat_val" value="44.0"/>
-                    <param name="lon_dim" value="longitude"/>
-                    <param name="lon_val" value="-2.0"/>
-                  </conditional>
+                 <conditional name="condi_coord">
+                     <param name="coord" value="single"/>
+                     <param name="lat_dim" value="latitude"/>
+                     <param name="lat_val" value="44.0"/>
+                     <param name="lon_dim" value="longitude"/>
+                     <param name="lon_val" value="-2.0"/>
+                 </conditional>
              </conditional>
              <output name="simpleoutput" value="Test1.tabular">
                  <assert_contents>
@@ -232,9 +251,9 @@
 
              <conditional name="condi_source_coord">
                  <param name="coord_source" value="coord_from_stdin"/>
-                  <conditional name="condi_coord">
-                    <param name="coord" value="global"/>
-                  </conditional>
+                 <conditional name="condi_coord">
+                     <param name="coord" value="global"/>
+                 </conditional>
              </conditional>
              <section name="time">
                  <conditional name="condi_datetime">
@@ -249,8 +268,8 @@
              <repeat name="user_choice">
                  <param name="dim" value="nh4"/>
                  <conditional name="condi_between">
-                    <param name="comparator" value="ge"/>
-                    <param name="value" value="50."/>
+                     <param name="comparator" value="ge"/>
+                     <param name="value" value="50."/>
                  </conditional>
              </repeat>
              <output name="simpleoutput" value="Test2.tabular">
@@ -261,10 +280,6 @@
              </output>
         </test>
     </tests>
-    <edam_topics>
-       <edam_topic>topic_0610</edam_topic>
-       <edam_topic>topic_3050</edam_topic>
-    </edam_topics>
     <help><![CDATA[
 **What it does**
 
@@ -284,7 +299,7 @@
 
 Variable tabular file from 'Netcdf Metadate Info'.
 
-Tabular file with coordinates and the following structure : 'lat'	'lon'.
+Tabular file with coordinates (only coordinates, no header!) and the following structure : 'lat'	'lon'.
 
 
 **Outputs**
@@ -298,4 +313,5 @@
 
 The xarray select tool can be used after the xarray Info.
     ]]></help>
+    <expand macro="citations"/>
 </tool>