BoM sustainability#
Query definition#
- class BomSustainabilityQuery#
Evaluates sustainability impact for a BoM in the Ansys Granta 2301 XML BoM format and returns metrics for each item in the BoM.
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 typeBomSustainabilityQueryResult
.Added in version 2.0.
Examples
>>> cxn = Connection("http://my_mi_server/mi_servicelayer").with_autologon().connect() >>> bom = "<PartsEco xmlns..." >>> query = ( ... BomSustainabilityQuery() ... .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 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 BomSustainabilityQueryResult(results, messages)#
Describes the result of running a
BomSustainabilityQuery
.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 part: PartWithSustainabilityResult#
Sustainability information for the root part included in the BoM specified in the original query.
- property transport_stages: List[TransportWithSustainabilityResult]#
Sustainability information for each transport stage included in the BoM specified in the original query.
Transport#
- class TransportWithSustainabilityResult(name, **kwargs)#
Describes a transport stage included as part of a sustainability query result. This object includes two categories of attributes:
The reference to the transport record in Granta MI
The sustainability information for this transport stage
Added in version 2.0.
- property identity: str | None#
Item unique identifier.
This property is only populated on BoM query results and is equal to the
id
attribute of the corresponding input BoM item. If noid
has been defined on the BoM item, a unique auto-generated value is assigned during analysis.
- property embodied_energy: ValueWithUnit#
Represents the direct and indirect energy use. Based on cumulative energy demand method developed by ecoinvent.
- 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.
Part#
- class PartWithSustainabilityResult(**kwargs)#
Describes an individual part included as part of a sustainability query result. This object includes three categories of attributes:
The reference to the part in Granta MI (if the part references a record)
The sustainability information for this part
Any part, material, or process objects which are a child of this part object
Added in version 2.0.
- property identity: str | None#
Item unique identifier.
This property is only populated on BoM query results and is equal to the
id
attribute of the corresponding input BoM item. If noid
has been defined on the BoM item, a unique auto-generated value is assigned during analysis.
- property external_identity: str | None#
Item external identity.
This property is only populated on BoM query results and is equal to the
<ExternalIdentity>
element of the corresponding input BoM item.
- property name: str | None#
Item name.
This property is only populated on BoM query results and is equal to the
<Name>
element of the corresponding input BoM item.
- property input_part_number: str | None#
Input part number.
This property is only populated on BoM query results and is equal to the
<PartNumber>
element of the corresponding input BoM item.
- property reported_mass: ValueWithUnit#
Indicates a mass value that is calculated by the analysis, that represents the total mass for the quantity of the item specified in the BoM, taking into account the quantities of parent assemblies.
- property embodied_energy: ValueWithUnit#
Represents the direct and indirect energy use. Based on cumulative energy demand method developed by ecoinvent.
- 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 parts: List[PartWithSustainabilityResult]#
PartWithSustainabilityResult
objects that are direct children of this item in the BoM.
- property materials: List[MaterialWithSustainabilityResult]#
MaterialWithSustainabilityResult
objects that are direct children of this item in the BoM.
- property processes: List[ProcessWithSustainabilityResult]#
ProcessWithSustainabilityResult
objects that are direct children of this item in the BoM.
Material#
- class MaterialWithSustainabilityResult(**kwargs)#
Describes an individual material included as part of a sustainability query result. This object includes three categories of attributes:
The reference to the material in Granta MI
The sustainability information for this material
Any process objects that are a child of this material object
Added in version 2.0.
- property identity: str | None#
Item unique identifier.
This property is only populated on BoM query results and is equal to the
id
attribute of the corresponding input BoM item. If noid
has been defined on the BoM item, a unique auto-generated value is assigned during analysis.
- property external_identity: str | None#
Item external identity.
This property is only populated on BoM query results and is equal to the
<ExternalIdentity>
element of the corresponding input BoM item.
- property name: str | None#
Item name.
This property is only populated on BoM query results and is equal to the
<Name>
element of the corresponding input BoM item.
- property reported_mass: ValueWithUnit#
Indicates a mass value that is calculated by the analysis, that represents the total mass for the quantity of the item specified in the BoM, taking into account the quantities of parent assemblies.
- property recyclable: bool#
Indicates whether the material can be recycled, regardless of the recyclates quality.
- property biodegradable: bool#
Indicates whether the material is biodegradable. Includes any waste that is capable of undergoing anaerobic or aerobic decomposition.
- property functional_recycle: bool#
Indicates whether the material can be recycled into material of an equivalent quality, that can be used for the same (or similar) applications.
- property embodied_energy: ValueWithUnit#
Represents the direct and indirect energy use. Based on cumulative energy demand method developed by ecoinvent.
- 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 processes: List[ProcessWithSustainabilityResult]#
ProcessWithSustainabilityResult
objects that are direct children of this item in the BoM.
Process#
- class ProcessWithSustainabilityResult(embodied_energy, climate_change, **kwargs)#
Describes a process included as part of a sustainability query result. This object includes two categories of attributes:
The reference to the process record in Granta MI
The sustainability information for this process
Added in version 2.0.
- property identity: str | None#
Item unique identifier.
This property is only populated on BoM query results and is equal to the
id
attribute of the corresponding input BoM item. If noid
has been defined on the BoM item, a unique auto-generated value is assigned during analysis.
- property external_identity: str | None#
Item external identity.
This property is only populated on BoM query results and is equal to the
<ExternalIdentity>
element of the corresponding input BoM item.
- property name: str | None#
Item name.
This property is only populated on BoM query results and is equal to the
<Name>
element of the corresponding input BoM item.
- property embodied_energy: ValueWithUnit#
Represents the direct and indirect energy use. Based on cumulative energy demand method developed by ecoinvent.
- 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.