# HG changeset patch # User muon-spectroscopy-computational-project # Date 1718632470 0 # Node ID 39ab361e6d59b33fb6ce35aec083d739ab8c8470 # Parent 2ceaa943a2ad49b2780a468d2a76b8df316f50f3 planemo upload for repository https://github.com/MaterialsGalaxy/larch-tools/tree/main/larch_artemis commit 71cee2ed96b69a2e78a1eb3dadbd2e81bf332798 diff -r 2ceaa943a2ad -r 39ab361e6d59 common.py --- a/common.py Thu Apr 11 09:01:48 2024 +0000 +++ b/common.py Mon Jun 17 13:54:30 2024 +0000 @@ -1,3 +1,4 @@ +import re from typing import Iterable from larch.io import extract_athenagroup, read_athena @@ -168,3 +169,7 @@ def read_groups(dat_files: "list[str]", key: str = None) -> Iterable[Group]: for dat_file in dat_files: yield read_group(dat_file=dat_file, key=key) + + +def sorting_key(filename: str) -> str: + return re.findall(r"\d+", filename)[-1] diff -r 2ceaa943a2ad -r 39ab361e6d59 larch_artemis.py --- a/larch_artemis.py Thu Apr 11 09:01:48 2024 +0000 +++ b/larch_artemis.py Mon Jun 17 13:54:30 2024 +0000 @@ -5,7 +5,7 @@ import os import sys -from common import read_group +from common import read_group, sorting_key from larch.fitting import guess, param, param_group from larch.symboltable import Group @@ -351,7 +351,7 @@ filepaths = [ os.path.join(prj_file, p) for p in os.listdir(prj_file) ] - filepaths.sort() + filepaths.sort(key=sorting_key) else: # DO NOT sort if we have multiple Galaxy datasets - the filenames # are arbitrary but should be in order diff -r 2ceaa943a2ad -r 39ab361e6d59 larch_artemis.xml --- a/larch_artemis.xml Thu Apr 11 09:01:48 2024 +0000 +++ b/larch_artemis.xml Mon Jun 17 13:54:30 2024 +0000 @@ -4,7 +4,7 @@ 0.9.75 - 0 + 1 10.1088/1742-6596/430/1/012007 @@ -315,6 +315,26 @@ + + + + + + + + + + + + + + + + + + + +