Add pre-fitted atomic Gaussian parameter loader and data#306
Conversation
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>
There was a problem hiding this comment.
These are weak tests, but for now, fine
There was a problem hiding this comment.
RIght i see, i think to improve the tc , we can add in normalization checks or potential accuracy checks ? if that makes sense we can add in those test cases in the next commit or maybe even a different pr.
There was a problem hiding this comment.
Please fix the comments, also check #317 for the Manifest.in structure
Updated the periodic table lookups
extra comment
|
@marco-2023 thanks for the review, i have updated the pr as requested. please do let me know if any other is required. |
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