Add Python interface (pyquick) via f2py#474
Draft
vtripath65 wants to merge 15 commits intomerzlab:masterfrom
Draft
Add Python interface (pyquick) via f2py#474vtripath65 wants to merge 15 commits intomerzlab:masterfrom
vtripath65 wants to merge 15 commits intomerzlab:masterfrom
Conversation
Collaborator
|
Converted this to draft so we don't merge it before releasing QUICK-26.03 |
…numpy 1.24 to 1.26
Add pyq_ test category to runtest: check_python_error() skips gracefully when the Python interface is not built (mirrors the F-function skip pattern), run_pyquick_test() runs the Python smoke test and logs PASS/possible FAILURE, --python flag, get_total_tests 7th arg, print_summary Python tests line, and GNU parallel exports. Add pyq_ene_H2O_rhf_sto3g to both short and full test lists so runtest --serial (and --serial --full) now cover the pyquick test.
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.
Summary
This PR adds
pyquick, a Python interface to QUICK built with f2py, enablingusers to set up and run QUICK calculations directly from Python without writing
input files.
New files
src/pyquick/pyquick.f90— Fortran module compiled by f2py into a Python Cextension. Exposes subroutines for setting the calculation type, basis set,
method keywords, and molecular geometry, as well as running the SCF and
retrieving results (total energy, MO energies, density matrix, Mulliken/Löwdin
charges).
src/pyquick/__init__.py— Pure-Python wrapper that imports the f2py extension,checks the
had_errorflag after every Fortran call and raisesRuntimeErroron failure, and provides the
PyQuickclass with per-instance state and acopy()method for creating independent conformations.src/pyquick/CMakeLists.txt— Build rules for the f2py extension. Beforeattempting to compile, the build system explicitly checks that both Python and
numpy (including f2py) are available via
find_programandexecute_process. A clearFATAL_ERRORis emitted if either is missing,rather than failing silently at compile time.
Build system changes
CMakeLists.txt— adds-DPYTHON=TRUEoption.src/CMakeLists.txt— addsadd_subdirectory(pyquick)guarded by-DPYTHON=TRUE.quick-cmake/quick.rc— prepends<prefix>/libtoPYTHONPATHso thatimport pyquickworks aftersource quick.rc.Build instructions
cmake .. -DCOMPILER=GNU -DENABLEF=FALSE -DPYTHON=TRUE \ -DCMAKE_INSTALL_PREFIX=$PWD/../install cmake --build . --parallel $(nproc) cmake --install . source ../install/quick.rcUsage example