Demo
cognite.pygen.demo
SolarFarmAPM
Demo class for generating Solar Farm APM model in Python.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
space
|
str
|
The space to deploy the APM model to. |
DEFAULT_SPACE
|
model_external_id
|
str
|
The external ID of the APM model. |
'SolarFarmAPM'
|
model_version
|
str
|
The version of the APM model. |
'1'
|
data_set_external_id
|
str | None
|
The external ID of the data set to use for CDF Resources such as Time Series and Files. |
DEFAULT_DATA_SET
|
Source code in cognite/pygen/demo/_solar_apm.py
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 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 |
|
clean(client, delete_space=True, auto_confirm=False)
Clean the Solar Farm Model from the CDF project the client is connected to.
This means removing the data model, views, and containers generated by pygen, as well as all CDF resources used in the population of the model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client
|
CogniteClient
|
Connected CogniteClient |
required |
delete_space
|
bool
|
Whether to try to delete the space the APM model was deployed to. This will only work if the space does not contain any other data models, views or containers. |
True
|
auto_confirm
|
bool
|
Whether to skip the confirmation prompt. |
False
|
Source code in cognite/pygen/demo/_solar_apm.py
create(client, populate=True)
Deploy, populate (optional) and generate a Python SDK for the APM demo model.
This method will do the following three steps
- Deploy the APM model to the CDF project the client is connected to.
- Generate a Python SDK for the APM model.
- Populate the APM model with mock data included in pygen.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client
|
CogniteClient
|
Connected CogniteClient |
required |
populate
|
bool
|
Whether to populate the APM model with mock data included in pygen. |
True
|
Returns:
Type | Description |
---|---|
Any
|
An instantiated SDK client for the APM model. |
Source code in cognite/pygen/demo/_solar_apm.py
deploy(client)
Deploy the APM model to the CDF project the client is connected to.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client
|
CogniteClient
|
Connected CogniteClient |
required |
Returns:
Type | Description |
---|---|
DataModel[View]
|
The DMS representation of the deployed model. |
Source code in cognite/pygen/demo/_solar_apm.py
display()
Display the model in GraphQL format in a Jupyter notebook environment.
Source code in cognite/pygen/demo/_solar_apm.py
generate_sdk(client)
Generate a Python SDK for the APM demo model.
Assumes APM Model Deployed
This method assumes the APM model has been deployed to the CDF project the client is connected to.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client
|
CogniteClient
|
Connected CogniteClient |
required |
Returns:
Type | Description |
---|---|
Any
|
An instantiated SDK client for the APM model. |