Skip to content

Commit bd1d3b7

Browse files
committed
share v0.30 changes among v1 and v2 models
1 parent 76404fd commit bd1d3b7

File tree

5 files changed

+21
-14
lines changed

5 files changed

+21
-14
lines changed

.github/workflows/CI.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ on:
66
- master
77
- next2024
88
- next2025
9+
- next2026
910
pull_request:
1011
branches:
1112
- master
1213
- next2024
1314
- next2025
15+
- next2026
1416
schedule:
1517
- cron: "9 16 * * 1"
1618

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Build Status](https://github.com/MolSSI/QCElemental/workflows/CI/badge.svg?branch=master)](https://github.com/MolSSI/QCElemental/actions?query=workflow%3ACI)
44
[![codecov](https://img.shields.io/codecov/c/github/MolSSI/QCElemental.svg?logo=Codecov&logoColor=white)](https://codecov.io/gh/MolSSI/QCElemental)
55
[![Documentation Status](https://img.shields.io/github/actions/workflow/status/MolSSI/QCElemental/CI.yaml?label=docs&logo=readthedocs&logoColor=white)](https://molssi.github.io/QCElemental/)
6-
[![Chat on Slack](https://img.shields.io/badge/chat-on_slack-green.svg?longCache=true&style=flat&logo=slack)](https://join.slack.com/t/qcarchive/shared_invite/enQtNDIzNTQ2OTExODk0LTE3MWI0YzBjNzVhNzczNDM0ZTA5MmQ1ODcxYTc0YTA1ZDQ2MTk1NDhlMjhjMmQ0YWYwOGMzYzJkZTM2NDlmOGM)
6+
[![Chat on Slack](https://img.shields.io/badge/chat-on_slack-green.svg?longCache=true&style=flat&logo=slack)](https://join.slack.com/t/qcarchive/shared_invite/zt-3calopudd-2rtUC~XN1tj1Zn9MHkV6GQ)
77
![python](https://img.shields.io/badge/python-3.8+-blue.svg)
88

99
**Documentation:** [GitHub Pages](https://molssi.github.io/QCElemental/)

pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ issues = "https://github.com/MolSSI/QCElemental/issues"
1212
name = "qcelemental"
1313
#version = "0.30.0"
1414
dynamic = ["version"]
15-
requires-python = ">=3.8"
15+
# pydantic.v1 not available for py >=3.14
16+
requires-python = ">=3.8,<3.14"
1617
description = "Core data structures for Quantum Chemistry."
1718
authors = [
1819
{ name="The QCArchive Development Team", email="qcarchive@molssi.org" },
@@ -49,10 +50,10 @@ standard = [
4950
]
5051
viz = [
5152
"nglview", # !py38 # insufficient on pypi as also need `dot`. python-graphviz sufficient in conda.
52-
"setuptools; python_version>='3.12'", # nglview needs pkg_resources
53+
"setuptools >=68.0.0; python_version>='3.12'", # nglview needs pkg_resources
54+
# setuptools is needed temporarily to avoid pkg_resources error with ngl_view. remove from here after next nglview release beyond v1.3.4
5355
"ipykernel <6.0",
5456
]
55-
# pydantic.v1 not available for py >=3.14
5657
align = [
5758
"networkx <3.0",
5859
"scipy",

qcelemental/models/v2/molecule.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,11 @@ def from_data(
987987
raise TypeError("Input type not understood, please supply the 'dtype' kwarg.")
988988

989989
if dtype in ["string", "psi4", "xyz", "xyz+"]:
990-
mol_dict = from_string(data, dtype if dtype != "string" else None)
990+
subkwargs = {}
991+
for key in ["verbose"]:
992+
if key in kwargs:
993+
subkwargs[key] = kwargs.pop(key)
994+
mol_dict = from_string(data, dtype if dtype != "string" else None, **subkwargs)
991995
assert isinstance(mol_dict, dict)
992996
input_dict = to_schema(mol_dict["qm"], dtype=3, np_out=True)
993997
input_dict = _filter_defaults(input_dict)
@@ -1454,21 +1458,21 @@ def align(
14541458
amol.nuclear_repulsion_energy(),
14551459
"Q: concern_mol-->returned_mol NRE uncorrupted",
14561460
atol=1.0e-4,
1457-
quiet=(verbose > 1),
1461+
quiet=(verbose < 1),
14581462
)
14591463
if mols_align:
14601464
assert compare_values(
14611465
ref_mol.nuclear_repulsion_energy(),
14621466
amol.nuclear_repulsion_energy(),
14631467
"Q: concern_mol-->returned_mol NRE matches ref_mol",
14641468
atol=1.0e-4,
1465-
quiet=(verbose > 1),
1469+
quiet=(verbose < 1),
14661470
)
14671471
assert compare(
14681472
True,
14691473
np.allclose(ref_mol.geometry, amol.geometry, atol=4),
14701474
"Q: concern_mol-->returned_mol geometry matches ref_mol",
1471-
quiet=(verbose > 1),
1475+
quiet=(verbose < 1),
14721476
)
14731477

14741478
return amol, {"rmsd": rmsd, "mill": solution}
@@ -1588,17 +1592,17 @@ def scramble(
15881592
solution = data["mill"]
15891593

15901594
assert compare(
1591-
True, np.allclose(solution.shift, perturbation.shift, atol=1.0e-6), "shifts equiv", quiet=(verbose > 1)
1595+
True, np.allclose(solution.shift, perturbation.shift, atol=1.0e-6), "shifts equiv", quiet=(verbose < 1)
15921596
)
15931597
if not do_resort:
15941598
assert compare(
15951599
True,
15961600
np.allclose(solution.rotation.T, perturbation.rotation),
15971601
"rotations transpose",
1598-
quiet=(verbose > 1),
1602+
quiet=(verbose < 1),
15991603
)
16001604
if solution.mirror:
1601-
assert compare(True, do_mirror, "mirror allowed", quiet=(verbose > 1))
1605+
assert compare(True, do_mirror, "mirror allowed", quiet=(verbose < 1))
16021606

16031607
return cmol, {"rmsd": rmsd, "mill": perturbation}
16041608

qcelemental/tests/test_molecule.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,7 @@ def test_molecular_weight(Molecule, mol_string, args, formula, formula_dict, mol
10311031

10321032

10331033
@pytest.mark.parametrize("verbose", [1, 5])
1034-
def test_molecule_verbose(capsys, verbose):
1034+
def test_molecule_verbose(Molecule, capsys, verbose):
10351035
Molecule.from_data("""0 3\nNe 0 0 0\n--\nNe 2 2 2\n""", verbose=verbose)
10361036
captured = capsys.readouterr()
10371037
if verbose > 1:
@@ -1042,9 +1042,9 @@ def test_molecule_verbose(capsys, verbose):
10421042

10431043

10441044
@pytest.mark.parametrize("verbose", [1, 2])
1045-
def test_molecule_verbose_368(capsys, verbose):
1045+
def test_molecule_verbose_368(Molecule, capsys, verbose):
10461046
with pytest.raises(qcel.ValidationError) as e:
1047-
qcel.models.Molecule(
1047+
Molecule(
10481048
symbols=["C", "C", "Pd", "C", "H", "H", "H", "H", "H"],
10491049
geometry=[
10501050
[-39.98282536, -71.86061537, 15.18016997],

0 commit comments

Comments
 (0)