chemparseplot 1.9.7__tar.gz → 1.9.8__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 (88) hide show
  1. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/PKG-INFO +13 -1
  2. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/_version.py +2 -2
  3. chemparseplot-1.9.8/chemparseplot/api.py +91 -0
  4. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/readme.md +12 -0
  5. chemparseplot-1.9.8/tests/fixtures_geomscan_snippet.txt +9 -0
  6. chemparseplot-1.9.8/tests/test_public_api.py +72 -0
  7. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/.gitignore +0 -0
  8. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/LICENSE +0 -0
  9. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/__init__.py +0 -0
  10. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/__init__.py +0 -0
  11. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/chemgp_hdf5.py +0 -0
  12. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/chemgp_jsonl.py +0 -0
  13. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/converter.py +0 -0
  14. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/eon/__init__.py +0 -0
  15. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/eon/_trajectory_common.py +0 -0
  16. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/eon/con_io.py +0 -0
  17. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/eon/dimer_trajectory.py +0 -0
  18. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/eon/gprd.py +0 -0
  19. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/eon/min_trajectory.py +0 -0
  20. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/eon/minimization.py +0 -0
  21. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/eon/neb.py +0 -0
  22. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/eon/saddle_search.py +0 -0
  23. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/eon/stitch.py +0 -0
  24. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/file_.py +0 -0
  25. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/neb_utils.py +0 -0
  26. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/orca/__init__.py +0 -0
  27. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/orca/geomscan.py +0 -0
  28. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/orca/neb/__init__.py +0 -0
  29. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/orca/neb/interp.py +0 -0
  30. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/orca/neb/opi_parser.py +0 -0
  31. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/patterns.py +0 -0
  32. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/plumed.py +0 -0
  33. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/projection.py +0 -0
  34. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/sella/saddle_search.py +0 -0
  35. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/trajectory/__init__.py +0 -0
  36. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/trajectory/hdf5.py +0 -0
  37. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/trajectory/neb.py +0 -0
  38. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/parse/types.py +0 -0
  39. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/plot/__init__.py +0 -0
  40. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/plot/chemgp.py +0 -0
  41. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/plot/geomscan.py +0 -0
  42. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/plot/neb.py +0 -0
  43. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/plot/optimization.py +0 -0
  44. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/plot/plumed.py +0 -0
  45. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/plot/structs.py +0 -0
  46. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/plot/theme.py +0 -0
  47. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/units.py +0 -0
  48. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/chemparseplot/util.py +0 -0
  49. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/pyproject.toml +0 -0
  50. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/__init__.py +0 -0
  51. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/_optional_imports.py +0 -0
  52. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/conftest.py +0 -0
  53. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/__init__.py +0 -0
  54. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/_con_fixtures.py +0 -0
  55. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/orca/test_geomscan.py +0 -0
  56. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/orca/test_interp.py +0 -0
  57. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_chemgp_hdf5.py +0 -0
  58. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_chemgp_jsonl_types.py +0 -0
  59. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_con_io.py +0 -0
  60. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_converter.py +0 -0
  61. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_dimer_trajectory.py +0 -0
  62. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_eon_neb_types.py +0 -0
  63. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_eon_trajectory_common.py +0 -0
  64. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_min_trajectory.py +0 -0
  65. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_minimization_result.py +0 -0
  66. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_neb_stitch.py +0 -0
  67. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_neb_utils.py +0 -0
  68. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_parser_types.py +0 -0
  69. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_patterns.py +0 -0
  70. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_plumed.py +0 -0
  71. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_projection.py +0 -0
  72. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_readcon_boundary.py +0 -0
  73. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_saddle_results.py +0 -0
  74. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_sella_saddle.py +0 -0
  75. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_trajectory_hdf5.py +0 -0
  76. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/parse/test_trajectory_neb.py +0 -0
  77. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/plot/__init__.py +0 -0
  78. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/plot/test_chemgp_utils.py +0 -0
  79. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/plot/test_neb_helpers.py +0 -0
  80. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/plot/test_neb_renderers.py +0 -0
  81. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/plot/test_optimization.py +0 -0
  82. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/plot/test_orca_neb_payload.py +0 -0
  83. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/plot/test_projection_refactor.py +0 -0
  84. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/plot/test_strip_rendering.py +0 -0
  85. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/plot/test_structs_units.py +0 -0
  86. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/test_coverage_batch.py +0 -0
  87. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/test_full_coverage.py +0 -0
  88. {chemparseplot-1.9.7 → chemparseplot-1.9.8}/tests/tutorials/test_chemparseplot.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chemparseplot
3
- Version: 1.9.7
3
+ Version: 1.9.8
4
4
  Summary: Parsers and plotting tools for computational chemistry
5
5
  Project-URL: Documentation, https://chemparseplot.rgoswami.me
6
6
  Project-URL: Issues, https://github.com/HaoZeke/chemparseplot/issues
@@ -115,6 +115,18 @@ publication-quality plots.
115
115
  ## Installation
116
116
 
117
117
  pip install chemparseplot
118
+
119
+ Suite config (shared with rgpycrumbs — **no** `~/.config/chemparseplot`):
120
+
121
+ # ~/.config/rgpkgs/config.toml or ./rgpkgs.toml
122
+ # [pins] lock = "uv.lock"
123
+ # [pins.packages] …
124
+
125
+ Feature extras (`plot`, `neb`, …) are *transitional* install convenience. Target
126
+ is the same on-demand uv / `ensure_import` design as the rgpycrumbs hub; prefer
127
+ bare install + suite pins for new work.
128
+
129
+ # transitional:
118
130
  # With plotting support
119
131
  pip install "chemparseplot[plot]"
120
132
  # Everything
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
18
18
  commit_id: str | None
19
19
  __commit_id__: str | None
20
20
 
21
- __version__ = version = '1.9.7'
22
- __version_tuple__ = version_tuple = (1, 9, 7)
21
+ __version__ = version = '1.9.8'
22
+ __version_tuple__ = version_tuple = (1, 9, 8)
23
23
 
24
24
  __commit_id__ = commit_id = None
@@ -0,0 +1,91 @@
1
+ # SPDX-FileCopyrightText: 2023-present Rohit Goswami <rog32@hi.is>
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ """Stable public library entry points for chemparseplot.
5
+
6
+ Prefer this module for new consumers (cookbooks, wailord, notebooks).
7
+
8
+ **Representative in-process path (parse → typed result):**
9
+
10
+ .. code-block:: python
11
+
12
+ from chemparseplot.api import extract_orca_geomscan_energy
13
+
14
+ dist_bohr, energy_Eh = extract_orca_geomscan_energy(orca_out_text, "Actual Energy")
15
+ # dist_bohr, energy_Eh are pint Quantities (bohr, hartree)
16
+
17
+ Heavy plot stacks still live under ``chemparseplot.plot`` (optional deps /
18
+ transitional extras until suite uv design fully covers them).
19
+
20
+ Suite pins/config: use ``rgpycrumbs.api`` (shared rgpkgs TOML) — this package
21
+ does **not** invent ``~/.config/chemparseplot``.
22
+
23
+ .. versionadded:: 1.9.8
24
+ .. versionchanged:: 1.9.9
25
+ Expose ORCA geomscan energy parse as the stable library path.
26
+ """
27
+
28
+ from __future__ import annotations
29
+
30
+ from typing import TYPE_CHECKING
31
+
32
+ from chemparseplot.parse.orca.geomscan import extract_energy_data
33
+ from chemparseplot.units import (
34
+ ENERGY_UNITS,
35
+ convert_energy_magnitude,
36
+ energy_quantity,
37
+ normalize_energy_unit,
38
+ )
39
+
40
+ if TYPE_CHECKING:
41
+ from chemparseplot.units import Q_
42
+
43
+ __all__ = [
44
+ "ENERGY_UNITS",
45
+ "convert_energy_magnitude",
46
+ "energy_quantity",
47
+ "extract_orca_geomscan_energy",
48
+ "normalize_energy_unit",
49
+ "suite_pins",
50
+ ]
51
+
52
+
53
+ def extract_orca_geomscan_energy(
54
+ data: str, energy_type: str = "Actual Energy"
55
+ ) -> tuple[Q_, Q_]:
56
+ """Parse ORCA geometry-scan surface energies from output text.
57
+
58
+ In-process library path: text → typed ``(distance, energy)`` pint Quantities
59
+ in Bohr and Hartree (ORCA defaults).
60
+
61
+ Parameters
62
+ ----------
63
+ data:
64
+ Blob of ORCA output containing ``Calculated Surface`` blocks.
65
+ energy_type:
66
+ ``\"Actual Energy\"`` or ``\"SCF energy\"`` (substring match in the block).
67
+
68
+ Returns
69
+ -------
70
+ tuple[Q_, Q_]
71
+ Distances (bohr) and energies (hartree). Empty quantities if no match.
72
+ """
73
+ return extract_energy_data(data, energy_type)
74
+
75
+
76
+ def suite_pins() -> dict[str, str]:
77
+ """Return suite package pins from rgpkgs config + env (soft on old hub).
78
+
79
+ Empty dict if rgpycrumbs is missing or too old.
80
+ """
81
+ try:
82
+ from rgpycrumbs.api import load_config, pins_from_env
83
+ except ImportError:
84
+ return {}
85
+ pins = dict(pins_from_env())
86
+ try:
87
+ cfg = load_config()
88
+ pins.update(cfg.merged_package_pins_normalized())
89
+ except Exception: # noqa: BLE001 — soft fail for consumers
90
+ pass
91
+ return pins
@@ -45,6 +45,18 @@ publication-quality plots.
45
45
  ## Installation
46
46
 
47
47
  pip install chemparseplot
48
+
49
+ Suite config (shared with rgpycrumbs — **no** `~/.config/chemparseplot`):
50
+
51
+ # ~/.config/rgpkgs/config.toml or ./rgpkgs.toml
52
+ # [pins] lock = "uv.lock"
53
+ # [pins.packages] …
54
+
55
+ Feature extras (`plot`, `neb`, …) are *transitional* install convenience. Target
56
+ is the same on-demand uv / `ensure_import` design as the rgpycrumbs hub; prefer
57
+ bare install + suite pins for new work.
58
+
59
+ # transitional:
48
60
  # With plotting support
49
61
  pip install "chemparseplot[plot]"
50
62
  # Everything
@@ -0,0 +1,9 @@
1
+ The Calculated Surface using the 'Actual Energy'
2
+ 7.55890395 -0.74239862
3
+ 7.32930292 -0.74349939
4
+ 7.09970189 -0.74467446
5
+
6
+ The Calculated Surface using the SCF energy
7
+ 7.55890395 -0.74239862
8
+ 7.32930292 -0.74349939
9
+ 7.09970189 -0.74467446
@@ -0,0 +1,72 @@
1
+ # SPDX-FileCopyrightText: 2023-present Rohit Goswami <rog32@hi.is>
2
+ #
3
+ # SPDX-License-Identifier: MIT
4
+ """Drive shipped chemparseplot.api entry points (parse → typed result)."""
5
+
6
+ from __future__ import annotations
7
+
8
+ from pathlib import Path
9
+
10
+ import numpy as np
11
+ import pytest
12
+
13
+ from chemparseplot.api import (
14
+ convert_energy_magnitude,
15
+ extract_orca_geomscan_energy,
16
+ normalize_energy_unit,
17
+ suite_pins,
18
+ )
19
+
20
+ # Inline fixture (same content as tests/fixtures_geomscan_snippet.txt)
21
+ _GEOMSCAN_SNIPPET = """
22
+ The Calculated Surface using the 'Actual Energy'
23
+ 7.55890395 -0.74239862
24
+ 7.32930292 -0.74349939
25
+ 7.09970189 -0.74467446
26
+
27
+ The Calculated Surface using the SCF energy
28
+ 7.55890395 -0.74239862
29
+ 7.32930292 -0.74349939
30
+ 7.09970189 -0.74467446
31
+ """
32
+
33
+ FIXTURE_FILE = Path(__file__).parent / "fixtures_geomscan_snippet.txt"
34
+
35
+
36
+ def test_normalize_and_convert_energy_library_path():
37
+ assert normalize_energy_unit("ev") == "eV"
38
+ kcal = convert_energy_magnitude(1.0, "kcal/mol")
39
+ val = float(np.asarray(kcal).reshape(-1)[0])
40
+ assert 20.0 < val < 25.0
41
+ back = float(np.asarray(convert_energy_magnitude(val, "eV", source_unit="kcal/mol")))
42
+ assert abs(back - 1.0) < 1e-6
43
+
44
+
45
+ def test_extract_orca_geomscan_energy_typed_nonempty():
46
+ """Public parse path: ORCA geomscan text → pint Quantities with data."""
47
+ dist, energy = extract_orca_geomscan_energy(_GEOMSCAN_SNIPPET, "Actual Energy")
48
+ assert dist.size == 3
49
+ assert energy.size == 3
50
+ assert str(dist.units) == "bohr"
51
+ assert str(energy.units) == "hartree"
52
+ np.testing.assert_allclose(
53
+ dist.magnitude,
54
+ [7.55890395, 7.32930292, 7.09970189],
55
+ )
56
+ np.testing.assert_allclose(
57
+ energy.magnitude,
58
+ [-0.74239862, -0.74349939, -0.74467446],
59
+ )
60
+
61
+
62
+ def test_extract_orca_geomscan_energy_from_fixture_file():
63
+ text = FIXTURE_FILE.read_text(encoding="utf-8")
64
+ dist, energy = extract_orca_geomscan_energy(text, "SCF energy")
65
+ assert dist.size >= 1
66
+ assert energy.size == dist.size
67
+ assert dist.size == 3
68
+
69
+
70
+ def test_suite_pins_returns_dict():
71
+ pins = suite_pins()
72
+ assert isinstance(pins, dict)
File without changes
File without changes