Mercurial > repos > muon-spectroscopy-computational-project > larch_athena
diff common.py @ 6:30cdfd70f28d draft
planemo upload for repository https://github.com/MaterialsGalaxy/larch-tools/tree/main/larch_athena commit 71cee2ed96b69a2e78a1eb3dadbd2e81bf332798
author | muon-spectroscopy-computational-project |
---|---|
date | Mon, 17 Jun 2024 13:54:39 +0000 |
parents | a0d3b0fe0fa3 |
children | 351f2cce19d1 |
line wrap: on
line diff
--- a/common.py Mon May 20 15:34:58 2024 +0000 +++ b/common.py Mon Jun 17 13:54:39 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]