comparison 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
comparison
equal deleted inserted replaced
5:27015eaf9a78 6:30cdfd70f28d
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]