BoM sustainability summary#
Query definition#
- class BomSustainabilitySummaryQuery#
Evaluates sustainability impact for a BoM in the Ansys Granta 2301 XML BoM format and returns aggregated metrics.
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
.New 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 the request is sent to the appropriate endpoint. XSD files are provided inschemas
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
sub-package 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
.New 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 transport_details: List[TransportSummaryResult]#
Summary information for all transport stages.
Values in percentages express the contribution of the specific transport stage, relative to contributions of all transport stages.
- 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
New 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, distance, **kwargs)#
Sustainability summary for a transport stage.
New 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 transport_reference: TransportReference#
Transport record reference.
- property distance: ValueWithUnit#
Distance travelled in the transport stage.
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.
New 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
.New 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.
New 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.