Skip to content

Texture uniform odf#939

Merged
bnmajor merged 3 commits into
masterfrom
texture-UniformODF
Jun 15, 2026
Merged

Texture uniform odf#939
bnmajor merged 3 commits into
masterfrom
texture-UniformODF

Conversation

@bnmajor

@bnmajor bnmajor commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Overview

Adds UniformODF, a constant orientation distribution function representing completely random (isotropic) texture. The ODF evaluates to a constant 1 MRD (multiples of a random distribution) for every orientation - the standard reference density for texture analysis on SO(3).

New API (additive only — no existing signatures changed)

  • hexrd.phase_transition.texture.UniformODF/hexrd.phase_transition.texture.uniform_odf:
    • .eval(orientations: np.ndarray) -> float | np.ndarray - returns a scalar 1.0 for a single (3, 3) matrix and an array of ones for any input whose shape ends in (3, 3); raises ValueError otherwise.

Tests added

  • Package export, constant 1 MRD value, and MRD convention.
  • Symmetry validation (valid + invalid crystal/sample)
  • Evaluation: single orientation (scalar), batched (N, 3, 3) and multi-dimensional (2, 2, 3, 3) inputs, and invalid-shape handling.
  • All orientations return equal values; value is 1 MRD across crystal symmetries.
  • Guard the mirrored symmetry sets against drift from WPPF's SYMLIST

Who might need to know

  • Anyone building texture/ODF functionality on hexrd.phase_transition.texture, since UniformODF establishes the ODF eval() interface contract.
  • Maintainers of hexrd.powder.wppf.texture - UniformODF mirrors (to avoid depending on WPPF) SYMLIST, and a test will fail if the crystal symmetry list there changes.

Affected Workflows

No existing workflows change behavior - this is purely additive. New texture/ODF code can now use UniformODF as a random-texture reference. Nno change to existing public APIs, CLI, or file formats.

Documentation Changes

  • No separate docs site/repo updates required; the public API is documented via docstrings

Other notes

  • Symmetry is validated and stored but intentionally inert. The uniform ODF value is constant regardless of symmetry; the arguments exist to satisfy the common ODF interface planned for the upcoming UnimodalODF work.
  • 'axial' sample symmetry was dropped. The sample set is restricted to {triclinic, monoclinic, orthorhombic} to match DeLaValleePoussinKernels supported sample symmetries. 'axial' has no current consumer.
  • Symmetry labels are mirrored from hexrd.powder.wppf.texture.SYMLIST rather than imported, to keep the new texture package decoupled from WPPF. A regression test guards against drift. If depending on WPPF is acceptable this can be changed to import the labels and the regression test can be dropped.

Depends on #926

@bnmajor bnmajor force-pushed the texture-UniformODF branch from 7c0aecb to 9359677 Compare June 3, 2026 18:10
@bnmajor bnmajor requested review from psavery and saransh13 June 3, 2026 19:28
@bnmajor bnmajor mentioned this pull request Jun 4, 2026
@psavery psavery force-pushed the texture-UniformODF branch from 9359677 to 70fac83 Compare June 12, 2026 07:14
Base automatically changed from texture-DeLaValleePoussinKernel to master June 12, 2026 13:09
bnmajor and others added 3 commits June 13, 2026 22:43
Implement a uniform orientation distribution function representing completely random texture. The
constant value is 1 MRD (multiples of a random distribution).

- UniformODF class with crystal/sample symmetry validation
- Evaluation for single, batch, and arbitrary-shape orientations

Signed-off-by: Brianna Major <brianna.major@kitware.com>
This verifies the full expected symmetry set can be used.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
Drop the mirrored WPPF SYMLIST frozensets (and their guard test) and
validate through the kernel's _symmetry_quaternions instead - one
symmetry validator for the package. crystal/sample symmetry are now
optional (default None) with str|None properties, matching the kernel
and UnimodalODF.

Signed-off-by: Patrick Avery <patrick.avery@kitware.com>
@psavery psavery force-pushed the texture-UniformODF branch from 70fac83 to 912a963 Compare June 13, 2026 14:59
@psavery psavery marked this pull request as ready for review June 13, 2026 14:59

@psavery psavery left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bnmajor I made some minor modifications. Looks good otherwise. Merge when ready.

@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.22%. Comparing base (172528d) to head (912a963).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #939      +/-   ##
==========================================
+ Coverage   73.18%   73.22%   +0.03%     
==========================================
  Files         145      146       +1     
  Lines       22640    22672      +32     
==========================================
+ Hits        16570    16602      +32     
  Misses       6070     6070              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bnmajor bnmajor merged commit 86cf1c7 into master Jun 15, 2026
10 checks passed
@bnmajor bnmajor deleted the texture-UniformODF branch June 15, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants