Skip to content

Add pre-fitted atomic Gaussian parameter loader and data#306

Merged
marco-2023 merged 9 commits into
theochem:masterfrom
Ao-chuba:feature/atomic-gaussian-params
Jul 8, 2026
Merged

Add pre-fitted atomic Gaussian parameter loader and data#306
marco-2023 merged 9 commits into
theochem:masterfrom
Ao-chuba:feature/atomic-gaussian-params

Conversation

@Ao-chuba

Copy link
Copy Markdown
Member

2nd PR for Improvement of the robustness of poisson equation

This pull request implements a zero dependency loader load_atomic_gaussian_params(element) in src/grid/coulomb.py to retrieve pre-fitted $s$-type Gaussian parameters (coefficients and exponents) for elements H, C, N, O, and Cl from a package-safe JSON dataset (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 in MANIFEST.in has 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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json containing 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.

Comment thread MANIFEST.in Outdated
Comment thread src/grid/coulomb.py Outdated
Comment thread src/grid/tests/test_coulomb.py
Ao-chuba and others added 2 commits June 19, 2026 00:46
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are weak tests, but for now, fine

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/grid/coulomb.py Outdated

@marco-2023 marco-2023 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the comments, also check #317 for the Manifest.in structure

Comment thread MANIFEST.in Outdated
@Ao-chuba

Ao-chuba commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@marco-2023 thanks for the review, i have updated the pr as requested. please do let me know if any other is required.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 5 comments.

Comment thread src/grid/utils.py Outdated
Comment thread src/grid/tests/test_coulomb.py
Comment thread src/grid/tests/test_coulomb.py
Comment thread src/grid/tests/test_coulomb.py
Comment thread MANIFEST.in
Comment on lines 1 to +4
include README.md
include LICENSE
recursive-include grid/src/data *.npz
global-exclude *.pyc __pycache__ .DS_Store No newline at end of file
global-exclude *.pyc __pycache__ .DS_Store

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marco-2023
image

i think its suppose to be

include README.md
include LICENSE
recursive-include src/grid/data *.json *.npz
global-exclude *.pyc pycache .DS_Store

since directory is in src->grid->data . also this pr deals with new json. so need to include json too.

Ao-chuba and others added 2 commits July 8, 2026 10:05
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Ao-chuba

Ao-chuba commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

@marco-2023 I have fixed the spacing suggested ,(removal of white spaces). about the last suggestion i am confused since , depsite it seeming like a high stake issue, everything seem to work as it is .

@marco-2023 marco-2023 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is ok now.

@marco-2023

Copy link
Copy Markdown
Collaborator

@marco-2023 I have fixed the spacing suggested ,(removal of white spaces). about the last suggestion i am confused since, despite it seeming like a high-stakes issue, everything seem to work as it is .

Hi Aochuba, these suggestions are made to maintain the quality of the codebase. After you make your changes, you should lint the changed files using black: black -l 100 <file>. This will prevent this kind of issue in the future. I approved this PR. Feel free to merge it.

@Ao-chuba

Ao-chuba commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

@marco-2023 I have fixed the spacing suggested ,(removal of white spaces). about the last suggestion i am confused since, despite it seeming like a high-stakes issue, everything seem to work as it is .

Hi Aochuba, these suggestions are made to maintain the quality of the codebase. After you make your changes, you should lint the changed files using black: black -l 100 <file>. This will prevent this kind of issue in the future. I approved this PR. Feel free to merge it.

thank you for the approval @marco-2023 , Since I don't have merge access to the repo, could you please merge it.

@marco-2023 marco-2023 merged commit 11bc98d into theochem:master Jul 8, 2026
10 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.

3 participants