Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
9e53c74
Add Rust parser crate with Python bindings and parity harness
claude Aug 8, 2026
566bb10
Port MF1 and make the parity harness scale to the whole package
claude Aug 8, 2026
c0491e9
Port MF2 resonance parameters
claude Aug 8, 2026
7d943cf
Port MF4, MF5 and MF6 distributions
claude Aug 8, 2026
c210fe9
Port MF7, MF8, MF9 and MF10
claude Aug 8, 2026
7583e35
Port fission_energy from local-develop
claude Aug 8, 2026
ccc4a6c
Apply ruff format to the golden dumper
claude Aug 8, 2026
742dbc9
Port the photon and atomic files: MF12-15, 23, 26, 27 and 28
claude Aug 8, 2026
b4496ed
Port the covariance files: MF33, MF34 and MF40
claude Aug 8, 2026
4080849
Add five fixtures, closing eight of the ten unverified parsers
claude Aug 8, 2026
5a7a5a9
Port data.py: element tables, constants and sum rules
claude Aug 8, 2026
a27d8aa
Port ace.py: reading ACE cross section tables
claude Aug 8, 2026
dcb799b
Bring the golden README's checklists in line with the fixtures
claude Aug 8, 2026
2758d69
Port urr.py: unresolved resonance probability tables
claude Aug 8, 2026
04aa87b
Port univariate.py: the distribution primitives
claude Aug 8, 2026
5ec1816
Port the interpreted angular distribution, from ENDF and from ACE
claude Aug 8, 2026
e17674e
Port angle_energy.py and the ACE side of mf5.py
claude Aug 8, 2026
3068990
Port product.py and radionuclide_production.py, and add decay fixtures
claude Aug 8, 2026
e92319c
Port the ENDF side of reaction.py
claude Aug 8, 2026
06a0b48
Port the ACE side of reaction.py
claude Aug 8, 2026
3bd1d9e
Port incident_neutron.py
claude Aug 8, 2026
8547036
Store the fixtures and the golden dumps xz-compressed
claude Aug 8, 2026
da88bc4
Port decay.py
claude Aug 9, 2026
8f82882
Port incident_photon.py
claude Aug 9, 2026
8511b18
Port chain.py and the nuclide type it builds on
claude Aug 9, 2026
a4fe1da
Port njoy.py, and finish chain with validate
claude Aug 9, 2026
84470fe
Treat a zero half-life as unevaluated rather than instant decay
claude Aug 9, 2026
b6d9e21
Build out the Python bindings, and add CI for the Rust side
claude Aug 9, 2026
054141e
Pin the denormal ACE float on the Rust side too
claude Aug 9, 2026
fdc4eee
Give the extension section_data, the dict API it was missing
claude Aug 9, 2026
8bb1ed8
Project the covariance files through section_data too
claude Aug 9, 2026
8cbeb53
Project MF 1 MT458, 6, 7 and 26 through section_data
claude Aug 9, 2026
16855a0
Close the last two section_data gaps, MF 2 and MF 8 MT=457
claude Aug 9, 2026
1c6ec3e
Add interpret, and the free functions and tables the module was missing
claude Aug 9, 2026
1da3a03
Expose the radionuclide production and isomer-table helpers
claude Aug 9, 2026
e0a5865
Cover the fission product yields, with a fixture built for them
claude Aug 9, 2026
771a6c7
Fix the two CI jobs that have been failing since they were added
claude Aug 9, 2026
caa4d1c
Cover MF2 Breit-Wigner, MF5 LF=12, MF6 LANG=2/LAW=6 and MF13
claude Aug 9, 2026
ad7e368
Prepare the crate to be consumed as a dependency
claude Aug 9, 2026
3c656c4
Ship type stubs for the extension module
claude Aug 9, 2026
ad0fca1
Fix five parser bugs in both readers, with tests
claude Aug 9, 2026
6e3992e
Read the auxiliary photon data, with a not-a-knot cubic spline
claude Aug 9, 2026
daddb73
Source the Compton profiles from Geant4 rather than from a copy
claude Aug 9, 2026
8f42576
One file per tabulation, named for its source
shimwell Aug 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 126 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Rust

on:
workflow_dispatch:

pull_request:
branches:
- main
- local-develop
push:
branches:
- main
- local-develop

jobs:
crate:
name: Crate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2

- name: Format
run: cargo fmt --all --check

- name: Clippy
run: cargo clippy --all-targets -- -D warnings

# Debug and release both, because the parity tests compare floating
# point and the two profiles have caught different things.
- name: Test
run: |
cargo test
cargo test --release

# The crate declares rust-version = "1.74" and consumers will believe it.
# Nothing else here checks it: the other jobs run stable, which happily
# accepts APIs stabilised years later. The library only — dev-dependencies
# are free to need a newer compiler, since they reach nobody downstream.
msrv:
name: MSRV
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: dtolnay/rust-toolchain@1.74

- uses: Swatinem/rust-cache@v2

- name: Build on the declared minimum
run: cargo build -p endf

goldens:
name: Goldens reproduce
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: actions/setup-python@v6
with:
python-version: "3.12"

- name: Install
run: python -m pip install .[test]

# The golden files are what holds the Rust reader to the Python one, so
# a change that quietly rewrites them would defeat the whole harness.
#
# `--check` compares the dump text rather than the compressed bytes and
# prints the offending lines. Comparing bytes would fail on any machine
# whose liblzma is not the one that wrote the file, which says nothing
# about the reader.
- name: Check for drift
run: |
python tools/dump_golden.py --check
python tools/dump_chain_golden.py --check

bindings:
name: Python bindings
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.13"]
steps:
- uses: actions/checkout@v6

- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- name: Install
run: |
python -m pip install -U pip
python -m pip install .[test] maturin

# An abi3 wheel, so one build serves every supported Python.
- name: Build the extension module
run: maturin build --release -m crates/endf-py/Cargo.toml -o dist

- name: Install the extension module
run: python -m pip install --no-index --find-links dist endf-py

# The bindings' tests compare the extension against the pure-Python
# reader on the same fixtures, so they only mean anything once it is
# installed. Fail rather than skip if the import did not take.
- name: Test
run: |
python -c "import _endf"
python -m pytest -ra tests/test_rust_bindings.py tests/test_rust_stub.py

# The stub is only worth shipping if a type checker can use it. This
# fails on a stub that is present but wrong, which the name comparison
# in test_rust_stub.py cannot see.
- name: Type-check against the stub
run: |
python -m pip install mypy
python -m mypy --strict crates/endf-py/typecheck.py
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ doc/build/
*.so
generated/
wheelhouse/

# Rust
/target
220 changes: 220 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[workspace]
resolver = "2"
members = ["crates/endf", "crates/endf-py"]

[workspace.package]
version = "0.1.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/paulromano/endf-python"
rust-version = "1.74"

[profile.release]
lto = true
codegen-units = 1
Empty file added ace
Empty file.
Loading