lineshape_tools 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lineshape_tools/__init__.py +7 -0
- lineshape_tools/__main__.py +50 -0
- lineshape_tools/cli.py +965 -0
- lineshape_tools/constants.py +4 -0
- lineshape_tools/lineshape.py +279 -0
- lineshape_tools/phonon.py +77 -0
- lineshape_tools/plot.py +294 -0
- lineshape_tools-0.1.0.dist-info/METADATA +77 -0
- lineshape_tools-0.1.0.dist-info/RECORD +12 -0
- lineshape_tools-0.1.0.dist-info/WHEEL +4 -0
- lineshape_tools-0.1.0.dist-info/entry_points.txt +5 -0
- lineshape_tools-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from typing import Annotated
|
|
3
|
+
|
|
4
|
+
import cyclopts
|
|
5
|
+
from cyclopts import Group, Parameter
|
|
6
|
+
|
|
7
|
+
from lineshape_tools.cli import (
|
|
8
|
+
analyze_dynmat,
|
|
9
|
+
collect,
|
|
10
|
+
compute_dynmat,
|
|
11
|
+
compute_lineshape,
|
|
12
|
+
convert_from_phonopy,
|
|
13
|
+
gen_confs,
|
|
14
|
+
gen_ft_config,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
app = cyclopts.App(help_format="md")
|
|
18
|
+
app.meta.group_parameters = Group("Commands")
|
|
19
|
+
|
|
20
|
+
for func in (
|
|
21
|
+
analyze_dynmat,
|
|
22
|
+
collect,
|
|
23
|
+
compute_dynmat,
|
|
24
|
+
compute_lineshape,
|
|
25
|
+
convert_from_phonopy,
|
|
26
|
+
gen_confs,
|
|
27
|
+
gen_ft_config,
|
|
28
|
+
):
|
|
29
|
+
app.command()(func)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@app.meta.default
|
|
33
|
+
def _app_launcher(
|
|
34
|
+
*tokens: Annotated[str, Parameter(show=False, allow_leading_hyphen=True)],
|
|
35
|
+
verbose: Annotated[bool, Parameter(negative="--quiet")] = False,
|
|
36
|
+
) -> None:
|
|
37
|
+
fmt = "%(asctime)s %(levelname)s %(name)s: %(message)s" if verbose else "[*] %(message)s"
|
|
38
|
+
log_level = logging.DEBUG if verbose else logging.INFO
|
|
39
|
+
|
|
40
|
+
logging.basicConfig(level=log_level, format=fmt, encoding="utf-8")
|
|
41
|
+
|
|
42
|
+
# remove logging from imported libraries, wow this is a monster of a line
|
|
43
|
+
logging.getLogger().handlers[0].addFilter(logging.Filter(name=__name__.split(".")[0]))
|
|
44
|
+
|
|
45
|
+
logging.getLogger(__name__).debug("starting application")
|
|
46
|
+
app(tokens)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
if __name__ == "__main__":
|
|
50
|
+
app.meta()
|