Skip to content

Fix psize setSmallest and read Python version from VERSION - #325

Merged
sobolevnrm merged 1 commit into
mainfrom
fix/psize-version
Oct 26, 2026
Merged

sobolevnrm merged 1 commit into
mainfrom
fix/psize-version

Conversation

@sobolevnrm

Copy link
Copy Markdown
Member

This fixes two small pre-release issues.

psize.py (#62, #290)
Psize.setSmallest() compared the nsmall list to 0, which raises TypeError on Python 3 whenever the memory ceiling forces a parallel decomposition.
It also used true division, so reduced grid dimensions became floats instead of 32k+1 integers.
This compares the reduced dimension and uses floor division.
test/test_psize.py reproduces the TypeError without the fix and checks the reduced dimensions.

Python version (#234)
apbs/_version.py hard-coded 3.4.1 separately from the VERSION file used by CMake.
It now reads VERSION when running from a source tree and falls back to installed package metadata.
setup.py reads VERSION through apbs/_version.py without importing the package, and MANIFEST.in includes VERSION in the sdist.
test/test_version.py checks that apbs.__version__ matches VERSION and covers the parser.

Validation:

  • pytest test: 226 passed, 5 skipped, 2 xfailed, 1 xpassed.
  • flake8 passes on the changed Python files.
  • The sdist contains VERSION, and a wheel built from the sdist reports Version: 3.4.1.
  • Without a source-tree VERSION, _version.py returns the installed metadata version.

Fixes #62.
Fixes #290.
Fixes #234.

psize.py compared the nsmall list to 0, raising TypeError whenever the
memory ceiling required a parallel decomposition, and used true division
so reduced grid sizes became floats. Compare the reduced dimension and
use floor division.

apbs/_version.py hard-coded the version separately from the VERSION file
used by CMake. Read VERSION when running from a source tree and fall back
to installed package metadata. Include VERSION in the sdist.

Fixes #62, #290, #234.

Co-authored-by: Copilot <[email protected]>
Copilot-Session: 3eaf20ea-3ac0-4701-958f-28527bf641fc
@sobolevnrm
sobolevnrm merged commit 9c08442 into main Oct 26, 2026
16 checks passed
@sobolevnrm
sobolevnrm deleted the fix/psize-version branch October 26, 2026 02:10
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.

Share tool permabug Python package version to update from VERSION python2->3 bug in psize.py

1 participant