BoM sustainability summary#
Query definition#
- class BomSustainabilitySummaryQuery#
Evaluates sustainability impact for an XML BoM and returns aggregated metrics.
23/01 XML BoMs supported by MI Restricted Substances and Sustainability Reports 2024 R2 or later.
24/12 XML BoMs supported by MI Restricted Substances and Sustainability Reports 2025 R2 or later.
The methods used to configure units and add the BoM to this query return the query itself so that they can be chained together as required.
Once the query is fully constructed, use the cxn.
run()
method to return a result of typeBomSustainabilitySummaryQueryResult
.Added in version 2.0.
Examples
>>> cxn = Connection("http://my_mi_server/mi_servicelayer").with_autologon().connect() >>> bom = "<PartsEco xmlns..." >>> query = ( ... BomSustainabilitySummaryQuery() ... .with_bom(bom) ... ) >>> cxn.run(query)
- with_bom(bom)#
Set the BoM to use for the query.
See the documentation for the parent query class for supported BoM formats.
Minimal validation is performed on the provided BoM to ensure it defines a supported XML schema. XSD files are provided in
schemas
for full validation.- Parameters:
- bom
str
BoM to use for the query.
- bom
- Returns:
Query
Current query object.
- Raises:
TypeError
Error raised if the method is called with values that do not match the types described earlier.
ValueError
Error raised if the bom isn’t valid XML, or isn’t in a known supported BoM format.
Notes
See the
ansys.grantami.bomanalytics.schemas
subpackage for Ansys Granta XML BoM Schema Definitions.
- with_units(distance=None, energy=None, mass=None)#
Specifies units to use in the response.
Sets all units, overriding any previous configuration. The specified units must exist in the target database. Units not set will default to the API default unit:
Distance:
km
Energy:
MJ
Mass:
kg
Query result#
- class BomSustainabilitySummaryQueryResult(results, messages)#
Describes the result of running a
BomSustainabilitySummaryQuery
.Added in version 2.0.
- property messages: List[LogMessage]#
Messages generated by Granta MI when running the query. The presence of one or more messages means that something unexpected happened when running the query but that the query could still be completed.
Messages are sorted in order of decreasing severity and are available in the Service Layer log file.
Messages are also logged using the Python
logging
module to theansys.grantami.bomanalytics
logger. By default, messages with a severity of"warning"
or higher are printed on stderr.
- property phases_summary: List[SustainabilityPhaseSummaryResult]#
Sustainability summary for all lifecycle phases analyzed by the query.
- property transport: SustainabilityPhaseSummaryResult#
Sustainability summary for the transport phase.
Values in percentages express the contribution of this phase, relative to the total contribution of all phases analyzed by the query.
- property material: SustainabilityPhaseSummaryResult#
Sustainability summary for the material phase.
Values in percentages express the contribution of this phase, relative to the total contribution of all phases analyzed by the query.
- property process: SustainabilityPhaseSummaryResult#
Sustainability summary for the process phase.
Values in percentages express the contribution of this phase, relative to the total contribution of all phases analyzed by the query.
- property distribution_transport_summary: TransportSummaryByCategoryResult | None#
Aggregated information for all distribution transport stages.
Values in percentages express the contribution of all distribution transport stages relative to the total contribution from transportation in the BoM.
Only available if a 24/12 XML BoM was specified for
BomSustainabilitySummaryQuery.with_bom()
.Added in version 2.3.
Notes
This property is only populated if the Granta MI servers includes MI Restricted Substances and Sustainability Reports 2025 R2 and later. Otherwise, this property will return
None
.
- property manufacturing_transport_summary: TransportSummaryByCategoryResult | None#
Aggregated information for all manufacturing transport stages.
Values in percentages express the contribution of all manufacturing transport stages relative to the total contribution from transportation in the BoM.
Added in version 2.3.
Notes
This property is only populated if the Granta MI servers includes MI Restricted Substances and Sustainability Reports 2025 R2 and later. Otherwise, this property will return
None
.
- property transport_details: List[TransportSummaryResult]#
Summary information for each transport stage described in the BoM.
Values in percentages express the contribution of the specific transport stage, relative to the total contribution from transportation in the BoM.
- property transport_details_aggregated_by_part: List[TransportSummaryByPartResult]#
Summary information for transport stages, aggregated by part.
Relative and absolute contributions for parts whose relative contributions from transport exceed 5% of the total impact for parts (by
embodied_energy_percentage
orclimate_change_percentage
).All parts in the BoM that do not exceed the 5% threshold are aggregated under a virtual
TransportSummaryByPartResult
, whosepart_name
property is equal toOther
.Values in percentages express the combined contribution of all transport stages associated with a part, relative to the total contribution from transportation in the BoM.
Added in version 2.3.
Notes
This property is only populated if the following conditions are all true:
The Granta MI server includes MI Restricted Substances and Sustainability Reports 2025 R2 and later.
A 24/12 BoM was provided to
BomSustainabilitySummaryQuery.with_bom()
.At least one or more transport stages was defined for at least one part.
Otherwise, this property will return an empty list.
- property material_details: List[MaterialSummaryResult]#
Summary information for materials, aggregated by
identity
.Relative and absolute contributions for materials whose relative contributions exceed 2% of the total impact for materials (by
embodied_energy_percentage
orclimate_change_percentage
).All materials in the BoM that do not exceed the 2% threshold are aggregated under a virtual
MaterialSummaryResult
, whoseidentity
property is equal toOther
.Values in percentages express the contribution of the specific material, relative to contributions of all materials.
- property primary_processes_details: List[ProcessSummaryResult]#
Summary information for primary processes, aggregated by
process_name
andmaterial_identity
.The returned list includes all unique primary process/material combinations whose relative contributions exceed 5% of the total impact of all primary processes (by
embodied_energy_percentage
orclimate_change_percentage
).All process/material combinations that do not exceed the 5% threshold are aggregated under a virtual
ProcessSummaryResult
, whoseprocess_name
is equal toOther
.Values in percentages express the contribution of the specific process, relative to contributions of all primary processes.
- property secondary_processes_details: List[ProcessSummaryResult]#
Summary information for secondary processes, aggregated by
process_name
andmaterial_identity
.The returned list includes all unique secondary process/material combinations whose relative contributions exceed 5% of the total impact of all secondary processes (by
embodied_energy_percentage
orclimate_change_percentage
).All process/material combinations that do not exceed the 5% threshold are aggregated under a virtual
ProcessSummaryResult
, whoseprocess_name
is equal toOther
.Values in percentages express the contribution of the specific process, relative to contributions of all secondary processes.
- property joining_and_finishing_processes_details: List[ProcessSummaryResult]#
Summary information for joining and finishing processes, , aggregated by
process_name
andmaterial_identity
.The returned list includes all joining and finishing processes whose relative contributions exceed 5% of the total impact of all joining and finishing processes (by
embodied_energy_percentage
orclimate_change_percentage
).All processes that do not exceed the 5% threshold are aggregated under a virtual
ProcessSummaryResult
, whoseprocess_name
is equal toOther
.Values in percentages express the contribution of the specific process, relative to contributions of all joining and finishing processes.
Phase summary#
- class SustainabilityPhaseSummaryResult(name, **kwargs)#
High-level sustainability summary for a phase.
Phases currently include:
Material
Processes
Transport
Added in version 2.0.
- property embodied_energy: ValueWithUnit#
Represents the direct and indirect energy use. Based on cumulative energy demand method developed by ecoinvent.
- property embodied_energy_percentage: float#
Represents the percentage contribution of the item to total embodied energy of the parent collection.
- property climate_change: ValueWithUnit#
Estimates global warming potential considering emissions of different gases reported as carbon dioxide equivalents (CO2-eq.). Based on Intergovernmental Panel on Climate Change (IPCC) method.
Transport#
- class TransportSummaryResult(name, transport_reference, **kwargs)#
Sustainability summary for a transport stage.
Added in version 2.0.
- property embodied_energy: ValueWithUnit#
Represents the direct and indirect energy use. Based on cumulative energy demand method developed by ecoinvent.
- property embodied_energy_percentage: float#
Represents the percentage contribution of the item to total embodied energy of the parent collection.
- property climate_change: ValueWithUnit#
Estimates global warming potential considering emissions of different gases reported as carbon dioxide equivalents (CO2-eq.). Based on Intergovernmental Panel on Climate Change (IPCC) method.
- property climate_change_percentage: float#
Represents the percentage contribution of the item to total climate change of the parent collection.
- property distance: ValueWithUnit#
Distance covered by this transport summary.
- property transport_reference: TransportReference#
Transport record reference.
- class TransportSummaryByCategoryResult(**kwargs)#
Aggregated sustainability summary for all transport stages in a category.
Added in version 2.3.
- property embodied_energy: ValueWithUnit#
Represents the direct and indirect energy use. Based on cumulative energy demand method developed by ecoinvent.
- property embodied_energy_percentage: float#
Represents the percentage contribution of the item to total embodied energy of the parent collection.
- property climate_change: ValueWithUnit#
Estimates global warming potential considering emissions of different gases reported as carbon dioxide equivalents (CO2-eq.). Based on Intergovernmental Panel on Climate Change (IPCC) method.
- property climate_change_percentage: float#
Represents the percentage contribution of the item to total climate change of the parent collection.
- property distance: ValueWithUnit#
Distance covered by this transport summary.
- class TransportSummaryByPartResult(part_name, parent_part_name, category, transport_types, **kwargs)#
Aggregated sustainability summary for all transport stages associated with a part.
Added in version 2.3.
- property embodied_energy: ValueWithUnit#
Represents the direct and indirect energy use. Based on cumulative energy demand method developed by ecoinvent.
- property embodied_energy_percentage: float#
Represents the percentage contribution of the item to total embodied energy of the parent collection.
- property climate_change: ValueWithUnit#
Estimates global warming potential considering emissions of different gases reported as carbon dioxide equivalents (CO2-eq.). Based on Intergovernmental Panel on Climate Change (IPCC) method.
- property climate_change_percentage: float#
Represents the percentage contribution of the item to total climate change of the parent collection.
- property distance: ValueWithUnit#
Distance covered by this transport summary.
- property parent_part_name: str | None#
Name of the parent part (if populated in the input BoM used in the query).
- property category: TransportCategory | None#
The transport category for this summary.
Returns
None
if this summary represents the aggregation of parts with transport stages that do not exceed the 5% threshold.
- class TransportCategory(value)#
The stage of the product lifecycle to which a
TransportSummaryByPartResult
belongs.Enum
class.Added in version 2.3.
- MANUFACTURING = 'Manufacturing'#
Transportation of individual components before the product is completed.
- DISTRIBUTION = 'Distribution'#
Transportation of the complete finished product.
Material#
- class MaterialSummaryResult(identity, material_reference, mass_before_processing, mass_after_processing, contributors, **kwargs)#
Aggregated sustainability summary for a material.
Describes the environmental footprint of a unique material, accounting for all occurrences of the material in BoM.
Added in version 2.0.
- property embodied_energy: ValueWithUnit#
Represents the direct and indirect energy use. Based on cumulative energy demand method developed by ecoinvent.
- property embodied_energy_percentage: float#
Represents the percentage contribution of the item to total embodied energy of the parent collection.
- property climate_change: ValueWithUnit#
Estimates global warming potential considering emissions of different gases reported as carbon dioxide equivalents (CO2-eq.). Based on Intergovernmental Panel on Climate Change (IPCC) method.
- property climate_change_percentage: float#
Represents the percentage contribution of the item to total climate change of the parent collection.
- property material_reference: MaterialReference#
Material record reference.
- property mass_before_processing: ValueWithUnit#
Original mass of material prior to any subtractive processing.
- property mass_after_processing: ValueWithUnit#
Mass of material after any subtractive processing.
- property contributors: List[ContributingComponentResult]#
Top three parts in the BoM that are made of this material (by
mass_before_processing
).
- class ContributingComponentResult(name, part_number, part_reference, material_mass_before_processing, **kwargs)#
Describes a Part item of the BoM.
Listed as
contributors
of aMaterialSummaryResult
.Added in version 2.0.
- property part_reference: PartReference#
Part record reference.
- property material_mass_before_processing: ValueWithUnit#
Original mass of parent material prior to any subtractive processing (removal of material).
Process#
- class ProcessSummaryResult(material_identity, material_reference, process_name, process_reference, **kwargs)#
Aggregated sustainability summary for a process.
For primary and secondary processes, this corresponds to a unique process/material combination. For joining and finishing processes, this corresponds to a unique process, and
material_identity
andmaterial_reference
are None.Describes the environmental footprint of a process, accounting for all occurrences of the process-material pair found in the BoM.
Added in version 2.0.
- property embodied_energy: ValueWithUnit#
Represents the direct and indirect energy use. Based on cumulative energy demand method developed by ecoinvent.
- property embodied_energy_percentage: float#
Represents the percentage contribution of the item to total embodied energy of the parent collection.
- property climate_change: ValueWithUnit#
Estimates global warming potential considering emissions of different gases reported as carbon dioxide equivalents (CO2-eq.). Based on Intergovernmental Panel on Climate Change (IPCC) method.
- property climate_change_percentage: float#
Represents the percentage contribution of the item to total climate change of the parent collection.
- property process_reference: ProcessReference#
Process record reference.
- property material_identity: str | None#
Material identity.
Only populated for primary and secondary processes.
- property material_reference: MaterialReference | None#
Material record reference.
Only populated for primary and secondary processes.