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