Skip to main content

Pure-Python/PyTorch FF-HEDM indexer (drop-in replacement for IndexerOMP/IndexerGPU)

Project description

midas-index

Pure-Python/PyTorch FF-HEDM indexer. Drop-in replacement for IndexerOMP / IndexerGPU from MIDAS, with seamless CPU / CUDA / MPS device switching.

Status: v0.4.x — production. Bit-identical to C IndexerOMP on the 500/500 seed FF parity gate, plus the new scanning indexer that matches C IndexerScanningOMP on the 1-voxel PF parity gate. Auto dense ↔ jagged compare_spots strategy picker (see midas_index.compute.matching.pick_compare_strategy) keeps GPU runs inside the available memory budget without OOM. Detailed design doc lives in dev/implementation_plan.md (gitignored).

Install

pip install midas-index

For local development:

cd packages/midas_index
pip install -e .[dev]

Quick start

# CLI — drop-in for IndexerOMP / IndexerGPU
midas-index paramstest.txt 0 1 1000 8

# Pin device / dtype via env vars (auto-detect: CUDA -> MPS -> CPU)
MIDAS_INDEX_DEVICE=cuda MIDAS_INDEX_DTYPE=float32 \
    midas-index paramstest.txt 0 1 1000 8

Library API:

from midas_index import Indexer

result = Indexer.from_param_file("paramstest.txt", device="cuda").run(
    block_nr=0, n_blocks=1, n_spots_to_index=1000,
)

Drive from ff_MIDAS.py

Pass -useTorchIndexer 1 to switch the indexing stage from C IndexerOMP / IndexerGPU to this package:

python ff_MIDAS.py -paramFN paramstest.txt  -useTorchIndexer 1

Architecture

midas-index is a thin orchestration layer. Heavy lifting is delegated to:

  • midas-diffract — forward simulation (HKL -> theoretical spots).
  • midas-stress — orientation conversions, symmetry, fundamental zone.

This package itself owns: seed enumeration, orientation / position grid layout, binned matching, scoring, I/O, and the CLI / library API.

Benchmark

A bundled benchmark drives the full per-seed pipeline end-to-end:

python -m midas_index.benchmarks.bench_seed --n-grains 5 --n-iter 3

License

BSD-3-Clause. Part of MIDAS.

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

midas_index-0.4.1.tar.gz (97.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

midas_index-0.4.1-py3-none-any.whl (75.9 kB view details)

Uploaded Python 3

File details

Details for the file midas_index-0.4.1.tar.gz.

File metadata

  • Download URL: midas_index-0.4.1.tar.gz
  • Upload date:
  • Size: 97.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for midas_index-0.4.1.tar.gz
Algorithm Hash digest
SHA256 97148f9722595fe6188256dd0eb0664abf697d89613baeeabaa9321221c8e7ed
MD5 3aaaedb8a5ef9579c12220065eb4249a
BLAKE2b-256 5323018971e8702c7e01109139491417d3d43947d6f1424791359541e56385a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for midas_index-0.4.1.tar.gz:

Publisher: python-packages.yml on marinerhemant/MIDAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file midas_index-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: midas_index-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 75.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for midas_index-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a95eb317a6f7f3aac0403cbcad99bb777daf0e9cceb62ab52da49a24260d029e
MD5 fd6048f76814b717298c56911b8e33f1
BLAKE2b-256 9fbaf9258f3c0b73f2f7817739417d3ccc0713e6443054a21c8007803e12b954

See more details on using hashes here.

Provenance

The following attestation bundles were made for midas_index-0.4.1-py3-none-any.whl:

Publisher: python-packages.yml on marinerhemant/MIDAS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page