lineshape_tools 0.1.0__tar.gz

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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Mark E. Turiansky
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,77 @@
1
+ Metadata-Version: 2.1
2
+ Name: lineshape_tools
3
+ Version: 0.1.0
4
+ Summary: Software to evaluate the optical lineshape function of a defect.
5
+ Keywords: defect,luminescence,absorption,electron-phonon coupling,density functional theory
6
+ Author-Email: "Mark E. Turiansky" <mark.e.turiansky.ctr@us.navy.mil>
7
+ License: MIT
8
+ Classifier: Topic :: Scientific/Engineering
9
+ Classifier: Topic :: Scientific/Engineering :: Physics
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Project-URL: Homepage, https://github.com/mturiansky/lineshape_tools
17
+ Project-URL: Documentation, https://lineshape_tools.readthedocs.io/en/latest
18
+ Project-URL: Repository, https://github.com/mturiansky/lineshape_tools.git
19
+ Project-URL: Issues, https://github.com/mturiansky/lineshape_tools/issues
20
+ Requires-Python: <3.14,>=3.10
21
+ Requires-Dist: mace-torch>=0.3.10
22
+ Requires-Dist: numpy>=1.26.4
23
+ Requires-Dist: numba>=0.61.0
24
+ Requires-Dist: rocket-fft>=0.2.5
25
+ Requires-Dist: cyclopts>=3.16.1
26
+ Requires-Dist: ase>=3.25.0
27
+ Requires-Dist: scipy>=1.15.3
28
+ Requires-Dist: tqdm>=4.67.1
29
+ Provides-Extra: extra
30
+ Requires-Dist: phonopy>=2.42.0; extra == "extra"
31
+ Requires-Dist: matplotlib>=3.10.5; extra == "extra"
32
+ Description-Content-Type: text/markdown
33
+
34
+ # lineshape_tools
35
+ <!-- index start -->
36
+
37
+ `lineshape_tools` is a Python software that implements the formulation for evaluating the effects of electron-phonon coupling on the optical properties of defects.
38
+ In particular, it implements the approach pioneered by [Alkauskas *et al.*](https://doi.org/10.1088/1367-2630/16/7/073026) to compute the lineshape function within Huang-Rhys theory.
39
+ The code interfaces with [`mace`](https://mace-docs.readthedocs.io/en/latest/) and [`phonopy`](https://phonopy.github.io/phonopy/) to evaluate the dynamical matrix and obtain the phonons of a defect-containing supercell.
40
+
41
+ ### Installation
42
+ <!-- install start -->
43
+ To install the latest version of `lineshape_tools`, create a new virtual environment and run
44
+ ```
45
+ pip install lineshape_tools
46
+ ```
47
+ <!-- install end -->
48
+ For more installation information and some performance considerations, see the [Installation page]().
49
+
50
+ ### Usage
51
+ `lineshape_tools` provides a command-line interface for interacting with the code. See
52
+ ```
53
+ lineshape_tools --help
54
+ ```
55
+ Detailed usage information can be found in the [Tutorials page]().
56
+
57
+ ### How to Cite
58
+ <!-- cite start -->
59
+ If you use this code, please consider citing
60
+ ```bibtex
61
+ @misc{turiansky_machine_2025,
62
+ title = {Machine Learning for Fast and Accurate Optical Lineshapes of Defects},
63
+ author = {Turiansky, Mark E. and Lyons, John L., and Bernstein, Noam},
64
+ year = {2025},
65
+ number = {arXiv:XXXX.XXXXX},
66
+ eprint = {XXXX.XXXXX},
67
+ primaryclass = {cond-mat},
68
+ publisher = {arXiv},
69
+ doi = {},
70
+ urldate = {},
71
+ archiveprefix = {arXiv},
72
+ }
73
+ ```
74
+ <!-- cite end -->
75
+ Please also consider citing the foundational works that made this code possible on the [Citation page]().
76
+
77
+ <!-- index end -->
@@ -0,0 +1,44 @@
1
+ # lineshape_tools
2
+ <!-- index start -->
3
+
4
+ `lineshape_tools` is a Python software that implements the formulation for evaluating the effects of electron-phonon coupling on the optical properties of defects.
5
+ In particular, it implements the approach pioneered by [Alkauskas *et al.*](https://doi.org/10.1088/1367-2630/16/7/073026) to compute the lineshape function within Huang-Rhys theory.
6
+ The code interfaces with [`mace`](https://mace-docs.readthedocs.io/en/latest/) and [`phonopy`](https://phonopy.github.io/phonopy/) to evaluate the dynamical matrix and obtain the phonons of a defect-containing supercell.
7
+
8
+ ### Installation
9
+ <!-- install start -->
10
+ To install the latest version of `lineshape_tools`, create a new virtual environment and run
11
+ ```
12
+ pip install lineshape_tools
13
+ ```
14
+ <!-- install end -->
15
+ For more installation information and some performance considerations, see the [Installation page]().
16
+
17
+ ### Usage
18
+ `lineshape_tools` provides a command-line interface for interacting with the code. See
19
+ ```
20
+ lineshape_tools --help
21
+ ```
22
+ Detailed usage information can be found in the [Tutorials page]().
23
+
24
+ ### How to Cite
25
+ <!-- cite start -->
26
+ If you use this code, please consider citing
27
+ ```bibtex
28
+ @misc{turiansky_machine_2025,
29
+ title = {Machine Learning for Fast and Accurate Optical Lineshapes of Defects},
30
+ author = {Turiansky, Mark E. and Lyons, John L., and Bernstein, Noam},
31
+ year = {2025},
32
+ number = {arXiv:XXXX.XXXXX},
33
+ eprint = {XXXX.XXXXX},
34
+ primaryclass = {cond-mat},
35
+ publisher = {arXiv},
36
+ doi = {},
37
+ urldate = {},
38
+ archiveprefix = {arXiv},
39
+ }
40
+ ```
41
+ <!-- cite end -->
42
+ Please also consider citing the foundational works that made this code possible on the [Citation page]().
43
+
44
+ <!-- index end -->
@@ -0,0 +1,132 @@
1
+ [project]
2
+ name = "lineshape_tools"
3
+ description = "Software to evaluate the optical lineshape function of a defect."
4
+ authors = [
5
+ { name = "Mark E. Turiansky", email = "mark.e.turiansky.ctr@us.navy.mil" },
6
+ ]
7
+ dependencies = [
8
+ "mace-torch>=0.3.10",
9
+ "numpy>=1.26.4",
10
+ "numba>=0.61.0",
11
+ "rocket-fft>=0.2.5",
12
+ "cyclopts>=3.16.1",
13
+ "ase>=3.25.0",
14
+ "scipy>=1.15.3",
15
+ "tqdm>=4.67.1",
16
+ ]
17
+ requires-python = ">=3.10,<3.14"
18
+ readme = "README.md"
19
+ dynamic = []
20
+ keywords = [
21
+ "defect",
22
+ "luminescence",
23
+ "absorption",
24
+ "electron-phonon coupling",
25
+ "density functional theory",
26
+ ]
27
+ classifiers = [
28
+ "Topic :: Scientific/Engineering",
29
+ "Topic :: Scientific/Engineering :: Physics",
30
+ "License :: OSI Approved :: MIT License",
31
+ "Programming Language :: Python :: 3",
32
+ "Programming Language :: Python :: 3.10",
33
+ "Programming Language :: Python :: 3.11",
34
+ "Programming Language :: Python :: 3.12",
35
+ "Programming Language :: Python :: 3.13",
36
+ ]
37
+ version = "0.1.0"
38
+
39
+ [project.license]
40
+ text = "MIT"
41
+
42
+ [project.urls]
43
+ Homepage = "https://github.com/mturiansky/lineshape_tools"
44
+ Documentation = "https://lineshape_tools.readthedocs.io/en/latest"
45
+ Repository = "https://github.com/mturiansky/lineshape_tools.git"
46
+ Issues = "https://github.com/mturiansky/lineshape_tools/issues"
47
+
48
+ [project.scripts]
49
+ lineshape_tools = "lineshape_tools.__main__:app.meta"
50
+
51
+ [project.optional-dependencies]
52
+ extra = [
53
+ "phonopy>=2.42.0",
54
+ "matplotlib>=3.10.5",
55
+ ]
56
+
57
+ [build-system]
58
+ requires = [
59
+ "pdm-backend",
60
+ ]
61
+ build-backend = "pdm.backend"
62
+
63
+ [dependency-groups]
64
+ dev = [
65
+ "pytest>=8.3.4",
66
+ "mypy>=1.15.0",
67
+ "ruff>=0.9.4",
68
+ "pytest-cov>=6.2.1",
69
+ "pytest-mock>=3.14.1",
70
+ "pytest-skip-slow>=0.0.5",
71
+ ]
72
+ docs = [
73
+ "sphinx>=8.1.3",
74
+ "furo>=2024.8.6",
75
+ "sphinx-autoapi>=3.6.0",
76
+ "myst-parser>=4.0.1",
77
+ "sphinx-copybutton>=0.5.2",
78
+ ]
79
+
80
+ [tool.ruff]
81
+ line-length = 99
82
+
83
+ [tool.ruff.lint]
84
+ select = [
85
+ "A",
86
+ "B",
87
+ "D",
88
+ "E",
89
+ "F",
90
+ "I",
91
+ "NPY",
92
+ "PL",
93
+ "UP",
94
+ "W",
95
+ ]
96
+ ignore = [
97
+ "PLR",
98
+ "D100",
99
+ "D101",
100
+ "D104",
101
+ "E731",
102
+ "NPY201",
103
+ "PLC0415",
104
+ ]
105
+
106
+ [tool.ruff.lint.per-file-ignores]
107
+ "tests/**.py" = [
108
+ "D102",
109
+ "D103",
110
+ "D107",
111
+ ]
112
+
113
+ [tool.ruff.lint.pydocstyle]
114
+ convention = "google"
115
+
116
+ [tool.mypy]
117
+ ignore_missing_imports = true
118
+
119
+ [tool.pdm]
120
+ distribution = true
121
+
122
+ [tool.pdm.version]
123
+ source = "file"
124
+ path = "src/lineshape_tools/__init__.py"
125
+
126
+ [tool.pytest.ini_options]
127
+ addopts = [
128
+ "--import-mode=importlib",
129
+ ]
130
+ testpaths = [
131
+ "tests",
132
+ ]
@@ -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()