SHOP Classes Returned by the SHOP API
cognite.powerops.client.shop.data_classes.shop_run.SHOPRun
dataclass
This represents a single SHOP run.
A SHOP run is represented by an event in CDF. This class is a wrapper around the event.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
external_id
|
str
|
The external ID of the SHOP run. This matches the external ID of the event in CDF. |
required |
watercourse
|
str
|
The watercourse of the SHOP run. |
required |
start
|
datetime | None
|
The start time of the SHOP run. |
required |
end
|
datetime | None
|
The end time of the SHOP run. |
required |
shop_version
|
str
|
The version of SHOP used for the SHOP run. |
required |
user_id
|
The user ID of the user that triggered the SHOP run. |
required |
Source code in cognite/powerops/client/shop/data_classes/shop_run.py
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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
|
load(event)
classmethod
Load a SHOP run from an event.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event
|
Event
|
The event to load from. |
required |
Returns:
Source code in cognite/powerops/client/shop/data_classes/shop_run.py
dump()
Dump the SHOP run to a dictionary.
Returns:
Type | Description |
---|---|
dict[str, Any]
|
A dictionary representation of the SHOP run. |
Source code in cognite/powerops/client/shop/data_classes/shop_run.py
to_case()
Make a new SHOPCase from this SHOPRun.
Source code in cognite/powerops/client/shop/data_classes/shop_run.py
get_case_file()
Get the case file for the SHOP run.
Returns:
Type | Description |
---|---|
str
|
The case file as a string. |
get_shop_files()
Get the SHOP files for the SHOP run.
Returns:
Type | Description |
---|---|
Iterable[str]
|
A generator of strings, where each string is a SHOP file. |
Source code in cognite/powerops/client/shop/data_classes/shop_run.py
get_pre_run_file()
Get the pre-run file generated by CogSHOP. This file is linked to the SHOP run event through the relationship "relationship_to.pre_run_file" and contains the input data for the SHOP run.
Returns:
Type | Description |
---|---|
str
|
The pre-run file as a string. |
Source code in cognite/powerops/client/shop/data_classes/shop_run.py
get_log_files()
Get the log files for the SHOP run. This is, for exampl,e the CPLEX output.
Returns:
Type | Description |
---|---|
Iterable[tuple[str, str]]
|
A generator of tuples of the form (external_id, file_content). |
Source code in cognite/powerops/client/shop/data_classes/shop_run.py
check_status()
Check the status of the SHOP run.
This does a request to CDF to check whether the SHOP run has finished or failed.
Returns:
Type | Description |
---|---|
SHOPRunStatus
|
A SHOP run status. |
Source code in cognite/powerops/client/shop/data_classes/shop_run.py
cognite.powerops.client.shop.data_classes.shop_run.SHOPRunList
Bases: UserList
This represents a list of SHOP runs.
Source code in cognite/powerops/client/shop/data_classes/shop_run.py
load(events)
classmethod
Load a SHOP run list from a list of events.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
events
|
Sequence[Event]
|
The events to load from. Must be SHOP run events. |
required |
Returns:
Type | Description |
---|---|
Self
|
A SHOP run list. |
Source code in cognite/powerops/client/shop/data_classes/shop_run.py
to_pandas()
Convert the SHOP run list to a pandas DataFrame.
Returns:
Type | Description |
---|---|
DataFrame
|
A pandas DataFrame. |