Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/Auto3D/ASE/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,10 @@
from Auto3D.torch_config import TorchConfig, configure_torch
from Auto3D.utils.atomic_io import atomic_write_path
from Auto3D.utils.energy import E_TOT_HARTREE_PROP, E_TOT_PROP
from Auto3D.utils.output_guard import check_output_not_input, check_output_overwrite
from Auto3D.utils.validation import (
check_engine_supports_molecules,
check_gpu_requested,
check_output_not_input,
check_output_overwrite,
)

__all__ = ["opt_geometry"]
Expand Down
17 changes: 12 additions & 5 deletions src/Auto3D/ASE/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@
from Auto3D.torch_config import TorchConfig, configure_torch
from Auto3D.utils.energy import hartree2ev
from Auto3D.utils.logging_config import get_logger
from Auto3D.utils.output_guard import check_output_not_input, check_output_overwrite
from Auto3D.utils.validation import (
check_engine_supports_molecules,
check_gpu_requested,
check_output_not_input,
check_output_overwrite,
)

__all__ = ["calc_thermo"]
Expand Down Expand Up @@ -686,7 +685,11 @@ def vib_hessian(mol: Chem.Mol, ase_calculator, model,
# mass weighting, and the rotational partition function silently disagree
# for isotopically labeled input.
atoms = mol2atoms(mol, positions=positions)
atoms.set_calculator(ase_calculator)
# atoms.set_calculator() is deprecated since ase 3.22.1 in favor of the
# `.calc` attribute (Minor 6); `pyproject.toml` pins no ase upper bound
# and globally ignores DeprecationWarning, so removal would otherwise
# land as a silent-until-runtime AttributeError with no advance warning.
atoms.calc = ase_calculator
charge = rdmolops.GetFormalCharge(mol)

# get the Hessian
Expand Down Expand Up @@ -1194,7 +1197,9 @@ def do_mol_thermo(mol: Chem.Mol,
# them via the explicit `positions=` argument, not from mol's conformer),
# so nothing here depends on mol's conformer being in sync yet.
coord = atoms.get_positions()
vib = vib_hessian(mol, atoms.get_calculator(), model, device,
# atoms.get_calculator() is deprecated since ase 3.22.1; use `.calc`
# (Minor 6, same rationale as the set_calculator() call above).
vib = vib_hessian(mol, atoms.calc, model, device,
model_name=model_name, positions=coord)
e = atoms.get_potential_energy()
geometry = _detect_geometry(atoms)
Expand Down Expand Up @@ -1691,7 +1696,9 @@ def calc_thermo(path: str, model_name: str, mol_info_func=None,
atoms = mol2atoms(mol)

calculator.set_charge(charge)
atoms.set_calculator(calculator)
# atoms.set_calculator() is deprecated since ase 3.22.1; use `.calc`
# (Minor 6, same rationale as vib_hessian's call above).
atoms.calc = calculator

if mol_info_func is None:
idx = mol.GetProp("_Name").strip()
Expand Down
3 changes: 1 addition & 2 deletions src/Auto3D/SPE.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
from Auto3D.models.preflight import resolve_engine_name
from Auto3D.torch_config import TorchConfig, configure_torch
from Auto3D.utils.logging_config import get_logger
from Auto3D.utils.output_guard import check_output_not_input, check_output_overwrite
from Auto3D.utils.validation import (
check_engine_supports_molecules,
check_gpu_requested,
check_output_not_input,
check_output_overwrite,
)

logger = get_logger(__name__)
Expand Down
4 changes: 2 additions & 2 deletions src/Auto3D/batch_opt/optimization_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def _step_active_subset(
not_oscillating = oscillating_count < patience

# Combine the convergence criteria. An `& ~energy_converged` term stood
# here until 4.0.0; `energy_converged` required `fmax < opttol` while
# here until 3.0.0; `energy_converged` required `fmax < opttol` while
# `not_converged_post1` is `fmax > opttol`, so the term was the identity
# of `&` wherever it was consulted and false-dominated elsewhere -- it
# could never change an outcome, including at the `fmax == opttol`
Expand Down Expand Up @@ -373,7 +373,7 @@ def n_steps(
2. Oscillation detection: drops structures that don't improve for patience steps

There is deliberately no energy-stability criterion. One existed until
4.0.0 but could never fire: it required ``fmax < opttol``, which is
3.0.0 but could never fire: it required ``fmax < opttol``, which is
exactly the condition under which the force criterion has already stopped
the structure, so the term was the identity of ``&`` at every element (see
``test_convergence_outcome_never_depends_on_energy_stability``).
Expand Down
2 changes: 1 addition & 1 deletion src/Auto3D/cli/commands/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def execute_config_init(
Both refusals below are configuration problems, so both leave through
``handle_error`` at exit **2**. The overwrite refusal in particular had to
move: the CLI's own ``-o`` overwrite gate
(``utils.validation.check_output_overwrite``) raises ``ConfigurationError``
(``utils.output_guard.check_output_overwrite``) raises ``ConfigurationError``
and exits 2, and the CHANGELOG described the two as printing "the same
message" -- while this one hard-coded ``SystemExit(1)``, so a script
branching on 2 saw one of them and not the other.
Expand Down
7 changes: 2 additions & 5 deletions src/Auto3D/cli/commands/properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@
from Auto3D.cli.errors import handle_error
from Auto3D.exceptions import ConfigurationError, DependencyError
from Auto3D.models.preflight import resolve_engine_name
from Auto3D.utils.validation import (
check_gpu_requested,
check_output_not_input,
check_output_overwrite,
)
from Auto3D.utils.output_guard import check_output_not_input, check_output_overwrite
from Auto3D.utils.validation import check_gpu_requested

# Engine names offered for shell completion. Free-form registry names and custom
# model paths are also accepted -- each command below validates them with
Expand Down
2 changes: 1 addition & 1 deletion src/Auto3D/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ class OptimizationConfig:
memory but may be faster."""

# There is deliberately no energy_tol/energy_patience here. Both existed
# until 4.0.0 and reached an optimizer criterion that could never fire
# until 3.0.0 and reached an optimizer criterion that could never fire
# (audit M1), so they were knobs that changed nothing. Removed rather than
# kept as inert configuration.

Expand Down
2 changes: 1 addition & 1 deletion src/Auto3D/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
DEFAULT_PATIENCE = 250 # Steps before dropping oscillating conformer
DEFAULT_BATCHSIZE_ATOMS = 1024 # Atoms per batch for GPU optimization
DEFAULT_ENERGY_CLUSTER_WINDOW = 0.1 # eV, for RMSD clustering
# DEFAULT_ENERGY_TOL / DEFAULT_ENERGY_PATIENCE were removed in 4.0.0 along with
# DEFAULT_ENERGY_TOL / DEFAULT_ENERGY_PATIENCE were removed in 3.0.0 along with
# the optimizer's energy-stability criterion, which could never fire (audit M1).
# Tuning the tolerance -- for fp32 noise or anything else -- changed nothing.
DEFAULT_RANDOM_SEED = 42 # Default random seed for reproducibility
Expand Down
Loading
Loading