ogstools.materiallib.core.material module#

class ogstools.materiallib.core.material.Material[source]#

Bases: object

Represents a single material.

  • Can be constructed directly from YAML raw data.

  • Provides access to all properties.

  • Supports filtering by process schemas or property names.

__init__(name, raw_data)[source]#
property_names()[source]#

Returns a list of all property names of this material.

Return type:

list[str]

get_property(key)[source]#

Returns the property with the given name if available.

Return type:

MaterialProperty

filter_process(process_schema)[source]#

Return a new Material containing only properties required by a given process schema.

Return type:

Material

filter_properties(allowed, key='name')[source]#

Return a new Material containing only the properties in ‘allowed’, preserving all extra fields (e.g. scope, unit).

Parameters:
  • allowed (set[str] | str) – values to filter for

  • key (str) – attribute to filter for (e.g. ‘name’ or ‘type’)

Return type:

Material