changeset 7:351f2cce19d1 draft

planemo upload for repository https://github.com/MaterialsGalaxy/larch-tools/tree/main/larch_athena commit 4814f53888643f1d3667789050914675fffb7d59
author muon-spectroscopy-computational-project
date Fri, 23 Aug 2024 14:10:30 +0000
parents 30cdfd70f28d
children 6e94ae7d1ca1
files common.py larch_athena.xml
diffstat 2 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/common.py	Mon Jun 17 13:54:39 2024 +0000
+++ b/common.py	Fri Aug 23 14:10:30 2024 +0000
@@ -11,8 +11,6 @@
     group_keys = list(athena_group.keys())
     if key is None:
         key = group_keys[0]
-    else:
-        key = key.replace("-", "_")
 
     try:
         return extract_athenagroup(athena_group.groups[key])
@@ -20,7 +18,7 @@
         raise KeyError(f"{key} not in {group_keys}") from e
 
 
-def read_all_groups(dat_file: str, key: str = None) -> "dict[str, Group]":
+def read_all_groups(dat_file: str) -> "dict[str, Group]":
     # Cannot rely on do_ABC as _larch is None
     athena_group = read_athena(
         dat_file,
@@ -40,14 +38,20 @@
 
 
 def read_group(dat_file: str, key: str = None):
+    if key:
+        match_ = key.replace(" ", "_").replace("-", "_").replace(".", "_")
+    else:
+        match_ = None
+
     # Cannot rely on do_ABC as _larch is None
     athena_group = read_athena(
         dat_file,
+        match=match_,
         do_preedge=False,
         do_bkg=False,
         do_fft=False,
     )
-    group = get_group(athena_group, key)
+    group = get_group(athena_group, match_)
     pre_edge_with_defaults(group=group)
     xftf_with_defaults(group=group)
     return group
--- a/larch_athena.xml	Mon Jun 17 13:54:39 2024 +0000
+++ b/larch_athena.xml	Fri Aug 23 14:10:30 2024 +0000
@@ -2,9 +2,9 @@
     <description>generate Athena projects from XAFS data</description>
     <macros>
         <!-- version of underlying tool (PEP 440) -->
-        <token name="@TOOL_VERSION@">0.9.75</token>
+        <token name="@TOOL_VERSION@">0.9.80</token>
         <!-- version of this tool wrapper (integer) -->
-        <token name="@WRAPPER_VERSION@">2</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@">10.1088/1742-6596/430/1/012007</token>
@@ -286,7 +286,7 @@
             </output>
             <output name="plot">
                 <assert_contents>
-                    <has_size value="138100" delta="100"/>
+                    <has_size value="141000" delta="1000"/>
                 </assert_contents>
             </output>
         </test>
@@ -335,7 +335,7 @@
             </output>
             <output name="plot">
                 <assert_contents>
-                    <has_size value="137700" delta="100"/>
+                    <has_size value="138000" delta="1000"/>
                 </assert_contents>
             </output>
         </test>
@@ -396,7 +396,7 @@
             </output>
             <output name="plot">
                 <assert_contents>
-                    <has_size value="145700" delta="100"/>
+                    <has_size value="150000" delta="1000"/>
                 </assert_contents>
             </output>
         </test>