lineshape_tools 0.1.1__tar.gz → 0.1.2__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.
Files changed (30) hide show
  1. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/PKG-INFO +1 -1
  2. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/pyproject.toml +1 -1
  3. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/src/lineshape_tools/__init__.py +1 -1
  4. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/src/lineshape_tools/cli.py +7 -0
  5. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/LICENSE +0 -0
  6. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/README.md +0 -0
  7. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/src/lineshape_tools/__main__.py +0 -0
  8. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/src/lineshape_tools/__pycache__/lineshape._do_compute_phonon_spec_func-128.py311.1.nbc +0 -0
  9. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/src/lineshape_tools/__pycache__/lineshape._do_compute_phonon_spec_func-128.py311.nbi +0 -0
  10. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/src/lineshape_tools/__pycache__/lineshape._do_compute_phonon_spec_func_zeroT-92.py311.1.nbc +0 -0
  11. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/src/lineshape_tools/__pycache__/lineshape._do_compute_phonon_spec_func_zeroT-92.py311.nbi +0 -0
  12. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/src/lineshape_tools/__pycache__/lineshape.gaussian-26.py311.1.nbc +0 -0
  13. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/src/lineshape_tools/__pycache__/lineshape.gaussian-26.py311.nbi +0 -0
  14. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/src/lineshape_tools/__pycache__/lineshape.lorentzian-32.py311.1.nbc +0 -0
  15. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/src/lineshape_tools/__pycache__/lineshape.lorentzian-32.py311.nbi +0 -0
  16. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/src/lineshape_tools/constants.py +0 -0
  17. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/src/lineshape_tools/lineshape.py +0 -0
  18. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/src/lineshape_tools/phonon.py +0 -0
  19. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/src/lineshape_tools/plot.py +0 -0
  20. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/tests/__init__.py +0 -0
  21. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/tests/conftest.py +0 -0
  22. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/tests/files/C_N-GaN.exc.extxyz.gz +0 -0
  23. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/tests/files/C_N-GaN.gnd.extxyz.gz +0 -0
  24. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/tests/files/FORCE_CONSTANTS +0 -0
  25. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/tests/files/NV-diamond.exc.extxyz.gz +0 -0
  26. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/tests/files/NV-diamond.gnd.extxyz.gz +0 -0
  27. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/tests/files/dimer-hBN.exc.extxyz.gz +0 -0
  28. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/tests/files/dimer-hBN.gnd.extxyz.gz +0 -0
  29. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/tests/test_main.py +0 -0
  30. {lineshape_tools-0.1.1 → lineshape_tools-0.1.2}/tests/test_plot.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lineshape_tools
3
- Version: 0.1.1
3
+ Version: 0.1.2
4
4
  Summary: Software to evaluate the optical lineshape function of a defect.
5
5
  Keywords: defect,luminescence,absorption,electron-phonon coupling,density functional theory
6
6
  Author-Email: "Mark E. Turiansky" <mark.e.turiansky.ctr@us.navy.mil>
@@ -34,7 +34,7 @@ classifiers = [
34
34
  "Programming Language :: Python :: 3.12",
35
35
  "Programming Language :: Python :: 3.13",
36
36
  ]
37
- version = "0.1.1"
37
+ version = "0.1.2"
38
38
 
39
39
  [project.license]
40
40
  text = "MIT"
@@ -2,6 +2,6 @@
2
2
 
3
3
  __author__ = "Mark E. Turiansky"
4
4
  __email__ = "mark.e.turiansky.ctr@us.navy.mil"
5
- __version__ = "0.1.1"
5
+ __version__ = "0.1.2"
6
6
  __copyright__ = "Copyright (c) 2025 Mark E. Turiansky"
7
7
  __license__ = "MIT"
@@ -37,6 +37,7 @@ def collect(
37
37
  rtol: float = 1e-5,
38
38
  config_weight: float = 1.0,
39
39
  force_weighting: bool = False,
40
+ allow_constraint: bool = False,
40
41
  ) -> None:
41
42
  """Collect and process data for fine-tuning.
42
43
 
@@ -66,6 +67,8 @@ def collect(
66
67
  force_weighting (bool): store a config_weight that's inversely proportional to the max
67
68
  force that any atom feels in the configuration [min(0.02 / max_fpa, 1)]. Overwrites
68
69
  the value specified by config_weight.
70
+ allow_constraint (bool): allow constraints on atoms (e.g. selective dynamics) to modify the
71
+ forces. This is typically not desirable.
69
72
  """
70
73
  if strategy.lower() not in ("none", "qr", "dx"):
71
74
  raise ValueError("invalid strategy choice")
@@ -79,6 +82,10 @@ def collect(
79
82
  read_atoms = ase.io.read(fname, read_index)
80
83
  total_read += len(read_atoms)
81
84
  for atoms in tqdm(read_atoms, desc="[*] processing atoms", disable=len(read_atoms) < 10):
85
+ if len(atoms.constraints) > 0 and not allow_constraint:
86
+ logger.debug("atoms are constrained, removing prior to extracting forces")
87
+ atoms.set_constraint(None)
88
+
82
89
  forces = atoms.get_forces()
83
90
  if min_force < np.linalg.norm(forces, axis=1).max() < max_force:
84
91
  atoms.info["REF_energy"] = atoms.get_potential_energy()
File without changes