Add pre-fitted atomic Gaussian parameter loader and data#306
Open
Ao-chuba wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a package-safe, zero-extra-dependency loader to fetch pre-fitted s-type atomic Gaussian parameters (coefficients/exponents) for a small set of elements (H, C, N, O, Cl), backed by a JSON dataset shipped with the package. This supports the Poisson-solver robustness effort by enabling “promolecular/fit-based” strategies without external fit libraries.
Changes:
- Added
load_atomic_gaussian_params(element)with symbol/atomic-number support and lazy JSON caching. - Added
src/grid/data/atomic_gauss_params.jsoncontaining the fitted parameters. - Exported the loader and added unit tests validating basic lookup/shape/value constraints.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/grid/coulomb.py |
Implements the JSON-backed atomic parameter loader and exports it. |
src/grid/data/atomic_gauss_params.json |
Adds the pre-fitted parameter dataset for supported elements. |
src/grid/tests/test_coulomb.py |
Adds tests for the new loader. |
src/grid/__init__.py |
Re-exports Coulomb module symbols at package root. |
MANIFEST.in |
Attempts to include the new JSON dataset in packaged artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.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.
2nd PR for Improvement of the robustness of poisson equation
This pull request implements a zero dependency loader$s$ -type Gaussian parameters (coefficients and exponents) for elements H, C, N, O, and Cl from a package-safe JSON dataset
load_atomic_gaussian_params(element) in src/grid/coulomb.py to retrieve pre-fitted(atomic_gauss_params.json).The loader supports case insensitive, space stripped element symbols (e.g. "cl", " C ") as well as atomic numbers (e.g. 17), utilizing a module-level lazy cache to avoid repeated disk reads. The packaging configuration inMANIFEST.inhas been updated to bundle the dataset, the loader has been exported at the package root level, and unit tests have been added to verify type handling, lookup correctness, and parameter validity.related to issue -> here