Data Scientist
What we mean with a data scientists is a person with the following type of responsibilities:
- Explore new workflow to improve the power ops operations. For example, test new SHOP configurations, that
- Run ad-hoc analysis using simulators such as
SHOP.
To get started, we assume you have installed the cognite-power-ops SDK and that all configurations have been setup in Cognite Data Fusion.
Furthermore, it is assumed that you have setup one or two toml files with the credentials for connecting to Cognite Data Fusion and settings for this SDK. An example is shown below.
To setup the client we keep the credentials in either one or two toml files:
Interactive Login¶
This only requires one toml file looking like this
settings.toml
[cognite]
login_flow = "interactive"
project = "<cdf-project>"
tenant_id = "<tenant-id>"
cdf_cluster = "<cdf-cluster>"
client_id = "<client-id>"
[powerops]
read_dataset = "uc:000:powerops"
write_dataset = "uc:000:powerops"
Client Credentials Login¶
For this case the you can use two toml files to separate the secrtes from the regular settings
settings.toml
[cognite]
login_flow = "client_credentials"
project = "<cdf-project>"
tenant_id = "<tenant-id>"
cdf_cluster = "<cdf-cluster>"
client_id = "<client-id>"
[powerops]
read_dataset = "uc:000:powerops"
write_dataset = "uc:000:powerops"
and the .secrets.toml
[cognite]
client_secret = "<client-secret>"
The main entry point for the SDK is the PowerOpsClient
import os
# You can control which setting files are loaded through the environmental variable below.
# In this case, the setting files are located two levels above.
os.environ["SETTINGS_FILES"] = "../../settings.toml;../../.secrets.toml"
from cognite.powerops import PowerOpsClient
power = PowerOpsClient.from_settings()
The PowerOpsClient gives you access to all the configuration files presented in Python objects that you that you can retrieve. For example, we can list the available generators from the production configuration.
power.production.generators.list()
| external_id | generator_efficiency_curve | name | p_min | penstock | start_stop_cost | startcost | turbine_efficiency_curve | version | last_updated_time | created_time | deleted_time | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | generator:Holen_G1 | generator:Holen_G1_generator_efficiency_curve | Holen_G1 | 27.0 | 1 | 112233 | 200.0 | generator:Holen_G1_turbine_efficiency_curve | 2 | 2023-08-14 14:33:18.030000+00:00 | 2023-07-25 19:04:28.694000+00:00 | None |
| 1 | generator:Lund_G1 | generator:Lund_G1_generator_efficiency_curve | Lund_G1 | 0.6 | 1 | 112233 | 100.0 | generator:Lund_G1_turbine_efficiency_curve | 2 | 2023-08-14 14:33:18.030000+00:00 | 2023-07-25 19:04:28.694000+00:00 | None |
| 2 | generator:Lien_krv_G1 | generator:Lien_krv_G1_generator_efficiency_curve | Lien_krv_G1 | 0.0 | 1 | None | 150.0 | generator:Lien_krv_G1_turbine_efficiency_curve | 2 | 2023-08-14 14:33:18.030000+00:00 | 2023-07-25 19:04:28.694000+00:00 | None |
| 3 | generator:Landet_G1 | generator:Landet_G1_generator_efficiency_curve | Landet_G1 | 25.0 | 1 | None | 200.0 | generator:Landet_G1_turbine_efficiency_curve | 2 | 2023-08-14 14:33:18.030000+00:00 | 2023-07-25 19:04:28.694000+00:00 | None |
| 4 | generator:Dalby_G1 | generator:Dalby_G1_generator_efficiency_curve | Dalby_G1 | 40.0 | 1 | 112233 | 500.0 | generator:Dalby_G1_turbine_efficiency_curve | 2 | 2023-08-14 14:33:18.030000+00:00 | 2023-07-25 19:04:28.694000+00:00 | None |
| 5 | generator:Dalby_G2 | generator:Dalby_G2_generator_efficiency_curve | Dalby_G2 | 40.0 | 1 | None | 250.0 | generator:Dalby_G2_turbine_efficiency_curve | 2 | 2023-08-14 14:33:18.030000+00:00 | 2023-07-25 19:04:28.694000+00:00 | None |
| 6 | generator:Rull1_G1 | generator:Rull1_G1_generator_efficiency_curve | Rull1_G1 | 40.0 | 1 | None | 250.0 | generator:Rull1_G1_turbine_efficiency_curve | 2 | 2023-08-14 14:33:18.030000+00:00 | 2023-07-25 19:04:28.694000+00:00 | None |
| 7 | generator:Rull1_G2 | generator:Rull1_G2_generator_efficiency_curve | Rull1_G2 | 40.0 | 2 | None | 250.0 | generator:Rull1_G2_turbine_efficiency_curve | 2 | 2023-08-14 14:33:18.030000+00:00 | 2023-07-25 19:04:28.694000+00:00 | None |
| 8 | generator:Rull2_G1 | generator:Rull2_G1_generator_efficiency_curve | Rull2_G1 | 32.0 | 1 | None | 250.0 | generator:Rull2_G1_turbine_efficiency_curve | 2 | 2023-08-14 14:33:18.030000+00:00 | 2023-07-25 19:04:28.694000+00:00 | None |
| 9 | generator:Rull2_G2 | generator:Rull2_G2_generator_efficiency_curve | Rull2_G2 | 32.0 | 2 | None | 250.0 | generator:Rull2_G2_turbine_efficiency_curve | 2 | 2023-08-14 14:33:18.030000+00:00 | 2023-07-25 19:04:28.694000+00:00 | None |
| 10 | generator:Scott_G1 | generator:Scott_G1_generator_efficiency_curve | Scott_G1 | 8.0 | 1 | None | 150.0 | generator:Scott_G1_turbine_efficiency_curve | 2 | 2023-08-14 14:33:18.030000+00:00 | 2023-07-25 19:04:28.694000+00:00 | None |
| 11 | generator:Strand_krv_G1 | generator:Strand_krv_G1_generator_efficiency_c... | Strand_krv_G1 | 4.2 | 1 | None | 150.0 | generator:Strand_krv_G1_turbine_efficiency_curve | 2 | 2023-08-14 14:33:18.030000+00:00 | 2023-07-25 19:04:28.694000+00:00 | None |
power.cog_shop1.scenarios.list(limit=5)
| external_id | commands | extra_files | mappings_override | model_template | name | version | last_updated_time | created_time | deleted_time | |
|---|---|---|---|---|---|---|---|---|---|---|
| 0 | Scenario_Fornebu_Main | Commands_Fornebu | [] | [Mapping_Scenario_Fornebu_Main_0, Mapping_Scen... | ModelTemplate_Fornebu | Scenario Fornebu Main | 4 | 2023-09-09 09:12:56.289000+00:00 | 2023-09-05 14:17:50.324000+00:00 | None |
| 1 | Scenario_Fornebu_scenario_1 | Commands_Fornebu | [] | [Mapping_Scenario_Fornebu_scenario_1_0, Mappin... | ModelTemplate_Fornebu | Scenario Fornebu <bound method ShopRun.scenari... | 9 | 2023-09-09 09:56:11.622000+00:00 | 2023-09-05 14:17:50.324000+00:00 | None |
| 2 | Scenario_Fornebu_scenario_10 | Commands_Fornebu | [] | [Mapping_Scenario_Fornebu_scenario_10_0, Mappi... | ModelTemplate_Fornebu | Scenario Fornebu scenario_10 | 1 | 2023-09-05 14:17:50.324000+00:00 | 2023-09-05 14:17:50.324000+00:00 | None |
| 3 | Scenario_Fornebu_scenario_11 | Commands_Fornebu | [] | [Mapping_Scenario_Fornebu_scenario_11_0, Mappi... | ModelTemplate_Fornebu | Scenario Fornebu scenario_11 | 1 | 2023-09-05 14:17:50.324000+00:00 | 2023-09-05 14:17:50.324000+00:00 | None |
| 4 | Scenario_Fornebu_scenario_12 | Commands_Fornebu | [] | [Mapping_Scenario_Fornebu_scenario_12_0, Mappi... | ModelTemplate_Fornebu | Scenario Fornebu scenario_12 | 1 | 2023-09-05 14:17:50.324000+00:00 | 2023-09-05 14:17:50.324000+00:00 | None |
In addition, to the configuration. You have access to trigger SHOP runs, access results of past runs through the shop API.
power.shop.runs.list()
[<ShopRun status="Status.FAILED" event_external_id="POWEROPS_SHOP_RUN_e1fcc4c6-83b4-4380-b657-7daf53776f52">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_8de3ddbf-ea36-480c-9d76-8db550af301e">, <ShopRun status="Status.FAILED" event_external_id="POWEROPS_SHOP_RUN_3efb3203-491a-4699-8fcb-923cb1a2adf2">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_beaa12b4-b113-4829-9f8d-1f1ba0552fa8">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_71ddd47c-4baf-4911-a5b8-bfba75f3ebb2">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_6670abef-4ec2-4854-859b-9ac85298dbf0">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_0155266c-c79b-4e1d-84db-5a086640a430">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_c29798e0-fe3e-4ff9-afa6-0b5a1b89006c">, <ShopRun status="Status.FAILED" event_external_id="POWEROPS_SHOP_RUN_0f2f2655-a0b0-4148-80a0-7c376d4510de">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_1ce6c057-f0f5-4ae0-b2de-dd745dcc5e85">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_e21f8682-13f1-40b6-9d44-7bee07d0e33c">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_2d95c5bb-1f62-49ac-8cce-85d387f917b2">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_7c0d19bc-379d-4147-8f5a-e66efb2c24a7">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_1c30bb11-d157-4dfb-ab5e-d480c8d08729">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_16ea42b6-36a6-4bc3-bdd5-76d35d5a3519">, <ShopRun status="Status.FAILED" event_external_id="POWEROPS_SHOP_RUN_d3564395-628f-4b92-9895-ae1b190755a5">, <ShopRun status="Status.FAILED" event_external_id="POWEROPS_SHOP_RUN_1419a883-0c08-4329-bad6-7d51d0a26a76">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_924fdf06-10bf-4d54-946d-668674a403d5">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_fd8e4ff9-d1e9-487c-98b0-8dbe13d73b4e">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_599d3a23-7df3-4f11-9a86-5aed117c0db7">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_e8bd442c-4fbf-4932-95fc-2cb577981f1d">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_ce4d0d29-67cd-4660-85d4-ec3567d17ffd">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_56af7187-da82-4a8a-a217-709918991332">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_6d1e4e04-ed65-48f3-9256-348d76c9a946">, <ShopRun status="Status.SUCCEEDED" event_external_id="POWEROPS_SHOP_RUN_cd26a531-9c2b-40e9-91a8-cdffcf82440b">]