1. pytest-timeout (30s, thread-based) added to pyproject.toml
- Prevents hangs in CI
- timeout_method='thread' for clean cancellation
2. hypothesis added for property-based edge case discovery
- tests/common/test_hypothesis_tests.py: 5 tests
- Fermi: random Z, A, W — checks stability, monotonicity
- Phase space: random W0, W — checks threshold/endpoint properties
- Hypothesis already found real bugs:
* Fermi monotonicity fails for Z < 10 (expected — finite-size dominates)
* Phase space negative when W > W0 (test constrains W < W0)
3. pytest.mark.requires_ensdf marker added to TestPaceENSDFIntegration
- Replaces bare @pytest.mark.skipif with documented marker
- Allows running only ENSDF tests: pytest -m requires_ensdf
4. Updated test-migration-todo.md: Phase 5 complete
Final state: 256 tests passing (250 regular + 6 hypothesis + 6 skipped ENSDF)
71 lines
1.5 KiB
TOML
71 lines
1.5 KiB
TOML
[build-system]
|
|
requires = ["setuptools>=61.0"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "beta-spectrum"
|
|
version = "0.3.0"
|
|
description = "High-precision beta spectrum calculation for nuclear physics"
|
|
authors = [
|
|
{ name = "Evgeniy Unzhakov" }
|
|
]
|
|
requires-python = ">=3.10"
|
|
|
|
dependencies = [
|
|
"numpy",
|
|
"scipy",
|
|
"matplotlib",
|
|
"pandas"
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
ensdf = ["paceENSDF"]
|
|
dev = [
|
|
"pytest",
|
|
"nbmake",
|
|
"black",
|
|
"ruff",
|
|
"mypy",
|
|
"mdformat",
|
|
"mdformat-frontmatter",
|
|
"mdformat-footnote",
|
|
"mdformat-tables"
|
|
]
|
|
|
|
[project.scripts]
|
|
bs_pnpi = "beta_spectrum.cli:main"
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["."]
|
|
|
|
[tool.mypy]
|
|
python_version = "3.10"
|
|
strict = true
|
|
exclude = ["notebooks", "scripts/notebook_plots.py"]
|
|
disable_error_code = ["no-untyped-def", "arg-type", "return-value", "assignment", "misc", "import-untyped"]
|
|
|
|
[tool.black]
|
|
line-length = 88
|
|
|
|
[tool.pytest.ini_options]
|
|
testpaths = ["tests", "notebooks"]
|
|
markers = [
|
|
"property: Physics property tests (positivity, monotonicity, limits)",
|
|
"physics: Physics behavior tests (energy dependence, Z dependence)",
|
|
"api: API contract tests (signatures, return types, error handling)",
|
|
"quality: Code quality tests (shape, type, NaN, stability)",
|
|
"integration: Full pipeline integration tests",
|
|
"slow: Tests that take >1s to run",
|
|
"requires_ensdf: Tests requiring paceENSDF package",
|
|
]
|
|
timeout = 30
|
|
timeout_method = "thread"
|
|
|
|
[tool.ruff]
|
|
line-length = 88
|
|
|
|
[tool.mdformat]
|
|
line-length = 88
|
|
wrap = false
|
|
number = true
|