Mercurial > repos > muon-spectroscopy-computational-project > larch_artemis
diff common.py @ 4:39ab361e6d59 draft
planemo upload for repository https://github.com/MaterialsGalaxy/larch-tools/tree/main/larch_artemis commit 71cee2ed96b69a2e78a1eb3dadbd2e81bf332798
author | muon-spectroscopy-computational-project |
---|---|
date | Mon, 17 Jun 2024 13:54:30 +0000 (9 months ago) |
parents | 2ceaa943a2ad |
children | 7acb53ffb96f |
line wrap: on
line diff
--- 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]