Life Cycle Inventory data format

The main goal of ELDAM is Life Cycle Inventory data conversion. This is done in an object oriented way using LCI abstract classes that simply describes LCI data without any file format considerations. These classes are an intermediate state allowing easier management and interoperability.

Process

The main data structure is the Process class. It represents a LCI unit process. A process has metadata such as a name, project and comment. It also has flows and can be linked to input or calculated parameters that can respectively be added with the methods add_parameter(), add_parameters(), add_flow() and add_flows().

An abstract class is defined for both Flow and Parameter. These classes are then inherited by classes specific to each flow or parameter types such as TechnosphereFlow for example. The class FlowFactory can be used for easier creation of a flow independently of its type.

Properties input_parameters(), calculated_parameters(), product_flows(), technosphere_flows() and biosphere_flows() allow direct access to a list of parameters/flows of each type linked to the process. The property product() returns the product flow if there is one and only one, None else.

Due to SimaPro data model, if a process has a waste treatment product flow, it cannot have other product flows (classic products or waste treatment products). The property product_type() returns the type of the product and None if the Process has no product. It is used to raise a ProductTypeError if a product flow is added to the process breaking the rule explained above.

>>> from eldam.core.lci_data import Process
>>>
>>> process = Process()
>>> process.add_flows(flow1, flow1)
>>> process.add_parameters(input_parameter1, input_parameter2, calculated_parameter)
>>> process.flows
[flow1, flow2]
>>> process.input_parameters
[input_parameter1, input_parameter2]
>>> process.calculated_parameters
[calculated_parameter]

The method remove_unused_parameters() removes parameters that are not used in the formula of a flow or a calculated parameter related to the process. The method check_for_missing_parameters() will raise an MissingParameterError if the formula of a flow or a calculated parameter related to the process uses a parameter that is not present in parameters.

Flow classes

The Flow class is used for modelling a biosphere or technosphere flow linked to a Process. It is a parent class for ProductFlow, TechnosphereFlow and BiosphereFlow.

The amount parameter of the class constructor can be given a float or a string. Float values will be interpreted as amount values, strings will be interpreted as amount values if parseable in a float (dot or comma are both accepted as decimal separators), and as a formula if not. The amount_type attribute tells if the amount has been recognized as amount value or formula.

>>> from eldam.core.lci_data import Flow
>>>
>>> flow1 = Flow(name='name', type='type', unit='unit', amount='6')
>>> flow2 = Flow(name='name', type='type', unit='unit', amount='6.5')
>>> flow3 = Flow(name='name', type='type', unit='unit', amount='6,5')
>>> flow4 = Flow(name='name', type='type', unit='unit', amount=6.5)
>>> flow5 = Flow(name='name', type='type', unit='unit', amount='A+B')
>>> flow1.amount, flow1.amount_type
6.0, 'Value'
>>> flow2.amount, flow2.amount_type
6.5, 'Value'
>>> flow3.amount, flow3.amount_type
6.5, 'Value'
>>> flow4.amount, flow4.amount_type
6.5, 'Value'
>>> flow5.amount, flow5.amount_type
'A+B', 'Formula'

For TechnosphereFlow and BiosphereFlow, the method missing_quality_data(), returns the quality data that are missing according to ELSA’s Quality Management System.

Parameters

InputParameter and CalculatedParameter represents parameters used in formulas. Input parameters have a value where calculated parameters have a formula (using values or others parameters). As Flow, InputParameter will convert strings into floats and accepts dots and commas as decimal separators. Both classes inherits from Parameter.

Common methods

Equality and difference operators have been implemented for classes Process, Flow, InputParameter and CalculatedParameter. They evaluate equality/difference of each attributes of the objects and related flows or parameters (for processes only).

All LCI data classes inherit the following methods from the InventoryData class :

encoded_comment() and simapro_csv_format() have an argument named elda_only_data that specifies if data used by ELDAM but not by SimaPro should be embedded in the encoded comment.