From 7a5040f3786b634bb464c269c5846a59d80a835d Mon Sep 17 00:00:00 2001 From: MeenBna Date: Fri, 23 Feb 2024 21:23:43 +0100 Subject: [PATCH] Updated pytest tests --- notebooks/auth.ipynb | 1457 ++---------------------------------------- 1 file changed, 56 insertions(+), 1401 deletions(-) diff --git a/notebooks/auth.ipynb b/notebooks/auth.ipynb index 867592b..5064626 100644 --- a/notebooks/auth.ipynb +++ b/notebooks/auth.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -18,7 +18,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -31,20 +31,9 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Obtain the envrionment variables from .env file\n", "dotenv_path = Path(\"../.env\")\n", @@ -53,7 +42,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -67,7 +56,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -78,7 +67,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -95,27 +84,9 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[{'Idx': 0, 'Uri': 'http://opcfoundation.org/UA/'},\n", - " {'Idx': 1, 'Uri': 'http://prediktor.no/apis/ua/'},\n", - " {'Idx': 2, 'Uri': 'urn:prediktor:UIDEV-W2022-04:Scatec'},\n", - " {'Idx': 3, 'Uri': 'http://scatecsolar.com/EG-AS'},\n", - " {'Idx': 4, 'Uri': 'http://scatecsolar.com/Enterprise'},\n", - " {'Idx': 5, 'Uri': 'http://scatecsolar.com/JO-GL'},\n", - " {'Idx': 6, 'Uri': 'http://prediktor.no/PVTypes/'},\n", - " {'Idx': 7, 'Uri': 'http://powerview.com/enterprise'}]" - ] - }, - "execution_count": 14, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Listed sites on the model index api server\n", "namespaces = model_data.get_namespace_array()\n", @@ -124,166 +95,9 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
IdNameBrowseNamePropsVars
06:0:1061EquipmentEventTypeEquipmentEventType[][]
16:0:1128EnergyAndPowerMeterEventTypeEnergyAndPowerMeterEventType[][]
26:0:1263EnergyAndPowerMeterCommLossEventTypeEnergyAndPowerMeterCommLossEventType[][]
36:0:1266EnergyAndPowerMeterErrorEventTypeEnergyAndPowerMeterErrorEventType[][]
46:0:1269EnergyAndPowerMeterWarningEventTypeEnergyAndPowerMeterWarningEventType[][]
..................
2176:0:1013GridTypeGridType[][]
2186:0:1011SectionTypeSectionType[][]
2196:0:1009SiteTypeSiteType[][]
2206:0:1010SubSiteTypeSubSiteType[][]
2216:0:1012SubstationTypeSubstationType[][]
\n", - "

222 rows × 5 columns

\n", - "
" - ], - "text/plain": [ - " Id Name \\\n", - "0 6:0:1061 EquipmentEventType \n", - "1 6:0:1128 EnergyAndPowerMeterEventType \n", - "2 6:0:1263 EnergyAndPowerMeterCommLossEventType \n", - "3 6:0:1266 EnergyAndPowerMeterErrorEventType \n", - "4 6:0:1269 EnergyAndPowerMeterWarningEventType \n", - ".. ... ... \n", - "217 6:0:1013 GridType \n", - "218 6:0:1011 SectionType \n", - "219 6:0:1009 SiteType \n", - "220 6:0:1010 SubSiteType \n", - "221 6:0:1012 SubstationType \n", - "\n", - " BrowseName Props Vars \n", - "0 EquipmentEventType [] [] \n", - "1 EnergyAndPowerMeterEventType [] [] \n", - "2 EnergyAndPowerMeterCommLossEventType [] [] \n", - "3 EnergyAndPowerMeterErrorEventType [] [] \n", - "4 EnergyAndPowerMeterWarningEventType [] [] \n", - ".. ... ... ... \n", - "217 GridType [] [] \n", - "218 SectionType [] [] \n", - "219 SiteType [] [] \n", - "220 SubSiteType [] [] \n", - "221 SubstationType [] [] \n", - "\n", - "[222 rows x 5 columns]" - ] - }, - "execution_count": 15, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Types of Objects\n", "object_types_json = model_data.get_object_types()\n", @@ -293,7 +107,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -305,117 +119,9 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
IdName
06:0:1061EquipmentEventType
16:0:1128EnergyAndPowerMeterEventType
26:0:1263EnergyAndPowerMeterCommLossEventType
36:0:1266EnergyAndPowerMeterErrorEventType
46:0:1269EnergyAndPowerMeterWarningEventType
.........
1066:0:1013GridType
1076:0:1011SectionType
1086:0:1009SiteType
1096:0:1010SubSiteType
1106:0:1012SubstationType
\n", - "

111 rows × 2 columns

\n", - "
" - ], - "text/plain": [ - " Id Name\n", - "0 6:0:1061 EquipmentEventType\n", - "1 6:0:1128 EnergyAndPowerMeterEventType\n", - "2 6:0:1263 EnergyAndPowerMeterCommLossEventType\n", - "3 6:0:1266 EnergyAndPowerMeterErrorEventType\n", - "4 6:0:1269 EnergyAndPowerMeterWarningEventType\n", - ".. ... ...\n", - "106 6:0:1013 GridType\n", - "107 6:0:1011 SectionType\n", - "108 6:0:1009 SiteType\n", - "109 6:0:1010 SubSiteType\n", - "110 6:0:1012 SubstationType\n", - "\n", - "[111 rows x 2 columns]" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Unique types of Objects\n", "object_types_unique = object_types.dataframe[[\"Id\", \"Name\"]].drop_duplicates()\n", @@ -424,20 +130,9 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'6:0:1009'" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# To get typeId by type name of an object\n", "object_type_id = model_data.get_object_type_id_from_name(\"SiteType\")\n", @@ -446,20 +141,9 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['EG-AS', 'JO-GL']" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# To get the objects of a type\n", "sites_json = model_data.get_objects_of_type(\"SiteType\")\n", @@ -471,204 +155,9 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
IdTypeNameVariableIdVariableNameVariableIdSplit
03:1:Enterprise.EG-AS6:0:1009EG-AS3:1:Enterprise.EG-AS.Alarms.CommLossPlantDeviceCommLossPlantDevice{'Id': 'Enterprise.EG-AS.Alarms.CommLossPlantD...
03:1:Enterprise.EG-AS6:0:1009EG-AS3:1:Enterprise.EG-AS.Signals.PPC.IsCurtailmentPPC.IsCurtailment{'Id': 'Enterprise.EG-AS.Signals.PPC.IsCurtail...
03:1:Enterprise.EG-AS6:0:1009EG-AS3:1:Enterprise.EG-AS.Signals.State.IsDayState.IsDay{'Id': 'Enterprise.EG-AS.Signals.State.IsDay',...
03:1:Enterprise.EG-AS6:0:1009EG-AS3:1:Enterprise.EG-AS.Parameters.ContractDurationContractDuration{'Id': 'Enterprise.EG-AS.Parameters.ContractDu...
03:1:Enterprise.EG-AS6:0:1009EG-AS3:1:Enterprise.EG-AS.Parameters.RegionKeyRegionKey{'Id': 'Enterprise.EG-AS.Parameters.RegionKey'...
.....................
15:1:Enterprise.JO-GL6:0:1009JO-GL5:1:Enterprise.JO-GL.Signals.PPC.SetpointActiv...PPC.SetpointActivePower{'Id': 'Enterprise.JO-GL.Signals.PPC.SetpointA...
15:1:Enterprise.JO-GL6:0:1009JO-GL5:1:Enterprise.JO-GL.Signals.Weather.Irradiati...Weather.IrradiationDiffuseHorizontal{'Id': 'Enterprise.JO-GL.Signals.Weather.Irrad...
15:1:Enterprise.JO-GL6:0:1009JO-GL5:1:Enterprise.JO-GL.Signals.Weather.Irradiati...Weather.IrradiationHorizontal{'Id': 'Enterprise.JO-GL.Signals.Weather.Irrad...
15:1:Enterprise.JO-GL6:0:1009JO-GL5:1:Enterprise.JO-GL.Signals.Weather.Irradiati...Weather.IrradiationInCline{'Id': 'Enterprise.JO-GL.Signals.Weather.Irrad...
15:1:Enterprise.JO-GL6:0:1009JO-GL5:1:Enterprise.JO-GL.Signals.StatusStatus{'Id': 'Enterprise.JO-GL.Signals.Status', 'Nam...
\n", - "

236 rows × 6 columns

\n", - "
" - ], - "text/plain": [ - " Id Type Name \\\n", - "0 3:1:Enterprise.EG-AS 6:0:1009 EG-AS \n", - "0 3:1:Enterprise.EG-AS 6:0:1009 EG-AS \n", - "0 3:1:Enterprise.EG-AS 6:0:1009 EG-AS \n", - "0 3:1:Enterprise.EG-AS 6:0:1009 EG-AS \n", - "0 3:1:Enterprise.EG-AS 6:0:1009 EG-AS \n", - ".. ... ... ... \n", - "1 5:1:Enterprise.JO-GL 6:0:1009 JO-GL \n", - "1 5:1:Enterprise.JO-GL 6:0:1009 JO-GL \n", - "1 5:1:Enterprise.JO-GL 6:0:1009 JO-GL \n", - "1 5:1:Enterprise.JO-GL 6:0:1009 JO-GL \n", - "1 5:1:Enterprise.JO-GL 6:0:1009 JO-GL \n", - "\n", - " VariableId \\\n", - "0 3:1:Enterprise.EG-AS.Alarms.CommLossPlantDevice \n", - "0 3:1:Enterprise.EG-AS.Signals.PPC.IsCurtailment \n", - "0 3:1:Enterprise.EG-AS.Signals.State.IsDay \n", - "0 3:1:Enterprise.EG-AS.Parameters.ContractDuration \n", - "0 3:1:Enterprise.EG-AS.Parameters.RegionKey \n", - ".. ... \n", - "1 5:1:Enterprise.JO-GL.Signals.PPC.SetpointActiv... \n", - "1 5:1:Enterprise.JO-GL.Signals.Weather.Irradiati... \n", - "1 5:1:Enterprise.JO-GL.Signals.Weather.Irradiati... \n", - "1 5:1:Enterprise.JO-GL.Signals.Weather.Irradiati... \n", - "1 5:1:Enterprise.JO-GL.Signals.Status \n", - "\n", - " VariableName \\\n", - "0 CommLossPlantDevice \n", - "0 PPC.IsCurtailment \n", - "0 State.IsDay \n", - "0 ContractDuration \n", - "0 RegionKey \n", - ".. ... \n", - "1 PPC.SetpointActivePower \n", - "1 Weather.IrradiationDiffuseHorizontal \n", - "1 Weather.IrradiationHorizontal \n", - "1 Weather.IrradiationInCline \n", - "1 Status \n", - "\n", - " VariableIdSplit \n", - "0 {'Id': 'Enterprise.EG-AS.Alarms.CommLossPlantD... \n", - "0 {'Id': 'Enterprise.EG-AS.Signals.PPC.IsCurtail... \n", - "0 {'Id': 'Enterprise.EG-AS.Signals.State.IsDay',... \n", - "0 {'Id': 'Enterprise.EG-AS.Parameters.ContractDu... \n", - "0 {'Id': 'Enterprise.EG-AS.Parameters.RegionKey'... \n", - ".. ... \n", - "1 {'Id': 'Enterprise.JO-GL.Signals.PPC.SetpointA... \n", - "1 {'Id': 'Enterprise.JO-GL.Signals.Weather.Irrad... \n", - "1 {'Id': 'Enterprise.JO-GL.Signals.Weather.Irrad... \n", - "1 {'Id': 'Enterprise.JO-GL.Signals.Weather.Irrad... \n", - "1 {'Id': 'Enterprise.JO-GL.Signals.Status', 'Nam... \n", - "\n", - "[236 rows x 6 columns]" - ] - }, - "execution_count": 20, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Analytics helper\n", "sites.variables_as_dataframe()" @@ -676,40 +165,18 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "['5:1:Enterprise.JO-GL', '3:1:Enterprise.EG-AS']" - ] - }, - "execution_count": 21, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "sites.list_of_ids()" ] }, { "cell_type": "code", - "execution_count": 22, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "'3:1:Enterprise.EG-AS'" - ] - }, - "execution_count": 22, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Selecting the single site\n", "site_id = sites.list_of_ids()[1]\n", @@ -718,179 +185,9 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
IdNameTypePropsVars
03:1:Enterprise.EG-AS.S1.Z5.TS01.I01.SM01.CH01EG-AS-TS01-I01-SM01-CH01StringSetType[{'DisplayName': 'ChannelNo', 'Value': '1'}, {...[{'DisplayName': 'StringDisconnected', 'Id': '...
13:1:Enterprise.EG-AS.S1.Z5.TS01.I01.SM01.CH02EG-AS-TS01-I01-SM01-CH02StringSetType[{'DisplayName': 'ChannelNo', 'Value': '2'}, {...[{'DisplayName': 'StringDisconnected', 'Id': '...
23:1:Enterprise.EG-AS.S1.Z5.TS01.I01.SM01.CH03EG-AS-TS01-I01-SM01-CH03StringSetType[{'DisplayName': 'ChannelNo', 'Value': '3'}, {...[{'DisplayName': 'StringDisconnected', 'Id': '...
33:1:Enterprise.EG-AS.S1.Z5.TS01.I01.SM01.CH04EG-AS-TS01-I01-SM01-CH04StringSetType[{'DisplayName': 'ChannelNo', 'Value': '4'}, {...[{'DisplayName': 'StringDisconnected', 'Id': '...
43:1:Enterprise.EG-AS.S1.Z5.TS01.I01.SM01.CH05EG-AS-TS01-I01-SM01-CH05StringSetType[{'DisplayName': 'ChannelNo', 'Value': '5'}, {...[{'DisplayName': 'StringDisconnected', 'Id': '...
..................
29333:1:Enterprise.EG-AS.S1.Z1.TS11.I22.SM13.CH05EG-AS-TS11-I22-SM13-CH05StringSetType[{'DisplayName': 'ChannelNo', 'Value': '5'}, {...[{'DisplayName': 'StringDisconnected', 'Id': '...
29343:1:Enterprise.EG-AS.S1.Z1.TS11.I22.SM13.CH06EG-AS-TS11-I22-SM13-CH06StringSetType[{'DisplayName': 'ChannelNo', 'Value': '6'}, {...[{'DisplayName': 'StringDisconnected', 'Id': '...
29353:1:Enterprise.EG-AS.S1.Z1.TS11.I22.SM13.CH07EG-AS-TS11-I22-SM13-CH07StringSetType[{'DisplayName': 'ChannelNo', 'Value': '7'}, {...[{'DisplayName': 'StringDisconnected', 'Id': '...
29363:1:Enterprise.EG-AS.S1.Z1.TS11.I22.SM13.CH08EG-AS-TS11-I22-SM13-CH08StringSetType[{'DisplayName': 'ChannelNo', 'Value': '8'}, {...[{'DisplayName': 'StringDisconnected', 'Id': '...
29373:1:Enterprise.EG-AS.S1.Z1.TS11.I22.SM13.CH09EG-AS-TS11-I22-SM13-CH09StringSetType[{'DisplayName': 'ChannelNo', 'Value': '9'}, {...[{'DisplayName': 'StringDisconnected', 'Id': '...
\n", - "

2938 rows × 5 columns

\n", - "
" - ], - "text/plain": [ - " Id Name \\\n", - "0 3:1:Enterprise.EG-AS.S1.Z5.TS01.I01.SM01.CH01 EG-AS-TS01-I01-SM01-CH01 \n", - "1 3:1:Enterprise.EG-AS.S1.Z5.TS01.I01.SM01.CH02 EG-AS-TS01-I01-SM01-CH02 \n", - "2 3:1:Enterprise.EG-AS.S1.Z5.TS01.I01.SM01.CH03 EG-AS-TS01-I01-SM01-CH03 \n", - "3 3:1:Enterprise.EG-AS.S1.Z5.TS01.I01.SM01.CH04 EG-AS-TS01-I01-SM01-CH04 \n", - "4 3:1:Enterprise.EG-AS.S1.Z5.TS01.I01.SM01.CH05 EG-AS-TS01-I01-SM01-CH05 \n", - "... ... ... \n", - "2933 3:1:Enterprise.EG-AS.S1.Z1.TS11.I22.SM13.CH05 EG-AS-TS11-I22-SM13-CH05 \n", - "2934 3:1:Enterprise.EG-AS.S1.Z1.TS11.I22.SM13.CH06 EG-AS-TS11-I22-SM13-CH06 \n", - "2935 3:1:Enterprise.EG-AS.S1.Z1.TS11.I22.SM13.CH07 EG-AS-TS11-I22-SM13-CH07 \n", - "2936 3:1:Enterprise.EG-AS.S1.Z1.TS11.I22.SM13.CH08 EG-AS-TS11-I22-SM13-CH08 \n", - "2937 3:1:Enterprise.EG-AS.S1.Z1.TS11.I22.SM13.CH09 EG-AS-TS11-I22-SM13-CH09 \n", - "\n", - " Type Props \\\n", - "0 StringSetType [{'DisplayName': 'ChannelNo', 'Value': '1'}, {... \n", - "1 StringSetType [{'DisplayName': 'ChannelNo', 'Value': '2'}, {... \n", - "2 StringSetType [{'DisplayName': 'ChannelNo', 'Value': '3'}, {... \n", - "3 StringSetType [{'DisplayName': 'ChannelNo', 'Value': '4'}, {... \n", - "4 StringSetType [{'DisplayName': 'ChannelNo', 'Value': '5'}, {... \n", - "... ... ... \n", - "2933 StringSetType [{'DisplayName': 'ChannelNo', 'Value': '5'}, {... \n", - "2934 StringSetType [{'DisplayName': 'ChannelNo', 'Value': '6'}, {... \n", - "2935 StringSetType [{'DisplayName': 'ChannelNo', 'Value': '7'}, {... \n", - "2936 StringSetType [{'DisplayName': 'ChannelNo', 'Value': '8'}, {... \n", - "2937 StringSetType [{'DisplayName': 'ChannelNo', 'Value': '9'}, {... \n", - "\n", - " Vars \n", - "0 [{'DisplayName': 'StringDisconnected', 'Id': '... \n", - "1 [{'DisplayName': 'StringDisconnected', 'Id': '... \n", - "2 [{'DisplayName': 'StringDisconnected', 'Id': '... \n", - "3 [{'DisplayName': 'StringDisconnected', 'Id': '... \n", - "4 [{'DisplayName': 'StringDisconnected', 'Id': '... \n", - "... ... \n", - "2933 [{'DisplayName': 'StringDisconnected', 'Id': '... \n", - "2934 [{'DisplayName': 'StringDisconnected', 'Id': '... \n", - "2935 [{'DisplayName': 'StringDisconnected', 'Id': '... \n", - "2936 [{'DisplayName': 'StringDisconnected', 'Id': '... \n", - "2937 [{'DisplayName': 'StringDisconnected', 'Id': '... \n", - "\n", - "[2938 rows x 5 columns]" - ] - }, - "execution_count": 23, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Get all stringsets for one park\n", "string_sets_for_first_park_as_json = model_data.get_object_descendants(\n", @@ -902,204 +199,9 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
IdNameTypeVariableIdVariableNameVariableIdSplit
03:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001EG-AS-TR-TB01.TR001TrackerType3:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001....TrackerOutOfPos{'Id': 'Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR...
03:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001EG-AS-TR-TB01.TR001TrackerType3:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001....State.HasHighSeverityAlarm{'Id': 'Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR...
03:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001EG-AS-TR-TB01.TR001TrackerType3:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001....State.HasMediumSeverityAlarm{'Id': 'Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR...
03:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001EG-AS-TR-TB01.TR001TrackerType3:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001....State.HasLowSeverityAlarm{'Id': 'Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR...
03:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001EG-AS-TR-TB01.TR001TrackerType3:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001....CommLoss{'Id': 'Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR...
.....................
58713:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178EG-AS-TR-TB11.TR178TrackerType3:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178....TrackingLimitWestAngle{'Id': 'Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR...
58713:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178EG-AS-TR-TB11.TR178TrackerType3:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178....MotorPressure{'Id': 'Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR...
58713:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178EG-AS-TR-TB11.TR178TrackerType3:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178....Category{'Id': 'Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR...
58713:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178EG-AS-TR-TB11.TR178TrackerType3:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178....StateCode{'Id': 'Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR...
58713:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178EG-AS-TR-TB11.TR178TrackerType3:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178....Status{'Id': 'Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR...
\n", - "

111568 rows × 6 columns

\n", - "
" - ], - "text/plain": [ - " Id Name \\\n", - "0 3:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001 EG-AS-TR-TB01.TR001 \n", - "0 3:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001 EG-AS-TR-TB01.TR001 \n", - "0 3:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001 EG-AS-TR-TB01.TR001 \n", - "0 3:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001 EG-AS-TR-TB01.TR001 \n", - "0 3:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001 EG-AS-TR-TB01.TR001 \n", - "... ... ... \n", - "5871 3:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178 EG-AS-TR-TB11.TR178 \n", - "5871 3:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178 EG-AS-TR-TB11.TR178 \n", - "5871 3:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178 EG-AS-TR-TB11.TR178 \n", - "5871 3:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178 EG-AS-TR-TB11.TR178 \n", - "5871 3:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178 EG-AS-TR-TB11.TR178 \n", - "\n", - " Type VariableId \\\n", - "0 TrackerType 3:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.... \n", - "0 TrackerType 3:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.... \n", - "0 TrackerType 3:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.... \n", - "0 TrackerType 3:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.... \n", - "0 TrackerType 3:1:Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.... \n", - "... ... ... \n", - "5871 TrackerType 3:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178.... \n", - "5871 TrackerType 3:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178.... \n", - "5871 TrackerType 3:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178.... \n", - "5871 TrackerType 3:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178.... \n", - "5871 TrackerType 3:1:Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR178.... \n", - "\n", - " VariableName \\\n", - "0 TrackerOutOfPos \n", - "0 State.HasHighSeverityAlarm \n", - "0 State.HasMediumSeverityAlarm \n", - "0 State.HasLowSeverityAlarm \n", - "0 CommLoss \n", - "... ... \n", - "5871 TrackingLimitWestAngle \n", - "5871 MotorPressure \n", - "5871 Category \n", - "5871 StateCode \n", - "5871 Status \n", - "\n", - " VariableIdSplit \n", - "0 {'Id': 'Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR... \n", - "0 {'Id': 'Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR... \n", - "0 {'Id': 'Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR... \n", - "0 {'Id': 'Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR... \n", - "0 {'Id': 'Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR... \n", - "... ... \n", - "5871 {'Id': 'Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR... \n", - "5871 {'Id': 'Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR... \n", - "5871 {'Id': 'Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR... \n", - "5871 {'Id': 'Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR... \n", - "5871 {'Id': 'Enterprise.EG-AS.S1.MMSTB11.TR-TB11.TR... \n", - "\n", - "[111568 rows x 6 columns]" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Ancestors of an object type, get all trackers that are ancestor of the parks string sets\n", "\n", @@ -1119,27 +221,9 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "[{'Id': 'Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Signals.AngleMeasured',\n", - " 'Namespace': 3,\n", - " 'IdType': 1,\n", - " 'Timestamp': '2024-02-22T09:26:12.4136116Z',\n", - " 'Value': -3.7381437,\n", - " 'ValueType': 'Float',\n", - " 'StatusCode': None,\n", - " 'StatusSymbol': None}]" - ] - }, - "execution_count": 25, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Live value data of trackers\n", "live_value = opc_data.get_values(\n", @@ -1150,376 +234,9 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "C:\\Users\\meena.bana\\OneDrive - TGS Prediktor AS\\Dokumenter\\git_repos\\pyPrediktorMapClient\\src\\pyprediktormapclient\\opc_ua.py:375: FutureWarning: Setting an item of incompatible dtype is deprecated and will raise an error in a future version of pandas. Value 'Double' has dtype incompatible with int64, please explicitly cast to a compatible dtype first.\n", - " df_result.at[i, \"Value.Type\"] = self._get_value_type(int(row[\"Value.Type\"])).get(\n" - ] - }, - { - "data": { - "text/html": [ - "
\n", - "\n", - "\n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - " \n", - "
TimestampValueTypeValueStatusCodeStatusSymbolIdHistoryReadResults.NodeId.IdNamespace
02024-01-23T10:26:41ZDouble23.4922561Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
12024-01-23T11:26:41ZDouble40.1137581Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
22024-01-23T12:26:41ZDouble45.1106861Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
32024-01-23T13:26:41ZDouble29.9328671Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
42024-01-23T14:26:41ZDouble9.1471301Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
52024-01-23T15:26:41ZDouble11.2049421Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
62024-01-23T16:26:41ZDouble11.1468121Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
72024-01-23T17:26:41ZDouble11.1097651Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
82024-01-23T18:26:41ZDouble11.1024631083506689UncertainSubNormal1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
92024-01-23T19:26:41ZDouble11.0703521Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
102024-01-23T20:26:41ZDouble11.0314541Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
112024-01-23T21:26:41ZDouble11.0043041Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
122024-01-23T22:26:41ZDouble10.9671361Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
132024-01-23T23:26:41ZDouble10.9375251Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
142024-01-24T00:26:41ZDouble10.9304741083506689UncertainSubNormal1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
152024-01-24T01:26:41ZDouble10.9054671Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
162024-01-24T02:26:41ZDouble10.8897531Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
172024-01-24T03:26:41ZDouble5.6092791Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
182024-01-24T04:26:41ZDouble-14.1641041Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
192024-01-24T05:26:41ZDouble-39.8796431Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
202024-01-24T06:26:41ZDouble-43.6177651Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
212024-01-24T07:26:41ZDouble-30.0878041Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
222024-01-24T08:26:41ZDouble-12.0998491Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
232024-01-24T09:26:41ZDouble5.7943081Good1Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign...3
\n", - "
" - ], - "text/plain": [ - " Timestamp ValueType Value StatusCode StatusSymbol \\\n", - "0 2024-01-23T10:26:41Z Double 23.492256 1 Good \n", - "1 2024-01-23T11:26:41Z Double 40.113758 1 Good \n", - "2 2024-01-23T12:26:41Z Double 45.110686 1 Good \n", - "3 2024-01-23T13:26:41Z Double 29.932867 1 Good \n", - "4 2024-01-23T14:26:41Z Double 9.147130 1 Good \n", - "5 2024-01-23T15:26:41Z Double 11.204942 1 Good \n", - "6 2024-01-23T16:26:41Z Double 11.146812 1 Good \n", - "7 2024-01-23T17:26:41Z Double 11.109765 1 Good \n", - "8 2024-01-23T18:26:41Z Double 11.102463 1083506689 UncertainSubNormal \n", - "9 2024-01-23T19:26:41Z Double 11.070352 1 Good \n", - "10 2024-01-23T20:26:41Z Double 11.031454 1 Good \n", - "11 2024-01-23T21:26:41Z Double 11.004304 1 Good \n", - "12 2024-01-23T22:26:41Z Double 10.967136 1 Good \n", - "13 2024-01-23T23:26:41Z Double 10.937525 1 Good \n", - "14 2024-01-24T00:26:41Z Double 10.930474 1083506689 UncertainSubNormal \n", - "15 2024-01-24T01:26:41Z Double 10.905467 1 Good \n", - "16 2024-01-24T02:26:41Z Double 10.889753 1 Good \n", - "17 2024-01-24T03:26:41Z Double 5.609279 1 Good \n", - "18 2024-01-24T04:26:41Z Double -14.164104 1 Good \n", - "19 2024-01-24T05:26:41Z Double -39.879643 1 Good \n", - "20 2024-01-24T06:26:41Z Double -43.617765 1 Good \n", - "21 2024-01-24T07:26:41Z Double -30.087804 1 Good \n", - "22 2024-01-24T08:26:41Z Double -12.099849 1 Good \n", - "23 2024-01-24T09:26:41Z Double 5.794308 1 Good \n", - "\n", - " Id HistoryReadResults.NodeId.Id Namespace \n", - "0 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "1 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "2 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "3 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "4 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "5 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "6 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "7 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "8 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "9 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "10 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "11 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "12 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "13 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "14 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "15 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "16 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "17 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "18 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "19 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "20 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "21 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "22 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 \n", - "23 1 Enterprise.EG-AS.S1.MMSTB01.TR-TB01.TR001.Sign... 3 " - ] - }, - "execution_count": 26, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Historic value data of trackers, 1 days worth of data 30 days ago\n", "one_day_historic_tracker_data = opc_data.get_historical_aggregated_values(\n", @@ -1541,7 +258,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1553,7 +270,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1566,7 +283,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1578,7 +295,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1597,7 +314,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1607,7 +324,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1655,7 +372,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1670,7 +387,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1694,28 +411,9 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Getting login ID...\n", - "Response for login ID: {'id': 'dca8c4f3-2d41-4869-8a27-7480007d8064', 'oauth2_login_challenge': None, 'type': 'api', 'expires_at': '2024-02-22T09:37:22.670330564Z', 'issued_at': '2024-02-22T09:27:22.670330564Z', 'request_url': 'https://kratos.qa.powerview.io/self-service/login/api', 'ui': {'action': 'https://kratos.qa.powerview.io/self-service/login?flow=dca8c4f3-2d41-4869-8a27-7480007d8064', 'method': 'POST', 'nodes': [{'type': 'input', 'group': 'default', 'attributes': {'name': 'csrf_token', 'type': 'hidden', 'value': '', 'required': True, 'disabled': False, 'node_type': 'input'}, 'messages': [], 'meta': {}}, {'type': 'input', 'group': 'default', 'attributes': {'name': 'identifier', 'type': 'text', 'value': '', 'required': True, 'disabled': False, 'node_type': 'input'}, 'messages': [], 'meta': {'label': {'id': 1070004, 'text': 'ID', 'type': 'info'}}}, {'type': 'input', 'group': 'password', 'attributes': {'name': 'password', 'type': 'password', 'required': True, 'autocomplete': 'current-password', 'disabled': False, 'node_type': 'input'}, 'messages': [], 'meta': {'label': {'id': 1070001, 'text': 'Password', 'type': 'info'}}}, {'type': 'input', 'group': 'password', 'attributes': {'name': 'method', 'type': 'submit', 'value': 'password', 'disabled': False, 'node_type': 'input'}, 'messages': [], 'meta': {'label': {'id': 1010001, 'text': 'Sign in', 'type': 'info', 'context': {}}}}]}, 'created_at': '2024-02-22T09:27:22.67253Z', 'updated_at': '2024-02-22T09:27:22.67253Z', 'refresh': False, 'requested_aal': 'aal1'}\n" - ] - }, - { - "data": { - "text/plain": [ - "'dca8c4f3-2d41-4869-8a27-7480007d8064'" - ] - }, - "execution_count": 35, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "id = get_login_id(content)\n", "id" @@ -1723,7 +421,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1733,7 +431,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1750,7 +448,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1783,18 +481,9 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Getting login token...\n", - "Response for login token: {'session_token': 'ory_st_iFqIcvXz0Mq7m2GaPdeCK54xMb36R3zx', 'session': {'id': '738f383c-5272-4ec9-a2fa-60ed56156f21', 'active': True, 'expires_at': '2024-02-22T11:44:07.555758254Z', 'authenticated_at': '2024-02-21T11:44:07.555758254Z', 'authenticator_assurance_level': 'aal1', 'authentication_methods': [{'method': 'password', 'aal': 'aal1', 'completed_at': '2024-02-21T11:44:07.555754507Z'}], 'issued_at': '2024-02-21T11:44:07.555758254Z', 'identity': {'id': 'a97539e1-77fb-4f3c-b8c2-8aeb5aacc605', 'schema_id': 'default', 'schema_url': 'https://kratos.qa.powerview.io/schemas/ZGVmYXVsdA', 'state': 'active', 'state_changed_at': '2024-02-20T12:27:28.367035Z', 'traits': {'email': 'api_test@prediktor.com'}, 'verifiable_addresses': [{'id': 'de3233ee-c2d7-4253-b4c6-ffada0aaf858', 'value': 'api_test@prediktor.com', 'verified': False, 'via': 'email', 'status': 'pending', 'created_at': '2024-02-20T12:27:28.375424Z', 'updated_at': '2024-02-20T12:27:28.375424Z'}], 'recovery_addresses': [{'id': '49e0718a-8acf-49a7-9626-a830b6210eac', 'value': 'api_test@prediktor.com', 'via': 'email', 'created_at': '2024-02-20T12:27:28.380892Z', 'updated_at': '2024-02-20T12:27:28.380892Z'}], 'metadata_public': None, 'created_at': '2024-02-20T12:27:28.369042Z', 'updated_at': '2024-02-20T12:27:28.369042Z'}, 'devices': [{'id': 'f3c31b1a-a4ba-4f1b-8bc1-51a0ecffa45d', 'ip_address': '81.166.54.38', 'user_agent': 'python-requests/2.31.0', 'location': ''}]}}\n" - ] - } - ], + "outputs": [], "source": [ "token = get_login_token(content)\n", "token" @@ -1802,7 +491,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1817,40 +506,18 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "True" - ] - }, - "execution_count": 36, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "check_if_token_has_expired()" ] }, { "cell_type": "code", - "execution_count": 37, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 37, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "model_data = ModelIndex(url=model_index_url, auth_client=token)\n", "model_data" @@ -1858,7 +525,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -1875,21 +542,9 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'error': 'Non-JSON response',\n", - " 'content': '\\n\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n\\t\\t\\t\\t\\n\\t\\t\\t\\t\\n \\n Power Hub\\n \\n \\n \\n \\n \\n
\\n \\n \\n\\n'}" - ] - }, - "execution_count": 39, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "# Listed sites on the model index api server\n", "namespaces = model_data.get_namespace_array()\n", @@ -1898,7 +553,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": null, "metadata": {}, "outputs": [], "source": [