Skip to content

Modernize pysampling: pyclawd toolkit, src/ layout, pytest, numpy-2 fixes, new docs#1

Closed
blankjul wants to merge 1 commit into
masterfrom
modernize-pysampling
Closed

Modernize pysampling: pyclawd toolkit, src/ layout, pytest, numpy-2 fixes, new docs#1
blankjul wants to merge 1 commit into
masterfrom
modernize-pysampling

Conversation

@blankjul

Copy link
Copy Markdown
Collaborator

Modernizes the repo and adopts the pyclawd dev toolkit. pyclawd check (format-check, lint, typecheck, tests) and pyclawd docs build are both green.

Packaging & layout

  • src/pysampling/ layout; version single-sourced in __init__.py
  • pyproject.toml (hatchling) replaces setup.py / MANIFEST.in / Makefile; bundles the Sobol .dat resources, declares the numpy dep and a matplotlib [plot] extra
  • .python-version, py.typed

Tooling

  • Adopt pyclawd via .pyclawd/config.py (test / lint / typecheck / docs)
  • GitHub Actions (lint, typecheck, test matrix 3.10–3.13) replaces Travis
  • ruff + mypy configured; docs/ excluded from the lib's quality gate

Bug fixes (was broken on numpy 2.x)

  • sobol.py: np.intnp.int64 (import-breaking on numpy ≥2), invalid regex escape "\s"r"\s"
  • util.cdist: removed unreachable duplicate branches + an undefined return
  • sample() raises ValueError (not bare Exception) for unknown algorithms

Tests

  • Converted from bespoke unittest runners to pytest
  • Discrepancy measures are now cross-checked against loop reference implementations as well as known constants

Docs

  • Rewrote the ancient single-index.ipynb setup as a cached Sphinx pipeline driven by pyclawd docs (MyST sources → jupyter-cache → nbsphinx)
  • Single page mirroring the original site (Installation / Usage / Features with a plot per algorithm / Contact), same sphinx_book_theme
  • README in Markdown

🤖 Generated with Claude Code

…ixes, new docs

- Move package to src/pysampling; single-source version in __init__.py
- Replace setup.py/MANIFEST.in/Makefile with hatchling pyproject.toml
  (bundles the Sobol .dat resources; numpy dep; matplotlib [plot] extra)
- Adopt pyclawd (.pyclawd/config.py) for test/lint/typecheck/docs
- Replace Travis with GitHub Actions (lint, typecheck, 3.10-3.13 matrix)
- Convert tests to pytest; cross-check vectorized measures against loop refs
- Fix numpy 2.x breakage in sobol.py (np.int -> np.int64), an invalid regex
  escape, and dead code in util.cdist; raise ValueError for unknown algorithms
- Rewrite docs as a cached Sphinx pipeline driven by 'pyclawd docs'
  (MyST sources -> jupyter-cache -> nbsphinx); README in Markdown
@blankjul

Copy link
Copy Markdown
Collaborator Author

Landed directly on master (9e4aa8e); no PR needed for own repo.

@blankjul blankjul closed this Jun 23, 2026
@blankjul blankjul deleted the modernize-pysampling branch June 23, 2026 15:09
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.

1 participant