Skip to content

Material Registry

Sunil Anandatheertha edited this page Sep 18, 2026 · 2 revisions

Material Registry

The upxo.material package stores typed, provenance-tracked material metadata — identity, processing history, and texture profiles — separately from grain-structure geometry (LFI). It is a small, test-backed layer used when you need structured material records (e.g. tracking texture/processing context alongside a grain structure), not a full materials database or FE material-card library.

Related: Texture & Crystallography, Architecture.


Design

MaterialRegistry replaces older dict-flattening storage: categories keep dataclass instances, optional soft validation (unknown values warn, never block), and provenance (source, method, parameters, timestamp).

from upxo.material.registry import MaterialRegistry
from upxo.material.identity import MaterialIdentity, KNOWN_MATERIALS
from upxo.material.processing import ProcessingRoute, ProcessingStep
from upxo.material.texture import TextureComponentProfile

reg = MaterialRegistry()

reg.register_category(
    'MaterialIdentity',
    MaterialIdentity,
    known_values={'name': KNOWN_MATERIALS},
)
reg.ingest(
    'MaterialIdentity',
    MaterialIdentity(name='OFHC-Cu', alloy='OFHC', comp='Cu'),
    source='user input',
)

print(reg.get('MaterialIdentity').name)
print(reg.get_provenance('MaterialIdentity').source)

Modules

Module Types / role
registry.py MaterialRegistry — register_category, ingest, get, get_provenance
provenance.py Provenance metadata per ingested instance
identity.py MaterialIdentity (name, alloy, comp); KNOWN_MATERIALS soft whitelist
processing.py ProcessingStep, ProcessingRoute, last_deformation_step
texture.py TextureComponentProfile — crystal family + component fractions/widths + random fraction
Material.py Older/legacy material property dataclasses and helpers (irradiation, phases, tensile stubs, …) — prefer the typed registry path for new work

Known materials (soft list)

KNOWN_MATERIALS currently includes: OFHC-Cu, CuCrZr, AA7075, AA2099. Unlisted names still ingest with a warning.

Processing steps

Kind Examples
Deformation (seen by last_deformation_step) rolling_symmetric, rolling_asymmetric, extrusion, forging
Other heat_treatment, casting, machining, aging

ProcessingRoute is an ordered list of steps — order matters for texture-history reasoning.

Texture profiles

TextureComponentProfile is crystal-family-generic (crystal_family='FCC', …) with dicts shaped like FCCTexture.tc_fractions / spreads so a profile can feed synthetic texture generation without reshaping.


Tests

File Focus
tests/material/test_registry.py Categories, ingest, provenance, soft validation
tests/material/test_processing.py Step types, last_deformation_step
tests/material/test_identity.py Identity + known materials
tests/material/test_texture.py TextureComponentProfile

Status

  • In scope: typed bookkeeping for identity / route / texture profile + provenance.
  • Out of scope: calibrated property cards for Eurofer/F82H, full ODF databases, automatic coupling into every generator.
  • Pipelines (MCGS, FM, twin) do not require a registry entry to generate geometry; registry is optional metadata infrastructure.

Clone this wiki locally