Repository navigation
Remove pyscf/nac and pyscf/pbc/lo __init__.py files that shadow core's (#219) - #223
Open
MatthewRHermes wants to merge 1 commit into
Open
MatthewRHermes wants to merge 1 commit into
MatthewRHermes wants to merge 1 commit into
Conversation
pyscf#219) Both directories also exist in PySCF core with their own __init__.py, so a regular install of pyscf-forge overwrites core's file, and uninstalling pyscf-forge deletes it. All forge imports of these packages are explicit submodule imports (pyscf.nac.tduks_sf, pyscf.pbc.lo.mlwf), which keep working without forge's __init__.py. Add a step to run_ci.sh that fails when a forge __init__.py has a counterpart in the installed pyscf, before forge is installed on top of it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Fixes #219.
pyscf/nac/__init__.pyandpyscf/pbc/lo/__init__.pyboth have counterparts in PySCF core (pbc/losince pyscf/pyscf#3127, released in 2.14.0). A regularpip install pyscf-forgeoverwrites core's files, andpip uninstall pyscf-forgedeletes them. With forge'spbc/lo/__init__.pyinstalled, for example,from pyscf.pbc.lo import KPMstops working.Changes
from pyscf.nac import tduks_sf,from pyscf.pbc.lo import mlwf,from pyscf.pbc.lo.mlwf.<module> import ...). These still resolve once forge's modules sit next to core's__init__.py.pbc/lo/mlwf/__init__.pystays, since core has nomlwfsubpackage.run_ci.sh: beforepip install ., installpyscfand fail if any forge__init__.pyhas a counterpart in it. Core's location comes fromimportlib.util.find_spec, so core isn't imported. The check runs against the latest core release, so a clash created later on core's side (as happened withpbc/lo) gets caught at the next CI run after that release.Testing
pyscf/pbc/lo/__init__.pyandpyscf/nac/__init__.pyand exits 1. On this branch it exits 0.pytest pyscf/nac pyscf/pbc/loon this branch: all passing excepttest_tduks_sf.py::KnownValues::test_against_cache_refs(max abs diff 2.6e-6 vs. rtol 1e-7). That test fails the same way on master in my environment, so it's unrelated to this change.Code changes and this description were drafted with the assistance of Claude Opus 5.5.
🤖 Generated with Claude Code