diff muspinsim.xml @ 2:136ed45d1ea9 draft

planemo upload for repository https://github.com/muon-spectroscopy-computational-project/muon-galaxy-tools/main/muspinsim commit 4f06b404d8b7fb83995f3052faa7e2ec7811f507
author muon-spectroscopy-computational-project
date Fri, 03 Feb 2023 15:39:01 +0000
parents b30217097125
children e002cee8f707
line wrap: on
line diff
--- a/muspinsim.xml	Thu Sep 15 10:23:28 2022 +0000
+++ b/muspinsim.xml	Fri Feb 03 15:39:01 2023 +0000
@@ -1,28 +1,29 @@
-<tool id="muspinsim" name="MuSpinSim Simulate" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.01">
+<tool id="muspinsim" name="MuSpinSim Simulate" version="@TOOL_VERSION@+galaxy@WRAPPER_VERSION@" python_template_version="3.5" profile="22.05" license="MIT">
     <description>perform spin dynamics calculations for muon science experiments</description>
     <macros>
         <!-- version of underlying tool (PEP 440) -->
-        <token name="@TOOL_VERSION@">1.1.0</token>
+        <token name="@TOOL_VERSION@">2.0.2</token>
         <!-- version of this tool wrapper (integer) -->
-        <token name="@WRAPPER_VERSION@">1</token>
+        <token name="@WRAPPER_VERSION@">0</token>
         <!-- citation should be updated with every underlying tool version -->
         <!-- typical fields to update are version, month, year, and doi -->
         <token name="@TOOL_CITATION@">
             @software{muspinsim,
-                author = {Sturniolo, Simone and Liborio, Leandro and Owen, Josh and Mudaraddi, Anish and {Muon Spectroscopy Computational Project}},
+                author = {Sturniolo, Simone and Liborio, Leandro and Owen, Josh and Mudaraddi, Anish and Davies, Joel and Wilkinson, John and {Muon Spectroscopy Computational Project}},
                 license = {MIT},
                 title = {{muspinsim}},
                 url = {https://github.com/muon-spectroscopy-computational-project/muspinsim},
-                version = {v1.1.0},
-                month = {5},
-                year = {2022},
-                doi = {10.5281/zenodo.6563074}
+                version = {v2.0.2},
+                month = {1},
+                year = {2023}
+                doi = {10.5281/zenodo.7568830}
             }
         </token>
     </macros>
     <creator>
         <person givenName="Anish" familyName="Mudaraddi" identifier="https://orcid.org/0000-0002-2135-2705"/>
         <person givenName="Eli" familyName="Chadwick" url="https://github.com/elichad" identifier="https://orcid.org/0000-0002-0035-6475"/>
+        <person givenName="Joel" familyName="Davies" url="https://github.com/joelvdavies" identifier="https://orcid.org/0000-0002-4153-6819"/>
         <organization url="https://muon-spectroscopy-computational-project.github.io/index.html" name="The Muon Spectroscopy Computational Project"/>
     </creator>
     <requirements>
@@ -30,29 +31,31 @@
     </requirements>
     <command detect_errors="exit_code"><![CDATA[
         ## remove spaces in names
-        mu_sim_name=\$(sed 's/ //g' <<< "$mu_sim.name") &&
+        mu_sim_name=\$(sed 's/ //g' <<< '$mu_sim.name') &&
+        ## input file name without extension
+        mu_in_name=\${mu_sim_name%.*} &&
         ## create links
-        ln -s $mu_sim \$mu_sim_name &&
+        ln -s '$mu_sim' \$mu_sim_name &&
         ## grab 'name' field from input file, if it doesn't exist, set name as 'muspinsim'
         mu_out=\$(grep -A1 '^name' \$mu_sim_name | grep -v 'name' | sed -e 's/^[ \t]*//') &&
-        fitreport_out=\${mu_out:-"fitting_data"}_fitreport.txt &&
+        fit_report_out=\${mu_in_name:-"fitting_data"}_fit_report.txt &&
         mu_out=\${mu_out:-"muspinsim"} &&
         log_out=\$(echo \$mu_sim_name | cut -d '.' -f1).log &&
         ## if fitting data required, check if fitting data exists
         ## create symlink and change filepath in input file to point to symlink
-        if grep '^fitting_data' $mu_sim; then
+        if grep '^fitting_data' '$mu_sim'; then
             if [[ '$mu_exp_in.name' != 'None' ]]; then
-                mu_exp_in_name=\$(sed 's/ //g' <<< "$mu_exp_in.name") &&
-                ln -s $mu_exp_in \$mu_exp_in_name &&
+                mu_exp_in_name=\$(sed 's/ //g' <<< '$mu_exp_in.name') &&
+                ln -s '$mu_exp_in' \$mu_exp_in_name &&
                 sed -iE "/^fitting_data/{n;s/([^)]*)/(\"\$mu_exp_in_name\")/g}" \$mu_sim_name;
             else
-                echo "fitting data required, but no experiment data given" && exit 64;
+                echo "Fitting data required, but no experiment data given" && exit 64;
             fi;
         fi &&
         muspinsim \$mu_sim_name &&
         mkdir data &&
         mv \$mu_out*.dat data &&
-        if test -f \$fitreport_out; then mv -f \$fitreport_out fit_report.txt; fi &&
+        if test -f \$fit_report_out; then mv -f \$fit_report_out fit_report.txt; fi &&
         mv \$log_out log_out.log
     ]]></command>
     <inputs>
@@ -74,7 +77,7 @@
         <test expect_num_outputs="2">
             <param name="mu_sim" value="hfine.in" ftype="txt"/>
             <output_collection name="muspinsim_results" type="list">
-                <element name="hfine.dat" file="hfine.dat" ftype="txt" lines_diff="4"/>
+                <element name="hfine.dat" file="hfine.dat" ftype="txt" compare="re_match"/>
             </output_collection>
             <output name="log_out" file="hfine.log" ftype="txt" compare="re_match"/>
         </test>
@@ -89,10 +92,17 @@
             </output_collection>
             <output name="log_out" file="hfine_powder.log" ftype="txt" compare="re_match">
                 <assert_contents>
-                    <has_size value="802"/>
+                    <has_size value="803" delta="2"/>
                 </assert_contents>
             </output>
         </test>
+        <test expect_num_outputs="2">
+            <param name="mu_sim" value="celio.in" ftype="txt"/>
+            <output_collection name="muspinsim_results" type="list">
+                <element name="celio.dat" file="generic_out.dat" ftype="txt" compare="re_match_multiline"/>
+            </output_collection>
+            <output name="log_out" file="celio.log" ftype="txt" compare="re_match"/>
+        </test>
         <test expect_num_outputs="3">
             <param name="mu_sim" value="fitting.in" ftype="txt"/>
             <param name="mu_exp_in" value="fitting_input.dat" ftype="txt"/>
@@ -104,7 +114,7 @@
                     <has_size value="17145"/>
                 </assert_contents>
             </output>
-            <output name="fit_report" file="fitting_fitreport.txt" ftype="txt" lines_diff="4"/>
+            <output name="fit_report" file="fitting_fit_report.txt" ftype="txt" lines_diff="2"/>
         </test>
         <test expect_num_outputs="2">
             <param name="mu_sim" value="multi_out.in" ftype="txt"/>