Skip to content

chore: Python 3.10+, remove legacy code, clean repo#67

Merged
ericchansen merged 2 commits intomasterfrom
chore/python-310-minimum
Mar 19, 2026
Merged

chore: Python 3.10+, remove legacy code, clean repo#67
ericchansen merged 2 commits intomasterfrom
chore/python-310-minimum

Conversation

@ericchansen
Copy link
Copy Markdown
Owner

Summary

Require Python 3.10+, remove all legacy/archived code, clean up .gitignore, and modernize the repo for a lean SDK.

Changes

Python 3.10+ minimum

  • requires-python bumped from >=3.9 to >=3.10
  • Ruff target-version updated to py310
  • CI matrix drops Python 3.9
  • Enable UP006/UP035 ruff rules -- auto-fix typing.List/Tuple to builtins in 7 files

Remove legacy code (-72K lines)

  • Delete scripts/archived/ entirely (26 files -- Schrodinger-dependent tools)
  • Delete psi4-output.dat and psi4-output-v2.dat (2.7 MB raw Psi4 logs; extracted .npy/.txt/.xyz data remains)
  • Merge generate_qm_data_v2.py into generate_qm_data.py (remove v1)
  • Rename test_new_pipeline.py to test_pipeline.py

Clean .gitignore (238 lines -> 55)

  • Remove overly broad globs (*.fld, *.mol2, *.log, *.txt, *.fchk, *.mae, etc.) that were hiding legitimate example data
  • Ethane example files (GS.fchk, GS.log, GS.mol2, TS.*) now properly tracked
  • Test fixture optimization_golden.json now tracked

Update .vscode/launch.json

  • Replace 7 legacy configs (referenced dead scripts like q2mm/loop.py, q2mm/seminario.py, q2mm/just_compare.py)
  • Add 5 configs for current API: SN2 pipeline, test runner, current file tests, benchmarks, upstream validation

Testing

  • ruff check . -- all checks passed
  • ruff format --check -- 71 files already formatted
  • pytest -q -- 153 passed, 8 skipped, 1 xfailed
  • mkdocs build --strict -- clean build

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the repository into a leaner Python SDK by raising the minimum supported Python version to 3.10+, updating typing annotations to PEP 585 style, removing archived tooling/data, and tightening repo hygiene (CI, .gitignore, VS Code debug configs, fixtures/examples).

Changes:

  • Require Python 3.10+ (packaging metadata, Ruff target version, CI matrix).
  • Replace legacy typing.List/Tuple annotations with built-in generics (list[...], tuple[...]).
  • Remove scripts/archived/ and consolidate SN2 QM data generation; add/track new fixtures and example data; simplify .gitignore and update .vscode/launch.json.

Reviewed changes

Copilot reviewed 43 out of 50 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
test/test_linear_algebra.py Updates typing annotations to built-in generics.
test/fixtures/optimization_golden.json Adds a pinned “golden” optimization fixture for regression testing.
scripts/validate_against_upstream.py Modernizes typing import (Callable from collections.abc).
scripts/archived/tools/sumq.py Removes archived script.
scripts/archived/tools/submit.py Removes archived script.
scripts/archived/tools/setup_sh_from_com.py Removes archived script.
scripts/archived/tools/setup_qm.py Removes archived script.
scripts/archived/tools/many_sumq.py Removes archived script.
scripts/archived/tools/invert-chirality.py Removes archived script.
scripts/archived/tools/format-ff.py Removes archived script.
scripts/archived/tools/file_converter.py Removes archived script.
scripts/archived/tools/count_steps.py Removes archived script.
scripts/archived/tools/clean_mae_same_update.py Removes archived script.
scripts/archived/tools/clean_mae_same_restart.py Removes archived script.
scripts/archived/tools/clean_mae_same.py Removes archived script.
scripts/archived/tools/clean_mae.py Removes archived script.
scripts/archived/tools/change_mae_atom_type.py Removes archived script.
scripts/archived/smiles_to_catvs_example/template_diphos.mae Removes archived example data.
scripts/archived/smiles_to_catvs_example/smi/strem_bisphosphines.smi Removes archived example data.
scripts/archived/smiles_to_catvs_example/run Removes archived example runner.
scripts/archived/smiles_to_catvs_example/atom.typ Removes archived example data.
scripts/archived/smiles_to_catvs_example/allyl6.mae Removes archived example data.
scripts/archived/smiles_to_catvs/scripts/search.py Removes archived script.
scripts/archived/smiles_to_catvs/scripts/sdf_to_mae.py Removes archived script.
scripts/archived/smiles_to_catvs/scripts/prepare.py Removes archived script.
scripts/archived/smiles_to_catvs/scripts/finish.py Removes archived script.
scripts/archived/README.md Removes archived docs.
q2mm/parsers/mm3.py Updates annotations to list[...] and adjusts internal typing.
q2mm/parsers/base.py Updates annotations to list[...] in base parser APIs.
q2mm/parsers/amber_ff.py Updates annotations to list[...] in Amber FF parser.
q2mm/models/hessian.py Updates annotations (list[...], tuple[...]) in Hessian helpers.
q2mm/linear_algebra.py Updates return type annotation to tuple[...].
pyproject.toml Bumps requires-python to 3.10; Ruff target-version to py310; adjusts ignore list comments.
examples/sn2-test/test_pipeline.py Adds a pipeline demo script using the “clean” model layer.
examples/sn2-test/generate_qm_data_v2.py Removes v2 generator (merged into v1).
examples/sn2-test/generate_qm_data.py Merges/improves QM data generation workflow (diffuse basis + complex).
examples/sn2-test/README.md Updates docs to reflect renamed scripts and workflow.
examples/ethane/TS.mol2 Adds tracked TS mol2 example data.
examples/ethane/GS.mol2 Adds tracked GS mol2 example data.
.vscode/launch.json Replaces legacy debug configs with configs targeting current scripts/tools.
.gitignore Removes overly broad ignores; keeps only generated artifacts and standard tooling output.
.github/workflows/ci.yml Drops Python 3.9 from the CI matrix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .vscode/launch.json Outdated
Comment thread examples/sn2-test/generate_qm_data.py Outdated
Comment thread examples/ethane/TS.mol2 Outdated
Comment thread q2mm/parsers/mm3.py Outdated
Comment thread q2mm/parsers/amber_ff.py Outdated
Comment thread pyproject.toml Outdated
Python 3.10+ minimum:
- Update requires-python and ruff target-version to py310
- Drop Python 3.9 from CI matrix
- Enable UP006/UP035 ruff rules, auto-fix typing.List/Tuple to builtins
- Remove dead typing imports from 7 files

Remove legacy/archived code:
- Delete scripts/archived/ (26 files, Schrodinger-dependent tools)
- Delete psi4-output.dat and psi4-output-v2.dat (2.7 MB raw logs)
- Merge generate_qm_data_v2.py into generate_qm_data.py
- Rename test_new_pipeline.py to test_pipeline.py

Clean .gitignore:
- Rewrite from 238 lines to 55 — remove overly broad globs
  (*.fld, *.mol2, *.log, *.txt, etc. were hiding example data)
- Ethane example files now tracked (GS/TS .fchk, .log, .mol2)
- Test fixture JSON now tracked

Update .vscode/launch.json:
- Replace 7 legacy configs referencing old CLI scripts
- Add 5 new configs for current API (pipeline, tests, benchmarks)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ericchansen ericchansen force-pushed the chore/python-310-minimum branch from 810a620 to 147102e Compare March 19, 2026 19:34
- Switch .vscode/launch.json SN2 config from module to program path
  (hyphenated directory is not a valid Python module name)
- Populate examples/ethane/TS.mol2 with real coordinates from TS.fchk
  (was all zeros — physically invalid structure)
- Fix list[Param] annotations to list[Param] | None in mm3.py and
  amber_ff.py where default is None
- Update F402 ignore comment (archived scripts are deleted)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ericchansen ericchansen merged commit 551d3a9 into master Mar 19, 2026
@ericchansen ericchansen deleted the chore/python-310-minimum branch March 19, 2026 19:43
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.

2 participants