End-to-end pure-Python FF-HEDM workflow orchestrator (1-N detectors)
Project description
midas-ff-pipeline
End-to-end pure-Python FF-HEDM workflow. Drives all the
midas-* sibling packages so a single command — or a single
notebook — takes raw detector zarr inputs through to Grains.csv
with no C binaries on the path.
Status: 0.2.x — dataset-density-aware GPU group_size resolver
and multi-process CPU sharding (--cpu-shards) for the indexer stage;
real-data shakedown on Park22 + Ti-7Al. Single-detector path is fully
exercised; 1-N multi-detector pinwheel layout is supported via the
existing midas_diffract.HEDMForwardModel(multi_mode="panel")
backend. For the unified PF + FF orchestrator see
midas-pipeline — midas-ff-pipeline and
midas-pipeline run --scan-mode ff invoke the same kernels.
What it does
For each FF-HEDM layer:
| Stage | Sibling package |
|---|---|
| HKL list generation | midas-hkls |
| Peak finding (per detector) | midas-peakfit (peakfit_torch) |
| Overlap merge | midas-peakfit (midas-merge-peaks) |
| Calc radius | midas-peakfit (midas-calc-radius) |
| Detector transforms | midas-transforms (midas-fit-setup) |
| Cross-detector merge | midas-ff-pipeline (this package) |
| Binning | midas-transforms (midas-bin-data) |
| Indexing | midas-index |
| Grain refinement | midas-fit-grain |
| Grain consolidation + strain | midas-process-grains |
The cross-detector merge is the only piece this package implements
itself. It concatenates per-detector spot lists and emits a side-car
Spots_det.bin mapping each obs spot to its source detector
(det_id), keeping the main Spots.bin byte-compatible with the
C IndexerOMP so any cross-pipeline parity test still works.
Quick start
CLI
midas-ff-pipeline run \
--params /path/to/Parameters.txt \
--result /path/to/run_dir \
--layers 1-1 \
--device cuda --dtype float64
Library API
from midas_ff_pipeline import Pipeline, PipelineConfig
pipe = Pipeline(
config=PipelineConfig(
result_dir="/path/to/run_dir",
params_file="/path/to/Parameters.txt",
n_cpus=16,
device="cuda",
dtype="float64",
),
)
pipe.run()
print(pipe.layer_result.n_grains)
Notebook
See notebooks/01_smoke_walkthrough.ipynb for the simplest
end-to-end demo (synthetic 50-grain Au, single detector).
02_stage_diagnostics.ipynb adds per-stage plots between cells.
03_multi_detector_demo.ipynb runs the four-detector pinwheel
layout against a synthetic ground truth.
These notebooks are not shipped with pip install — get them by
cloning the MIDAS repository <https://github.com/marinerhemant/MIDAS/tree/master/packages/midas_ff_pipeline/notebooks>_.
Multi-detector
from midas_ff_pipeline import Pipeline, PipelineConfig, DetectorConfig
detectors = DetectorConfig.load_many("detectors.json")
pipe = Pipeline(
config=PipelineConfig(
result_dir="/path/to/multi_det_run",
params_file="/path/to/Parameters_4det.txt",
n_cpus=16, device="cuda", dtype="float64",
),
detectors=detectors,
)
pipe.run()
detectors.json:
[
{"det_id": 1, "zarr_path": "det1.MIDAS.zip", "lsd": 1000000.0,
"y_bc": 1024.0, "z_bc": 1024.0, "tx": 0.0, "ty": 0.0, "tz": 0.0,
"p_distortion": [0,0,0,0,0,0,0,0,0,0,0]},
{"det_id": 2, "zarr_path": "det2.MIDAS.zip", "lsd": 1005000.0, ...},
{"det_id": 3, "zarr_path": "det3.MIDAS.zip", "lsd": 1010000.0, ...},
{"det_id": 4, "zarr_path": "det4.MIDAS.zip", "lsd": 1015000.0, ...}
]
If detectors.json is absent the pipeline falls back to
DetParams 1/DetParams 2/... rows in Parameters.txt
(same convention as FitMultipleGrains.c).
Resume
Each layer's directory holds a midas_state.h5 provenance ledger.
--resume auto skips stages whose recorded input/output hashes
match the current files. --resume from:indexing deletes the
indexing-stage outputs and resumes from there. midas-ff-pipeline status
prints the per-stage state for a given run dir.
Relationship to ff_MIDAS.py
FF_HEDM/workflows/ff_MIDAS.py is the historical workflow that
shells out to a mix of C binaries and torch tools. midas-ff-pipeline
is its pure-Python successor: same stages, no C binaries, multi-detector
aware out of the box. ff_MIDAS.py is left untouched for users still
on the mixed path.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file midas_ff_pipeline-0.3.2.tar.gz.
File metadata
- Download URL: midas_ff_pipeline-0.3.2.tar.gz
- Upload date:
- Size: 77.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d74c3a63be58f4a923b500d1f759d02a929eab286fcba9820e1e8d839317a93d
|
|
| MD5 |
92485cbbafb04af3c43d7554121d3fd4
|
|
| BLAKE2b-256 |
f134fb5def6e6cbb7760b8a3deb06f528ae978c4d2964b230e9c16a53bfa4fc6
|
Provenance
The following attestation bundles were made for midas_ff_pipeline-0.3.2.tar.gz:
Publisher:
python-packages.yml on marinerhemant/MIDAS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
midas_ff_pipeline-0.3.2.tar.gz -
Subject digest:
d74c3a63be58f4a923b500d1f759d02a929eab286fcba9820e1e8d839317a93d - Sigstore transparency entry: 1591815081
- Sigstore integration time:
-
Permalink:
marinerhemant/MIDAS@2b21a5e96d9f040b6920c22afaa6d366f784f62f -
Branch / Tag:
refs/tags/midas-ff-pipeline-v0.3.2 - Owner: https://github.com/marinerhemant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-packages.yml@2b21a5e96d9f040b6920c22afaa6d366f784f62f -
Trigger Event:
release
-
Statement type:
File details
Details for the file midas_ff_pipeline-0.3.2-py3-none-any.whl.
File metadata
- Download URL: midas_ff_pipeline-0.3.2-py3-none-any.whl
- Upload date:
- Size: 83.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f29d740810fe958defa7573dfe89a3091b07451eb93b4e93f968ad6fa473f284
|
|
| MD5 |
bb4ebe3b8d39bae344ef8473023ba0c0
|
|
| BLAKE2b-256 |
480a948c79b3b871ad491841441f1ce43db5f2dd14117328622ac825c12715f1
|
Provenance
The following attestation bundles were made for midas_ff_pipeline-0.3.2-py3-none-any.whl:
Publisher:
python-packages.yml on marinerhemant/MIDAS
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
midas_ff_pipeline-0.3.2-py3-none-any.whl -
Subject digest:
f29d740810fe958defa7573dfe89a3091b07451eb93b4e93f968ad6fa473f284 - Sigstore transparency entry: 1591815108
- Sigstore integration time:
-
Permalink:
marinerhemant/MIDAS@2b21a5e96d9f040b6920c22afaa6d366f784f62f -
Branch / Tag:
refs/tags/midas-ff-pipeline-v0.3.2 - Owner: https://github.com/marinerhemant
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-packages.yml@2b21a5e96d9f040b6920c22afaa6d366f784f62f -
Trigger Event:
release
-
Statement type: