Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
c5a4ce1
Create validate_binaries.sh
elizabethteng Dec 18, 2025
b692409
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2025
27d3195
Create dummy file baseline.h5
elizabethteng Dec 18, 2025
b90303f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2025
6d42534
outline script
elizabethteng Dec 18, 2025
b689460
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2025
b662a75
Modify evolve_binaries.sh for saved output and logs in folder outputs
elizabethteng Dec 18, 2025
2aed377
Modify evolve_binary for HDF5 output and error handling
elizabethteng Dec 18, 2025
493af0f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2025
91c3d5f
Update 1Zsun_binaries_suite.py to fix args in function calls
elizabethteng Dec 18, 2025
8239290
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2025
1a01213
Update authors
elizabethteng Dec 18, 2025
e967e01
remove alarm calls that were never set
elizabethteng Dec 18, 2025
e5c07ce
Enhance evolve_binaries.sh for better logging and error handling
elizabethteng Dec 18, 2025
1a82ac8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2025
5525ea8
Fix argument passing for evolve_binaries function
elizabethteng Dec 18, 2025
138d804
fill in all code for validate_binaries.sh
elizabethteng Dec 18, 2025
12a528e
starting point of compare_runs.py for comparing two h5 files
elizabethteng Dec 18, 2025
9140a20
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2025
b7f6f02
Add conda source detection in evolve_binaries.sh
elizabethteng Jan 9, 2026
cd618fd
Add h5py import to 1Zsun_binaries_suite.py
elizabethteng Jan 9, 2026
17b7013
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 9, 2026
8cd3f6d
Modify usage comment in evolve_binaries.sh
elizabethteng Jan 9, 2026
cd19659
refactor binary validation suite: multi metallicity support, bug fixe…
elizabethteng Feb 26, 2026
396e94b
gitignore
elizabethteng Feb 26, 2026
c769b5e
Merge branch 'et-validation' of https://github.com/POSYDON-code/POSYD…
elizabethteng Feb 26, 2026
1f260a8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 26, 2026
200431a
adding baseline h5 file for binary evolution
elizabethteng Mar 9, 2026
48b3ce9
add tolerances as CLI
elizabethteng Mar 9, 2026
40a8d1d
Merge branch 'et-validation' of https://github.com/POSYDON-code/POSYD…
elizabethteng Mar 9, 2026
9d1d0fc
separate handling of errored binaries from successful binaries into a…
elizabethteng Mar 9, 2026
d71b0ad
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 9, 2026
9f72e66
consolidate h5 writes for efficiency
elizabethteng Mar 9, 2026
ece8b83
Merge branch 'et-validation' of https://github.com/POSYDON-code/POSYD…
elizabethteng Mar 9, 2026
3a3cd77
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 9, 2026
1efad00
add flag to promote existing evolved branch to baseline status
elizabethteng Mar 9, 2026
236ce45
Merge branch 'et-validation' of https://github.com/POSYDON-code/POSYD…
elizabethteng Mar 9, 2026
d3d578b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 9, 2026
7c553cd
Move binaries_suite.py and binaries_params.ini to dev-tools root
elizabethteng Mar 9, 2026
caae800
Merge branch 'et-validation' of https://github.com/POSYDON-code/POSYD…
elizabethteng Mar 9, 2026
d51fbe4
Delete dev-tools/outputs/baseline.h5
elizabethteng Mar 9, 2026
6301581
add readme
elizabethteng Mar 9, 2026
22102ea
Update README.md
elizabethteng Mar 9, 2026
d0eaf91
Update README.md
elizabethteng Mar 9, 2026
4c96435
Create validate_binaries.sh
elizabethteng Dec 18, 2025
73e1465
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2025
ebc2c86
Create dummy file baseline.h5
elizabethteng Dec 18, 2025
e416fc8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2025
47a0d37
outline script
elizabethteng Dec 18, 2025
ed95ed7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2025
578cd4c
Modify evolve_binaries.sh for saved output and logs in folder outputs
elizabethteng Dec 18, 2025
e4908e0
Modify evolve_binary for HDF5 output and error handling
elizabethteng Dec 18, 2025
dc65854
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2025
8a0d5ba
Update 1Zsun_binaries_suite.py to fix args in function calls
elizabethteng Dec 18, 2025
9da430d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2025
7a3bd52
Update authors
elizabethteng Dec 18, 2025
02d10a2
remove alarm calls that were never set
elizabethteng Dec 18, 2025
5cbf4ba
Enhance evolve_binaries.sh for better logging and error handling
elizabethteng Dec 18, 2025
621be97
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2025
c3256b5
Fix argument passing for evolve_binaries function
elizabethteng Dec 18, 2025
e4dedbe
fill in all code for validate_binaries.sh
elizabethteng Dec 18, 2025
d66cf6e
starting point of compare_runs.py for comparing two h5 files
elizabethteng Dec 18, 2025
46cdc5a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Dec 18, 2025
b89ff37
Add conda source detection in evolve_binaries.sh
elizabethteng Jan 9, 2026
1529d76
Add h5py import to 1Zsun_binaries_suite.py
elizabethteng Jan 9, 2026
7cb3922
refactor binary validation suite: multi metallicity support, bug fixe…
elizabethteng Feb 26, 2026
06abf4b
gitignore
elizabethteng Feb 26, 2026
d80800b
adding baseline h5 file for binary evolution
elizabethteng Mar 9, 2026
4fadb6f
add tolerances as CLI
elizabethteng Mar 9, 2026
d3d29c5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 26, 2026
57e13ed
separate handling of errored binaries from successful binaries into a…
elizabethteng Mar 9, 2026
ea43593
consolidate h5 writes for efficiency
elizabethteng Mar 9, 2026
f080770
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 9, 2026
435013f
add flag to promote existing evolved branch to baseline status
elizabethteng Mar 9, 2026
6474dea
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 9, 2026
e157c01
Move binaries_suite.py and binaries_params.ini to dev-tools root
elizabethteng Mar 9, 2026
5357e0b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 9, 2026
545db6c
Delete dev-tools/outputs/baseline.h5
elizabethteng Mar 9, 2026
17b9839
add readme
elizabethteng Mar 9, 2026
2ee28f9
Update README.md
elizabethteng Mar 9, 2026
74ae017
Update README.md
elizabethteng Mar 9, 2026
a254306
minor change
elizabethteng Mar 9, 2026
d8e6138
minor change
elizabethteng Mar 9, 2026
c9b265c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 9, 2026
d95c17a
remove rebase artifacts
elizabethteng Mar 9, 2026
108e34c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 9, 2026
fffba17
bug fix
elizabethteng Mar 9, 2026
421274e
Merge branch 'et-validation' of https://github.com/POSYDON-code/POSYD…
elizabethteng Mar 9, 2026
0331232
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 9, 2026
fe10943
Update validate_binaries.sh to add guidance about tolerances
elizabethteng Mar 11, 2026
a4fa52c
Update README.md to add guidance about tolerances
elizabethteng Mar 11, 2026
e6ae3c2
Update README.md
elizabethteng Mar 11, 2026
28e6af9
Update binaries_suite.py to save path_to_posydon_data in the H5 metadata
elizabethteng Mar 19, 2026
0bab574
Update generate_baseline.sh to save PATH_TO_POSYDON_DATA to baseline_…
elizabethteng Mar 19, 2026
b1f5166
Update binaries_suite.py to check how many binaries ran and save to m…
elizabethteng Mar 19, 2026
f2e9361
Update generate_baseline.sh to check if any binaries didn't run
elizabethteng Mar 19, 2026
5c505c8
Update compare_runs.py to eliminate redundancies in report (missing b…
elizabethteng Mar 19, 2026
b47dd21
Merge remote-tracking branch 'origin/v2.3' into et-validation
elizabethteng Mar 19, 2026
64be558
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 19, 2026
d0555a4
added more descriptive errors to evolve_binaries
elizabethteng Mar 19, 2026
7d3290f
Merge branch 'et-validation' of https://github.com/POSYDON-code/POSYD…
elizabethteng Mar 19, 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
5 changes: 5 additions & 0 deletions dev-tools/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
workdirs/
outputs/
logs/
baselines/
test_*.h5
130 changes: 130 additions & 0 deletions dev-tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
Validation suite for POSYDON binary evolution. Evolves a fixed set of test binaries on a candidate branch and compares results against a stored baseline to catch regressions.

## Quick Start

```bash
# 1. Generate a baseline from the main branch (once)
./generate_baseline.sh main

# 2. Validate a candidate branch against that baseline
./validate_binaries.sh feature/my-branch
```

Results are written to `outputs/<branch>/`. After validation, check:

- `outputs/<branch>/comparison_summary.txt` for a pass/fail overview across all metallicities
- `outputs/<branch>/comparison_<Z>Zsun.txt` for detailed per-metallicity diff reports
- `logs/<branch>/evolve_<Z>Zsun.log` for the full evolution output of each metallicity

By default, all eight POSYDON metallicities are run. To validate only a subset, pass a quoted space-separated list as the third argument:

```bash
./generate_baseline.sh main "" "1 0.45"
./validate_binaries.sh feature/my-branch main "1 0.45"
```

## Scripts

### `validate_binaries.sh`

Top-level entry point. Evolves test binaries on a candidate branch, then compares results against an existing baseline.

```bash
./validate_binaries.sh <candidate_branch> [baseline_branch] [metallicities] [--loose] [--rtol VALUE] [--atol VALUE]
```

By default, comparison is exact (rtol=0, atol=0). Use `--loose` for relaxed floating-point tolerances (rtol=1e-12, atol=1e-15), or set `--rtol`/`--atol` explicitly as per [np.allclose](https://numpy.org/devdocs/reference/generated/numpy.allclose.html).

### `generate_baseline.sh`

Generates baseline HDF5 files from a designated branch or tag. Can also promote existing outputs to baseline with `--promote`.

```bash
./generate_baseline.sh <branch> [sha] [metallicities]
./generate_baseline.sh --promote <branch> [metallicities]
```

### `evolve_binaries.sh`

Clones a POSYDON branch, creates a conda environment, installs POSYDON, and runs the binary suite at all requested metallicities. Called by `validate_binaries.sh` and `generate_baseline.sh`; can also be run standalone.

```bash
./evolve_binaries.sh <branch> [sha] [metallicities]
```

### `binaries_suite.py`

Defines and evolves the set of 44 test binaries at a given metallicity. Each binary targets a specific edge case or past bug fix (e.g., matching failures, oRLO2 looping, SN type errors, NaN spins). Results are saved to an HDF5 file.

```bash
python binaries_suite.py --output results.h5 --metallicity 1
```

### `compare_runs.py`

Compares two HDF5 files produced by `binaries_suite.py` and reports differences in three categories:

- **Structural**: missing or extra binaries, evolution step count changes, binaries that newly fail or newly pass, missing HDF5 tables.
- **Qualitative**: changes to categorical columns such as state, event, step name, SN type, interpolation class, and mass transfer history.
- **Quantitative**: changes to any numeric column. By default, comparison is exact (bitwise identical floats). Use `--loose` for slightly relaxed tolerances (rtol=1e-12, atol=1e-15), or set `--rtol`/`--atol` explicitly as per [np.allclose](https://numpy.org/devdocs/reference/generated/numpy.allclose.html).

The script also compares warning and error tables, reporting new, removed, or changed warnings per binary.

```bash
python compare_runs.py baseline.h5 candidate.h5 [--loose] [--rtol VALUE] [--atol VALUE] [--verbose]
```

### `binaries_params.ini`

Configuration file for `SimulationProperties`. Defines the POSYDON evolution steps, supernova prescriptions, common envelope parameters, and output column selections. Metallicity is overridden at runtime by `binaries_suite.py`.

## Running Scripts Manually

The shell scripts handle cloning, environment setup, and orchestration. If you already have POSYDON installed in your current environment, you can run the Python scripts directly.

### Evolving binaries

```bash
# Evolve all 44 test binaries at solar metallicity
python binaries_suite.py --output my_results.h5 --metallicity 1

# Evolve at a specific metallicity with verbose output
python binaries_suite.py --output my_results.h5 --metallicity 0.01 --verbose

# Use a custom ini file
python binaries_suite.py --output my_results.h5 --metallicity 1 --ini /path/to/custom.ini
```

The output HDF5 contains three tables: `evolution` (per-step binary data), `errors` (binaries that failed), and `warnings` (warnings raised during evolution).

### Comparing two result files

```bash
# Exact comparison
python compare_runs.py file_a.h5 file_b.h5

# Relaxed tolerances
python compare_runs.py file_a.h5 file_b.h5 --loose

# Custom tolerances with verbose diagnostics
python compare_runs.py file_a.h5 file_b.h5 --rtol 1e-8 --atol 1e-12 --verbose
```

The two files do not need to come from the shell pipeline; any pair of HDF5 files produced by `binaries_suite.py` can be compared.

## Directory Structure

```
dev-tools/
├── README.md
├── validate_binaries.sh # full validation pipeline
├── generate_baseline.sh # create or promote baselines
├── evolve_binaries.sh # clone, install, and run suite
├── binaries_suite.py # test binary definitions and evolution
├── binaries_params.ini # SimulationProperties configuration
├── compare_runs.py # diff two HDF5 result files
├── baselines/ # stored baseline HDF5 files (per branch)
├── outputs/ # candidate evolution results (per branch)
├── logs/ # per-metallicity evolution logs (per branch)
└── workdirs/ # cloned repos and conda environments (per branch)
```
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# POSYDON default BinaryPopulation inifile, use ConfigParser syntax
# This ini is used ONLY for SimulationProperties configuration.
# Metallicity is overridden at runtime by binaries_suite.py.

[environment_variables]
PATH_TO_POSYDON = '<PATH_TO_POSYDON>'
Expand Down
Loading
Loading