Skip to content

Commit a34ddac

Browse files
PaulineSGNRZ9082Marie59
authored
Copernicus Marine Data Store tool: Update credential system and copernicusmarine package. (#220)
* Update Copernicus Marine tool version and credentials Updated tool profile version and modified credentials handling. * Remove deprecated '--force-download' command option Deprecate the '--force-download' option in command. * match with flake8 linting * Modify comment on '--force-download' option Updated comment regarding the '--force-download' option. * Update tools/ocean/copernicusmarine.xml Co-authored-by: Rand Zoabi <58028465+RZ9082@users.noreply.github.com> * Update tools/ocean/copernicusmarine.xml Co-authored-by: Rand Zoabi <58028465+RZ9082@users.noreply.github.com> * Update tools/ocean/copernicusmarine.xml Co-authored-by: Rand Zoabi <58028465+RZ9082@users.noreply.github.com> * Update tools/ocean/copernicusmarine.xml Co-authored-by: Rand Zoabi <58028465+RZ9082@users.noreply.github.com> * Update tools/ocean/copernicusmarine.xml Co-authored-by: Rand Zoabi <58028465+RZ9082@users.noreply.github.com> * Fix indentation for assert_stderr in XML test * Remove unnecessary assertion from Copernicus Marine test Removed assertion for '_NCProperties' from test. * Update divandfull.xml * Update macro.xml * Update and rename macro.xml to macros.xml * revert * Update argo_getdata.xml --------- Co-authored-by: Rand Zoabi <58028465+RZ9082@users.noreply.github.com> Co-authored-by: Marie Jossé <84919248+Marie59@users.noreply.github.com>
1 parent 5953c9e commit a34ddac

4 files changed

Lines changed: 17 additions & 27 deletions

File tree

tools/ocean/argo_getdata.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<tool id="argo_getdata" name="Argo data access" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.05">
22
<description>for global ocean in situ observing system</description>
33
<macros>
4-
<import>macro.xml</import>
4+
<import>macros.xml</import>
55
</macros>
66
<expand macro="argo_requirements">
77
</expand>

tools/ocean/check.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ def main():
7777
sys.exit(1)
7878

7979
# Append '--force-download' option to the command
80-
if "--force-download" not in command:
81-
command += " --force-download"
80+
# -> depreciated with copernicusmarine V2.0.0
81+
# if "--force-download" not in command:
82+
# command += " --force-download"
8283

8384
# Execute the command
8485
try:

tools/ocean/copernicusmarine.xml

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,22 @@
1-
<tool id="copernicusmarine" name="Copernicus Marine Data Store" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="22.01" license="MIT">
1+
<tool id="copernicusmarine" name="Copernicus Marine Data Store" version="@TOOL_VERSION@+galaxy@VERSION_SUFFIX@" profile="25.1" license="MIT">
22
<description>retrieve marine data</description>
33
<macros>
4-
<token name="@TOOL_VERSION@">1.3.3</token>
5-
<token name="@VERSION_SUFFIX@">2</token>
4+
<token name="@TOOL_VERSION@">2.3.0</token>
5+
<token name="@VERSION_SUFFIX@">0</token>
66
</macros>
77
<requirements>
88
<requirement type="package" version="@TOOL_VERSION@">copernicusmarine</requirement>
9+
<credentials name="cmems_credentials" version="1.0" label="CMEMS Credentials" description="Credentials for accessing Copernicus Marine Service API.">
10+
<variable name="username" inject_as_env="COPERNICUSMARINE_SERVICE_USERNAME" optional="false" label="CMEMS Username" description="Your Copernicus Marine Service Username. Get it from your Copernicus account."/>
11+
<secret name="password" inject_as_env="COPERNICUSMARINE_SERVICE_PASSWORD" optional="false" label="CMEMS password" description="Your Copernicus Marine Service password."/>
12+
</credentials>
913
</requirements>
10-
<command detect_errors="exit_code"><![CDATA[
11-
bash '$cmems_credentials' &&
14+
<command detect_errors="exit_code"><![CDATA[
1215
1316
echo -e '$input_text' > config_file_with_my_command &&
1417
python '$__tool_directory__/check.py' 'config_file_with_my_command'
18+
1519
]]></command>
16-
<configfiles>
17-
<configfile name="cmems_credentials">
18-
#import os
19-
#set $cmems_username = $__user__.extra_preferences.get('cmems_username', "")
20-
#set $cmems_password = $__user__.extra_preferences.get('cmems_password', "")
21-
#if $cmems_username == "" or $cmems_password == ""
22-
#set $cmems_username = os.getenv('CMEMS_USERNAME', '')
23-
#set $cmems_password = os.getenv('CMEMS_PASSWORD', '')
24-
#end if
25-
export cmems_username='$cmems_username'
26-
export cmems_password='$cmems_password'
27-
</configfile>
28-
</configfiles>
2920
<inputs>
3021
<param name="input_text" label="Paste API Request" type="text" area="true">
3122
<sanitizer invalid_char="">
@@ -45,13 +36,11 @@ export cmems_password='$cmems_password'
4536
<data name="output_netcdf" label="Copernicus marine data" from_work_dir="./*.nc" format="netcdf"/>
4637
</outputs>
4738
<tests>
48-
<test expect_num_outputs="1">
39+
<test expect_failure="true">
4940
<param name="input_text" value="copernicusmarine subset --dataset-id cmems_mod_med_phy_my_4.2km-climatology_P1M-m --variable bottomT_avg --variable bottomT_std --variable mlotst_avg --variable mlotst_std --variable so_avg --variable so_std --variable thetao_avg --variable thetao_std --variable uo_avg --variable uo_std --variable vo_avg --variable vo_std --variable zos_avg --variable zos_std --start-datetime 1993-12-01T00:00:00 --end-datetime 1993-12-01T00:00:00 --minimum-longitude 10.283266521135577 --maximum-longitude 12.139348881644054 --minimum-latitude 38.461936025366256 --maximum-latitude 39.82957565942514 --minimum-depth 1.0182366371154785 --maximum-depth 1.0182366371154785"/>
50-
<output name="output_netcdf">
51-
<assert_contents>
52-
<has_text text="_NCProperties"/>
53-
</assert_contents>
54-
</output>
41+
<assert_stderr>
42+
<has_text text="Downloading Copernicus Marine data requires a Copernicus Marine username and password"/>
43+
</assert_stderr>
5544
</test>
5645
</tests>
5746
<help><![CDATA[

0 commit comments

Comments
 (0)