Add PADS generation script and config#136
Conversation
Adds create_pads.py to reconstruct charge density grids from atomic radial profiles using a Numba-accelerated kernel, and config_pads.yaml to src/electrai/configs/. Also adds numba as a project dependency. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
zarr v3 raises an error when chunks=False is passed to root.create(). Resolve falsy chunks to the full array shape (single chunk) instead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@claude review this PR |
|
Claude finished @hanaol's task in 1m 34s —— View job PR Review: Add PADS generation script and config
The implementation is generally clean and the Numba-accelerated kernel is well-structured. A few issues to address before merging: Potential Bug:
|
Resolved conflicts: - src/electrai/zarr_conversion/zarr_writer.py: took main's version of the chunks-fallback fix (semantically equivalent to ours) - uv.lock: regenerated via 'uv lock' against merged pyproject.toml, adding numba 0.65.1 + llvmlite 0.47.0 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirrors the empty __init__.py in zarr_conversion/ so the package structure is consistent. Addresses PR #136 review feedback. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@claude re-review |
|
Claude finished @forklady42's task in 1m 32s —— View job PR Re-Review: Add PADS generation script and config
Compared to the previous review, here's the current status of each item: Addressed since last review
Still outstandingBug:
|
| Issue | Status |
|---|---|
nmax oblique lattice bug |
Still present |
site.specie deprecation |
Still present |
| Config absolute paths | Still present |
chunks=False type inconsistency |
New (introduced by zarr_writer change) |
__init__.py missing |
Fixed |
write_diff docstring default |
Fixed |
| Uniform spacing comment | Fixed (via main() comment) |
| No tests | Still absent |
The oblique-lattice nmax bug is the only correctness issue; the rest are code quality concerns.
write_chgcar_to_zarr declares chunks: tuple[int, int, int] | None, so passing False was a type mismatch even though it worked at runtime. Addresses PR #136 review feedback. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@hanaol I addressed the merge conflicts and most of the code quality concerns. What are your thoughts on Claude's |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@forklady42 I benchmarked the proposed code (based on |
Summary
This PR implements the generation of precomputed atomic density superposition (PADS) inputs for the model. This serves as an alternative to the SAD approach used in VASP and avoids the need to run or invoke VASP during the workflow.
src/electrai/pads_generation/create_pads.py: reconstructs charge density grids from atomic radial profiles using a Numba-accelerated parallel kernelsrc/electrai/configs/config_pads.yaml: config file for the PADS generation pipelinenumbaas a project dependencyThis is also relevant to #96.