Skip to content

Make the CLI a first-class citizen: energy/optimize/thermo/tautomers + modernization - #105

Merged
isayev merged 4 commits into
mainfrom
feat/cli-first-class
Jun 13, 2026
Merged

Make the CLI a first-class citizen: energy/optimize/thermo/tautomers + modernization#105
isayev merged 4 commits into
mainfrom
feat/cli-first-class

Conversation

@isayev

@isayev isayev commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

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_spe
  • auto3d optimize <in.sdf>opt_geometry
  • auto3d thermo <in.sdf>calc_thermo (clear DependencyError if the ase extra is missing)
  • auto3d tautomers <in.smi>get_stable_tautomers

Each validates its input path, shares --engine/--gpu/--gpu-idx/-o/--json, and routes failures through handle_error.

Bug fixes (CLI divergences)

  • auto3d run --save-intermediate now maps to Auto3DOptions.verbose (previously unreachable except via YAML); --job-name added.
  • Legacy auto3d <config.yaml> no longer leaks tracebacks (checks existence, funnels all errors through handle_error, real deprecation warning).
  • allow_tf32 was 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).
  • Removed the dead failure-detail branch in run.

Modernization

  • Differentiated exit codes (config/input 2, dependency 3, GPU 4, model 5, generic 1).
  • --preset enum + --engine shell completion; Typer-level input-path existence validation; config init --force.
  • Minimal backwards-compatible API additions: out_path/use_gpu/allow_tf32 on calc_spe/opt_geometry/calc_thermo.

Docs (README, docs/source/cli.rst, CHANGELOG) updated. Fast gate: 663 passed (+14 new CLI tests); ruff clean on src/.

Deferred (from the API review): deeper API coherence (push WorkflowResults down, de-duplicate config field declarations + sync test, promote tautomer functions to __all__, generate_conformers alias, registry-aware models).

isayev added 4 commits June 13, 2026 01:33
… 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
isayev merged commit 0d6d83e into main Jun 13, 2026
8 of 9 checks passed
@isayev
isayev deleted the feat/cli-first-class branch June 13, 2026 05:40
isayev added a commit that referenced this pull request Jul 11, 2026
Make the CLI a first-class citizen: energy/optimize/thermo/tautomers + modernization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant