Product ID List
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.
ProductIdList
A list of ProductId objects.
Attributes:
Name | Type | Description |
---|---|---|
product_ids |
list
|
A list of ProductId objects. |
Raises:
Type | Description |
---|---|
ValueError
|
If product_ids is not a list of ProductId objects. |
ValueError
|
If there are duplicate ProductId objects in the list. |
Source code in pact_methodology/product_footprint/product_id_list.py
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 130 131 132 133 134 135 136 137 |
|
__delitem__(index)
Deletes the ProductId object at the specified index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index
|
int
|
The index of the ProductId object to delete. |
required |
Source code in pact_methodology/product_footprint/product_id_list.py
81 82 83 84 85 86 87 88 |
|
__getitem__(index)
Returns the ProductId object at the specified index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index
|
int
|
The index of the ProductId object to return. |
required |
Returns:
Name | Type | Description |
---|---|---|
ProductId |
The ProductId object at the specified index. |
Source code in pact_methodology/product_footprint/product_id_list.py
54 55 56 57 58 59 60 61 62 63 64 |
|
__init__(product_ids)
Initializes a ProductIdList object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
product_ids
|
list
|
A list of ProductId objects. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If product_ids is not a list of ProductId objects. |
ValueError
|
If there are duplicate ProductId objects in the list. |
Source code in pact_methodology/product_footprint/product_id_list.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
__iter__()
Returns an iterator over the ProductId objects in the list.
Returns:
Name | Type | Description |
---|---|---|
iterator |
An iterator over the ProductId objects in the list. |
Source code in pact_methodology/product_footprint/product_id_list.py
36 37 38 39 40 41 42 43 |
|
__len__()
Returns the number of ProductId objects in the list.
Returns:
Name | Type | Description |
---|---|---|
int |
The number of ProductId objects in the list. |
Source code in pact_methodology/product_footprint/product_id_list.py
45 46 47 48 49 50 51 52 |
|
__setitem__(index, value)
Sets the ProductId object at the specified index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index
|
int
|
The index of the ProductId object to set. |
required |
value
|
ProductId
|
The ProductId object to set. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If value is not a ProductId object. |
Source code in pact_methodology/product_footprint/product_id_list.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
append(product_id)
Appends a ProductId object to the list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
product_id
|
ProductId
|
The ProductId object to append. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If product_id is not a ProductId object. |
ValueError
|
If product_id is already in the list. |
Source code in pact_methodology/product_footprint/product_id_list.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
insert(index, product_id)
Inserts a ProductId object at the specified index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index
|
int
|
The index at which to insert the ProductId object. |
required |
product_id
|
ProductId
|
The ProductId object to insert. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If product_id is not a ProductId object. |
ValueError
|
If product_id is already in the list. |
Source code in pact_methodology/product_footprint/product_id_list.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
remove(product_id)
Removes a ProductId object from the list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
product_id
|
ProductId
|
The ProductId object to remove. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If product_id is not in the list. |
Source code in pact_methodology/product_footprint/product_id_list.py
125 126 127 128 129 130 131 132 133 134 135 136 137 |
|