Make the CLI a first-class citizen: energy/optimize/thermo/tautomers + modernization - #105
Merged
Conversation
… torch config Add backwards-compatible out_path, use_gpu, and allow_tf32 parameters to the single-point energy, geometry-optimization, and thermochemistry entry points, and select the device via the shared get_device(gpu_idx, use_gpu) helper while applying configure_torch(TorchConfig(allow_tf32=...)) at entry. These three paths previously selected the device inline and never applied the torch configuration, so allow_tf32 was silently a no-op for them; it now takes effect (a small numerical change when enabled). out_path lets callers control the output location instead of always deriving it from the input path. This is the foundation the new CLI subcommands build on.
The CLI was first-class only for conformer generation; single-point energy, geometry optimization, thermochemistry, and tautomer ranking were Python-only. Add four thin subcommands wrapping calc_spe / opt_geometry / calc_thermo / get_stable_tautomers (cli/commands/properties.py), registered in cli/app.py. Each validates its input path, shares --engine/--gpu/--gpu-idx/-o/--json, writes an SDF, and routes failures through handle_error. `thermo` raises a clear DependencyError when the ase extra is missing.
…ad branch - `auto3d run` exposed -v only for logging; Auto3DOptions.verbose (save all metadata) was unreachable except via YAML. Add an explicit --save-intermediate flag that maps to it, and add --job-name (previously YAML-only). - The legacy `auto3d <config.yaml>` path caught only Auto3DError, so any other failure (bad path, malformed YAML, runtime error) printed a raw traceback. It now checks the file exists and funnels every failure through handle_error, and emits a real deprecation warning pointing at `auto3d run -c`. - Remove the dead failure-detail branch in run (results.failures is always empty), so the summary no longer implies a -v detail list that never exists.
- Differentiated exit codes (cli/errors.py): config/input -> 2, dependency -> 3, GPU -> 4, model -> 5, generic -> 1, for scriptable error handling. - `config init --force/-f`: refuse to overwrite an existing config without it. - Document the new subcommands and exit-code scheme (README, docs/source/cli.rst, CHANGELOG [Unreleased]). - Tests: new test_cli_property_commands.py covers the four subcommands, exit-code mapping, enum/path validation, --save-intermediate, and config init --force; update the legacy-path and config tests for the new differentiated codes and Typer-level path/enum validation; fix the geometry test to patch get_device. (--preset enum + shell completion, Typer-level path existence validation, and run's --job-name/--save-intermediate wiring landed in cli/app.py with the subcommand registration.)
isayev
added a commit
that referenced
this pull request
Jul 11, 2026
Make the CLI a first-class citizen: energy/optimize/thermo/tautomers + modernization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A three-agent review (CLI↔API parity, CLI UX, public-API architecture) found the CLI was first-class only for conformer generation; single-point energy, geometry optimization, thermochemistry, and tautomer ranking were Python-only. This closes that gap and modernizes the CLI.
New first-class subcommands
auto3d energy <in.sdf>→calc_speauto3d optimize <in.sdf>→opt_geometryauto3d thermo <in.sdf>→calc_thermo(clear DependencyError if theaseextra is missing)auto3d tautomers <in.smi>→get_stable_tautomersEach validates its input path, shares
--engine/--gpu/--gpu-idx/-o/--json, and routes failures throughhandle_error.Bug fixes (CLI divergences)
auto3d run--save-intermediatenow maps toAuto3DOptions.verbose(previously unreachable except via YAML);--job-nameadded.auto3d <config.yaml>no longer leaks tracebacks (checks existence, funnels all errors throughhandle_error, real deprecation warning).allow_tf32was a silent no-op for the energy/optimize/thermo paths — they now route through the shared device + torch config so it applies (small numerical change when enabled).run.Modernization
--presetenum +--engineshell completion; Typer-level input-path existence validation;config init --force.out_path/use_gpu/allow_tf32oncalc_spe/opt_geometry/calc_thermo.Docs (README,
docs/source/cli.rst, CHANGELOG) updated. Fast gate: 663 passed (+14 new CLI tests); ruff clean onsrc/.Deferred (from the API review): deeper API coherence (push
WorkflowResultsdown, de-duplicate config field declarations + sync test, promote tautomer functions to__all__,generate_conformersalias, registry-awaremodels).