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.
@@ -0,0 +1,7 @@
1
+ """The lineshape_tools package."""
2
+
3
+ __author__ = "Mark E. Turiansky"
4
+ __email__ = "mark.e.turiansky.ctr@us.navy.mil"
5
+ __version__ = "0.1.0"
6
+ __copyright__ = "Copyright (c) 2025 Mark E. Turiansky"
7
+ __license__ = "MIT"
@@ -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()