Skip to content

Make qcelemental an optional dependency#65

Merged
sgoodlett merged 1 commit into
NASymmetry:mainfrom
jhrmnn:claude/qcelemental-optional-iosjwj
Jun 30, 2026
Merged

Make qcelemental an optional dependency#65
sgoodlett merged 1 commit into
NASymmetry:mainfrom
jhrmnn:claude/qcelemental-optional-iosjwj

Conversation

@jhrmnn

@jhrmnn jhrmnn commented Jun 26, 2026

Copy link
Copy Markdown

Closes #64. Made with Claude.


The core in-memory path (point-group detection + SALC generation) only needs numpy. qcelemental was imported at module top in molecule.py and symtext/symtext.py but is used solely by the file/schema/Psi4 loaders and serializer and one mass lookup, never by the core path.

  • molecule.py: drop top-level import qcelemental as qcel; import it locally in from_schema, from_file, from_psi4_schema, and to_xyz_string (the only qcel users; from_psi4_molecule uses no qcel).
  • symtext/symtext.py: drop top-level import; import locally in from_file.
  • pyproject.toml: move qcelemental into an optional qcel extra so pip install molsym is numpy-only and pip install molsym[qcel] restores the loaders.
  • requirements.txt: note qcelemental is optional.

Now import molsym plus point-group/SALC generation works with only numpy installed (no qcelemental/pydantic/pint)

The core in-memory path (point-group detection + SALC generation) only
needs numpy. qcelemental was imported at module top in molecule.py and
symtext/symtext.py but is used solely by the file/schema/Psi4 loaders and
serializer and one mass lookup, never by the core path.

- molecule.py: drop top-level `import qcelemental as qcel`; import it
  locally in from_schema, from_file, from_psi4_schema, and to_xyz_string
  (the only qcel users; from_psi4_molecule uses no qcel).
- symtext/symtext.py: drop top-level import; import locally in from_file.
- pyproject.toml: move qcelemental into an optional `qcel` extra so
  `pip install molsym` is numpy-only and `pip install molsym[qcel]`
  restores the loaders.
- requirements.txt: note qcelemental is optional.

Now `import molsym` plus point-group/SALC generation works with only
numpy installed (no qcelemental/pydantic/pint).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LEzrRFpsUE9ZFWbDwYUmmU
@sgoodlett sgoodlett self-requested a review June 30, 2026 13:38
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
molsym/molecule.py 75.00% 1 Missing ⚠️
molsym/symtext/symtext.py 0.00% 1 Missing ⚠️
Flag Coverage Δ
unittests 84.39% <60.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
molsym/molecule.py 85.21% <75.00%> (-0.41%) ⬇️
molsym/symtext/symtext.py 74.57% <0.00%> (-0.57%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sgoodlett sgoodlett requested a review from nlk36701 June 30, 2026 13:42
@sgoodlett sgoodlett merged commit 8c8c166 into NASymmetry:main Jun 30, 2026
6 of 7 checks passed
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.

Make qcelemental optional dependency

3 participants