Plain Python package to validate, combine, and export crystal-plasticity material parameter sets. The material data itself (YAML
entries, JSON schemas, PROPS mapping table) is retrieved from the
mat-data repository and fetched over
the network (and cached locally) at runtime.
Currently only support for the crystal plasticity model ICAMS CP-UMAT is provided. Use the mat_extract_params command to extract the require .inc files that contains the values for PROPS[9:] read by the ICAMS CP-UMAT.
pip install mat-data-handlerFirst use of the CLI/API fetches the pinned mat-data ref (default: main)
and caches it under ~/.cache/mat-data-handler. For offline use or local
development against a sibling checkout, set:
export MAT_DATA_LOCAL_PATH=/path/to/mat-data # skips network access entirelyOther environment variables: MAT_DATA_REPO (default ICAMS/mat-data),
MAT_DATA_REF (default main; pin to a release tag for reproducibility),
MAT_DATA_FETCH_METHOD (http default, stdlib-only tarball download; or
git, which shells out to the git binary), MAT_DATA_CACHE_DIR.
mat_data_handler.data_source.{entries_dir, schemas_dir, mapping_path}()— resolve (fetching/caching as needed) local paths to themat-datacontent.mat_data_handler.database.build_database(entries, schemas, output_format="yaml")— validate all entries and return the combined database as text.mat_data_handler.database.validate_only(entries, schemas)— validate only, returns the number of valid materials.mat_data_handler.extract.export_entry(entry, mapping, schemas)— export one loaded material entry to AbaqusPROPSrecords.mat_data_handler.extract.load_document(path)/parse_mapping(path)— helpers to load a YAML/JSON entry or themapping.csvtable.
mat-build-database --output build/materials.yaml # generate combined database
mat-extract-params copper_generic --outdir build/includes
mat-extract-params all --outdir build/includesBoth commands default to fetching data from mat-data; pass
--entries/--schemas/--mapping-file to point at a different data source
(e.g. a local checkout) directly.
See CONTRIBUTING.md. For adding/updating material data, see mat-data instead — this repo has no data to edit.
pip install -e ".[test]"
export MAT_DATA_LOCAL_PATH=../mat-data # or wherever your mat-data checkout lives
pytestMIT — see LICENSE. (Material data in mat-data is licensed
separately, under CC-BY-4.0.)