Mercurial > repos > muon-spectroscopy-computational-project > larch_artemis
comparison 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 |
| parents | 2ceaa943a2ad |
| children | 7acb53ffb96f |
comparison
equal
deleted
inserted
replaced
| 3:2ceaa943a2ad | 4:39ab361e6d59 |
|---|---|
| 1 import re | |
| 1 from typing import Iterable | 2 from typing import Iterable |
| 2 | 3 |
| 3 from larch.io import extract_athenagroup, read_athena | 4 from larch.io import extract_athenagroup, read_athena |
| 4 from larch.io.athena_project import AthenaGroup | 5 from larch.io.athena_project import AthenaGroup |
| 5 from larch.symboltable import Group | 6 from larch.symboltable import Group |
| 166 | 167 |
| 167 | 168 |
| 168 def read_groups(dat_files: "list[str]", key: str = None) -> Iterable[Group]: | 169 def read_groups(dat_files: "list[str]", key: str = None) -> Iterable[Group]: |
| 169 for dat_file in dat_files: | 170 for dat_file in dat_files: |
| 170 yield read_group(dat_file=dat_file, key=key) | 171 yield read_group(dat_file=dat_file, key=key) |
| 172 | |
| 173 | |
| 174 def sorting_key(filename: str) -> str: | |
| 175 return re.findall(r"\d+", filename)[-1] |
