Emission Factor DS
This part of the project documentation focuses on
an information-oriented approach. Use it as a
reference for the technical implementation of the
pact_methodology
project code.
EmissionFactorDS
Represents an emission factor database reference.
This class represents references to emission factor databases as defined in Section 4.1.3.2 of the PACT Methodology.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the emission factor database. |
required |
version
|
str
|
The version of the emission factor database. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If name or version is empty or not a string. |
Examples:
Create an emission factor database reference: >>> ef_db = EmissionFactorDS(name="ecoinvent", version="3.9.1")
Convert to dictionary format: >>> ef_db.to_dict() {'name': 'ecoinvent', 'version': '3.9.1'}
Source code in pact_methodology/carbon_footprint/emission_factor_ds.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
|
name
property
writable
Get the database name.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The database name string |
version
property
writable
Get the database version.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The database version string |
__eq__(other)
Check equality with another instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
other
|
The other instance to compare with |
required |
Returns:
Name | Type | Description |
---|---|---|
bool |
bool
|
True if equal, False otherwise |
Source code in pact_methodology/carbon_footprint/emission_factor_ds.py
118 119 120 121 122 123 124 125 126 127 128 129 |
|
__init__(name, version)
Initialize an EmissionFactorDS instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
The name of the emission factor database |
required |
version
|
str
|
The version of the emission factor database |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If name or version is empty or not a string |
Source code in pact_methodology/carbon_footprint/emission_factor_ds.py
23 24 25 26 27 28 29 30 31 32 33 34 |
|
__repr__()
Get detailed string representation.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A string that could be used to recreate the object |
Source code in pact_methodology/carbon_footprint/emission_factor_ds.py
110 111 112 113 114 115 116 |
|
__str__()
Get string representation.
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
A human-readable string showing the attributes |
Source code in pact_methodology/carbon_footprint/emission_factor_ds.py
102 103 104 105 106 107 108 |
|
to_dict()
Convert to a dictionary representation.
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
A dictionary with the following structure: { "name": str, # The database name "version": str # The database version } |
Example
ef_ds = EmissionFactorDS(name="ecoinvent", version="3.9.1") ef_ds.to_dict() {'name': 'ecoinvent', 'version': '3.9.1'}
Source code in pact_methodology/carbon_footprint/emission_factor_ds.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
|