Commit d8bddf45 authored by dasharatha.vamshi's avatar dasharatha.vamshi

update

parent 7d6cc331
from scripts.constants.app_configuration import METADATA
from scripts.constants.app_configuration import METADATA, POSTGRES_URI
from scripts.core.utils.compliance_util import Compliance
from scripts.core.utils.timestamp_util import get_timestamps
from loguru import logger
......@@ -26,5 +26,5 @@ if __name__ == '__main__':
day_df = obj.start_calculation(all_timestamps)
final_df_list.append(day_df)
df = pd.concat(final_df_list)
df.to_csv('overall-compliance.csv',index=False)
# df.set_index('client_name').to_sql("project_compliance", POSTGRES_URI, if_exists='replace')
# df.to_csv('overall-compliance.csv', index=False)
......@@ -84,7 +84,7 @@ metadata:
AC20 Generation Section A:
client: "Jubilant"
site: "AC20 Generation Section A"
site: "AC20"
project_name: "Golden Batch for AC20 Generation Section A"
compliance_percentage: 50
start_date: "2022-08-01"
......@@ -181,7 +181,7 @@ metadata:
AC20 Generation Section B:
client: "Jubilant"
site: "AC20 Generation Section B"
site: "AC20"
project_name: "Golden Batch for AC20 Generation Section B"
compliance_percentage: 50
start_date: "2022-08-01"
......@@ -270,7 +270,7 @@ metadata:
AC20 Distillation Section:
client: "Jubilant"
site: "AC20 Distillation Section"
site: "AC20"
project_name: "Golden Batch for AC20 Distillation Section"
compliance_percentage: 50
start_date: "2022-08-01"
......@@ -311,7 +311,7 @@ metadata:
CTCMP R7205:
client: "Jubilant"
site: "CTCMP R7205"
site: "CTCMP"
project_name: "Golden Batch for CTCMP R7205"
compliance_percentage: 50
start_date: "2022-08-01"
......@@ -348,7 +348,7 @@ metadata:
CTCMP R7204:
client: "Jubilant"
site: "CTCMP R7204"
site: "CTCMP"
project_name: "Golden Batch for CTCMP R7204"
compliance_percentage: 50
start_date: "2022-08-01"
......@@ -381,7 +381,7 @@ metadata:
CTCMP R7203:
client: "Jubilant"
site: "CTCMP R7203"
site: "CTCMP"
project_name: "Golden Batch for CTCMP R7203"
compliance_percentage: 50
start_date: "2022-08-01"
......
KAIROS_URI= https://iLens:iLensJUB$456@jub-kairos.ilens.io/kairos
POSTGRES_URI = postgresql://iLens:iLensJUB$456@jubilant.ilens.io/kairos
\ No newline at end of file
POSTGRES_URI = postgresql://ilensread:UnifyTwin#098@192.168.0.207:5433/ilens_ai
\ No newline at end of file
Super Heater E-2104A.Inlet Flow_compliance,Feed Super Heater E-2201A.MP Steam Flow_compliance,Crude Column Reboiler E-2410.Inlet HP Steam Flow_compliance,Reactor R-2201A.Flow Control_compliance,Super Heater E-2101A.Steam Flow_compliance,Reactor R-2201A.Top Dome Temperature_compliance,Primary Absorber Column C-2201.Outlet Temperature_compliance,Oil Separator Cooler V-2205A.Temperature_compliance,Oil Evaporator E-2206B.Inlet Temperature_compliance,Vaporizer E-2103A.Temperature_compliance,Vaporizer E-2706.EHP Flow_compliance,Reactor R-2201A.Outlet 5245CM Temperature_compliance,timestamp
False,False,False,False,False,False,True,False,False,False,False,False,2022-08-26 15:30:00+05:30
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
timestamp,Primary Absorber Column C-2201.Outlet Temperature_live,Primary Absorber Column C-2201.Outlet Temperature_upper,Primary Absorber Column C-2201.Outlet Temperature_lower,Oil Separator Cooler V-2205A.Temperature_live,Oil Separator Cooler V-2205A.Temperature_upper,Oil Separator Cooler V-2205A.Temperature_lower,Oil Evaporator E-2206B.Inlet Temperature_live,Oil Evaporator E-2206B.Inlet Temperature_upper,Oil Evaporator E-2206B.Inlet Temperature_lower,Vaporizer E-2103A.Temperature_live,Vaporizer E-2103A.Temperature_upper,Vaporizer E-2103A.Temperature_lower,Super Heater E-2104A.Inlet Flow_live,Super Heater E-2104A.Inlet Flow_upper,Super Heater E-2104A.Inlet Flow_lower,Feed Super Heater E-2201A.MP Steam Flow_live,Feed Super Heater E-2201A.MP Steam Flow_upper,Feed Super Heater E-2201A.MP Steam Flow_lower,Super Heater E-2101A.Steam Flow_live,Super Heater E-2101A.Steam Flow_upper,Super Heater E-2101A.Steam Flow_lower,Vaporizer E-2706.EHP Flow_live,Vaporizer E-2706.EHP Flow_upper,Vaporizer E-2706.EHP Flow_lower,Reactor R-2201A.Flow Control_live,Reactor R-2201A.Top Dome Temperature_live,Reactor R-2201A.Outlet 5245CM Temperature_live,Reactor R-2201A.Flow Control_upper,Reactor R-2201A.Top Dome Temperature_upper,Reactor R-2201A.Outlet 5245CM Temperature_upper,Reactor R-2201A.Flow Control_lower,Reactor R-2201A.Top Dome Temperature_lower,Reactor R-2201A.Outlet 5245CM Temperature_lower,Crude Column Reboiler E-2410.Inlet HP Steam Flow_live,Crude Column Reboiler E-2410.Inlet HP Steam Flow_upper,Crude Column Reboiler E-2410.Inlet HP Steam Flow_lower,epoch_time
2022-12-07 07:15:00+05:30,19.101756082432434,,,30.39834877432433,,,24.140347670270263,,,22.83383551351351,,,0.0,,,0.0,,,0.0,,,62.761043462162135,,,0.0,29.99570714054055,32.758025444594594,,,,,,,0.0,,,1670377500000
2022-12-07 07:00:00+05:30,19.187453203305783,,,30.43466980826446,,,24.1701696892562,,,22.911828772727286,,,0.0,,,0.0,,,0.0,,,62.35736154754101,,,0.0,30.019925621311465,32.76577621557378,,,,,,,0.0,,,1670376600000
2022-12-07 07:15:00+05:30,19.125298350282492,,,30.41472187344632,,,24.150561281920908,,,22.85126828022598,,,0.0,,,0.0,,,0.0,,,63.23192134124293,,,0.0,30.00282529378531,32.76156185254236,,,,,,,0.0,,,1670377500000
2022-12-07 07:30:00+05:30,19.061943155056188,,,30.37642702865171,,,24.123851144943814,,,22.788119983146085,,,0.0,,,0.0,,,0.0,,,63.71800593426965,,,0.0,29.946982270786517,32.757472487640456,,,,,,,0.0,,,1670378400000
2022-12-07 07:45:00+05:30,19.024082801123594,,,30.356834988202248,,,24.10972226797754,,,22.724339702247185,,,0.0,,,0.0,,,0.0,,,66.34418585280896,,,0.0,29.900133879213474,32.73152019325841,,,,,,,0.0,,,1670379300000
2022-12-07 08:00:00+05:30,19.02822954469274,,,30.32274903743015,,,24.090080222905016,,,22.661280907821233,,,0.0,,,0.0,,,0.0,,,63.231763395530756,,,0.0,29.807492805027916,32.694486731843575,,,,,,,0.0,,,1670380200000
......
This diff is collapsed.
This diff is collapsed.
client,site,project_name,time,compliance,day
client_name,site_name,project_name,time,compliance,day
Jubilant,3CP,Golden Batch for 3CP,2022-08-26 15:30:00+05:30,0,2022-08-26
Jubilant,3CP,Golden Batch for 3CP,2022-08-31 00:00:00+05:30,0,2022-08-31
Jubilant,3CP,Golden Batch for 3CP,2022-08-31 00:15:00+05:30,0,2022-08-31
......
......@@ -646,8 +646,8 @@ timestamp,Bharuch-Unit 4.AC2O.Anhydride Distillation Section.Column C-2042.Feed
2022-12-14 01:00:00+05:30,5803.945099245284,-588.0292670000001,-580.905009018868,0.0,5.225413210000001,,,,,,,,,,,-30.26819522291667,,,160070.1162641509,,,277.1072966458333,,,1670959800000
2022-12-14 01:15:00+05:30,5804.17791975,-587.6054719500003,-580.3701234999996,0.0,5.388908377000001,,,,,,,,,,,-30.27080903414634,,,160059.73830000003,,,279.38672831707316,,,1670960700000
2022-12-14 01:30:00+05:30,5804.457860208334,-587.2436877500005,-579.9669557708335,0.0,5.356740306458335,,,,,,,,,,,-30.349199031111105,,,160067.34768749998,,,279.73822786666665,,,1670961600000
2022-12-14 01:45:00+05:30,5803.405244509802,-586.5847852352939,-580.0203416470586,0.0,5.2043804181568625,26.0,5802.0,-502.0,-111.0,35.0,5803.0,-497.0,-34.0,-486.0,-480.0,-30.325555935714284,2349.0,2733.0,160062.3979215686,160062.0,160063.0,280.37212790476195,256.0,254.0,1670962500000
2022-12-14 02:00:00+05:30,5802.963315060241,-586.0793446867472,-580.1167620963851,0.0,5.44738990180723,,,,,,,,,,,-30.273074752,,,160065.53209638558,,,279.8664452533333,,,1670963400000
2022-12-14 01:45:00+05:30,5803.360572733812,-586.5340209568346,-580.0483368992805,0.0,5.336698019107914,26.0,5802.0,-502.0,-111.0,35.0,5803.0,-497.0,-34.0,-486.0,-480.0,-30.28288862058825,2349.0,2733.0,160065.12584172664,160062.0,160063.0,279.8839313970588,256.0,254.0,1670962500000
2022-12-14 02:00:00+05:30,5802.930929617487,-586.1092632841526,-580.0942064316949,0.0,5.452672064153004,,,,,,,,,,,-30.265759423204408,,,160068.4897049181,,,279.8318984585636,,,1670963400000
2022-12-14 02:15:00+05:30,5802.700761222221,-585.9297454666664,-579.2617755555564,0.0,5.448722323777777,,,,,,,,,,,-30.37919001758242,,,160066.4405388889,,,279.72017923626373,,,1670964300000
2022-12-14 02:30:00+05:30,5802.612905375721,-586.2687173179188,-579.3757626705191,0.0,5.447972649364158,,,,,,,,,,,-30.381724230232578,,,160064.21342196537,,,279.37936188372083,,,1670965200000
2022-12-14 02:45:00+05:30,5802.382608176801,-586.5542373756901,-579.6309432817676,0.0,5.522530425580111,26.0,5801.0,-502.0,-111.0,35.0,5802.0,-497.0,-34.0,-486.0,-480.0,-30.253581927777773,2349.0,2733.0,160066.08648066295,160063.0,160064.0,279.3395328555554,256.0,254.0,1670966100000
......
Bharuch-Unit 4.AC2O.Anhydride Distillation Section.Column C-2042.Feed flow_compliance,Bharuch-Unit 4.AC2O.Anhydride Distillation Section.Column C-2042.Top Pressure_compliance,Bharuch-Unit 4.AC2O.Anhydride Distillation Section.Reboiler E-2043B.Steam Flow_compliance,Bharuch-Unit 4.AC2O.Anhydride Distillation Section.Storage Tank T-2104B.Level(Kg)_compliance,Bharuch-Unit 4.AC2O.Anhydride Distillation Section.Tank T-2104C.Pressure mmH2O_compliance,Bharuch-Unit 4.AC2O.Anhydride Distillation Section.Column C-2042.Pressure 1 (mmHg)_compliance,Bharuch-Unit 4.AC2O.Anhydride Distillation Section.Column C-2042.Bottom Level CV_compliance,Bharuch-Unit 4.AC2O.Anhydride Distillation Section.Column C-2042.Delta Pressure 4_compliance,timestamp
True,False,False,False,False,False,False,False,2022-12-29 00:45:00+05:30
True,False,False,True,False,False,False,False,2022-12-29 01:45:00+05:30
True,False,False,True,False,False,False,False,2022-12-29 02:45:00+05:30
True,False,False,True,False,False,False,False,2022-12-29 03:45:00+05:30
False,False,False,True,False,False,False,False,2022-12-29 04:45:00+05:30
False,False,False,True,False,False,False,False,2022-12-29 05:45:00+05:30
False,False,False,True,False,False,False,False,2022-12-29 06:45:00+05:30
False,False,False,True,False,False,False,False,2022-12-29 07:45:00+05:30
False,False,False,True,False,False,False,False,2022-12-29 08:45:00+05:30
True,False,False,True,False,False,False,False,2022-12-29 09:45:00+05:30
True,False,False,False,False,False,False,False,2022-12-29 10:45:00+05:30
True,False,False,False,False,False,False,False,2022-12-29 11:45:00+05:30
True,False,True,True,False,False,False,False,2022-12-29 12:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-29 13:45:00+05:30
True,False,True,False,False,False,True,False,2022-12-29 14:45:00+05:30
True,False,True,False,False,False,True,False,2022-12-29 15:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-29 16:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-29 17:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-29 18:45:00+05:30
True,False,True,True,False,False,True,False,2022-12-29 19:45:00+05:30
True,False,True,False,False,False,True,False,2022-12-29 20:45:00+05:30
True,False,True,False,False,False,True,True,2022-12-29 21:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-29 22:45:00+05:30
True,False,True,False,False,False,True,False,2022-12-29 23:45:00+05:30
True,False,True,False,False,False,True,False,2022-12-30 00:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-30 01:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-30 03:45:00+05:30
True,False,True,False,False,False,True,False,2022-12-30 04:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-30 05:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-30 06:45:00+05:30
True,True,True,False,False,False,True,False,2022-12-30 07:45:00+05:30
False,False,True,True,False,False,True,False,2022-12-30 08:45:00+05:30
False,False,True,False,False,False,True,True,2022-12-30 09:45:00+05:30
True,False,True,False,False,False,True,False,2022-12-30 10:45:00+05:30
False,False,True,False,False,False,True,True,2022-12-30 11:45:00+05:30
True,False,True,False,False,False,True,False,2022-12-30 12:45:00+05:30
True,False,True,False,False,False,True,False,2022-12-30 13:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-30 14:45:00+05:30
False,False,True,True,False,False,True,False,2022-12-30 15:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-30 16:45:00+05:30
True,False,True,False,False,False,True,False,2022-12-30 17:45:00+05:30
True,False,True,False,False,False,True,False,2022-12-30 18:45:00+05:30
True,False,True,False,False,False,True,False,2022-12-30 19:45:00+05:30
False,False,True,False,False,False,False,False,2022-12-30 20:45:00+05:30
True,False,True,True,False,False,True,False,2022-12-30 21:45:00+05:30
True,False,True,False,False,False,False,False,2022-12-30 22:45:00+05:30
False,False,True,True,False,False,False,False,2022-12-30 23:45:00+05:30
True,False,True,True,False,False,True,False,2022-12-31 00:45:00+05:30
True,False,True,True,False,False,True,True,2022-12-31 01:45:00+05:30
True,False,True,False,False,False,False,False,2022-12-31 02:45:00+05:30
False,True,True,True,False,False,True,True,2022-12-31 03:45:00+05:30
True,False,True,True,False,False,True,False,2022-12-31 04:45:00+05:30
False,True,True,True,False,False,True,False,2022-12-31 05:45:00+05:30
True,True,True,True,False,False,True,False,2022-12-31 06:45:00+05:30
False,False,True,True,False,False,True,False,2022-12-31 07:45:00+05:30
True,False,True,False,False,False,True,True,2022-12-31 08:45:00+05:30
False,True,True,False,False,False,True,True,2022-12-31 09:45:00+05:30
True,False,True,True,False,False,True,False,2022-12-31 10:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-31 11:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-31 12:45:00+05:30
True,True,True,True,False,False,True,False,2022-12-31 13:45:00+05:30
True,False,True,True,False,False,True,False,2022-12-31 14:45:00+05:30
True,True,True,False,False,False,True,False,2022-12-31 15:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-31 16:45:00+05:30
False,False,True,True,False,False,True,True,2022-12-31 17:45:00+05:30
False,False,True,True,False,False,True,False,2022-12-31 18:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-31 19:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-31 20:45:00+05:30
False,True,True,False,False,False,True,False,2022-12-31 21:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-31 22:45:00+05:30
False,False,True,False,False,False,True,False,2022-12-31 23:45:00+05:30
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -994,8 +994,8 @@ timestamp,Vaporizer V-2002A:Acid Feed Flow(FI-2021)_live,Vaporizer V-2002A:Flow(
2022-12-14 01:00:00+05:30,2661.941996666666,8.649794323333332,114.31555556249994,5.333333333333333,1983.625,,1983.6666666666667,109.0,110.0,423.7235958867924,693.8393243773584,140.91973992452836,633.0,634.0,442.0,443.0,140.0,141.0,497.51054637500005,362.3333333333333,362.375,38.01062832264151,89.32466009056603,37.0,38.0,92.0,93.0,17.7725059523077,19.0,21.0,11.603902680000008,13.0,14.0,3998.815561458332,2270.2916666666665,2290.875,17.443999487692306,17.0,18.0,32.50752186875001,69.60697183749996,35.0,37.0,69.0,70.0,-2.431316014615385,-1.0,168.3980430625,177.0,178.0,772.6468498679247,766.0,767.0,37.68040635624999,42.0,41.0,71.7366069923077,72.0,73.0,722.698794981132,762.1666666666666,766.7916666666666,52.002825624999986,65.0,64.0,1670959800000
2022-12-14 01:15:00+05:30,2695.540107073171,8.650665560975607,114.2559800487805,,,,,,,423.38478724999993,697.2914040000003,141.12198137500002,,,,,,,501.7508724390242,,,37.143558459999994,89.35016450000003,,,,,17.743672996296294,,,11.672378122222225,,,3995.068462195122,,,17.424357851851852,,,32.585167092499994,71.32339950000001,,,,,-2.434446055555557,,168.32584207499994,,,774.505014375,,,39.982381836585375,,,73.3565724314815,,,721.0245244,,,51.04649450000001,,,1670960700000
2022-12-14 01:30:00+05:30,2669.8517104444445,8.654294721111112,114.3064019333333,,,,,,,423.2015080624999,700.7413752708334,141.33006058333328,,,,,,,503.6234133111112,,,37.810942127083344,89.32766531458337,,,,,17.741434563333332,,,11.631510666666669,,,4008.9771577777783,,,17.500989116666673,,,32.79518992325581,72.22263855813951,,,,,-2.4271344398333343,,168.7819049534884,,,776.5685490208333,,,42.09752137555556,,,74.17278221166663,,,718.0287624375001,,,46.799630239534885,,,1670961600000
2022-12-14 01:45:00+05:30,2662.34229547619,8.654003416666665,114.2725526904762,,,,,,,424.68159858823526,702.8688625490194,141.7356289803921,,,,,,,499.2143860952382,,,38.20460744117646,89.35790949607842,,,,,17.73183886551725,,,11.568282355172412,,,4020.8310980952383,,,17.596582501724143,,,32.85152322790698,73.56099803023257,,,,,-2.432198826034483,,168.65903799999998,,,778.6946156470586,,,40.91187853571427,,,75.47155679137936,,,715.6771475098041,,,44.67972446511627,,,1670962500000
2022-12-14 02:00:00+05:30,2674.6479640000007,8.654036106800003,114.25371185333334,5.333333333333333,1983.625,,1983.6666666666667,109.0,110.0,424.60993528915634,701.6976012771083,141.44071050602415,633.0,634.0,442.0,443.0,140.0,141.0,491.45588095999994,362.3333333333333,362.375,38.39948369277108,89.5316700614458,37.0,38.0,92.0,93.0,17.702461210344833,19.0,21.0,11.578860620689651,13.0,14.0,4012.3506659999994,2270.2916666666665,2290.875,17.61812296551725,17.0,18.0,32.97065082297298,73.26863624864863,35.0,37.0,69.0,70.0,-2.4364191951724132,-1.0,168.52759425675677,177.0,178.0,778.0136744698793,766.0,767.0,38.576174132000006,42.0,41.0,75.3011853114942,72.0,73.0,719.9094984457832,762.1666666666666,766.7916666666666,48.861494612162154,65.0,64.0,1670963400000
2022-12-14 01:45:00+05:30,2660.0887942647046,8.656292125220588,114.28071355882362,,,,,,,424.7520446330931,702.9331056618704,141.76444117266192,,,,,,,498.6770676397056,,,38.22264232949639,89.39216618561159,,,,,17.729919639735083,,,11.569664189403955,,,4000.110587647058,,,17.58939871788078,,,32.86927770962959,73.54636335925927,,,,,-2.4257512670860897,,168.6843234962964,,,778.7930671007192,,,40.81136880073529,,,75.49943792781457,,,715.3419253309352,,,49.26617136740742,,,1670962500000
2022-12-14 02:00:00+05:30,2683.8703108839786,8.653308737734802,114.25205937016575,5.333333333333333,1983.625,,1983.6666666666667,109.0,110.0,424.6367867431687,701.944728601093,141.46447648087423,633.0,634.0,442.0,443.0,140.0,141.0,492.29005620442,362.3333333333333,362.375,38.38125014808746,89.49585691311476,37.0,38.0,92.0,93.0,17.70585641443299,19.0,21.0,11.590498917525757,13.0,14.0,4006.245098397789,2270.2916666666665,2290.875,17.61722282731956,17.0,18.0,32.949025471270744,73.38264378618787,35.0,37.0,69.0,70.0,-2.4220906949999974,-1.0,168.53396627071825,177.0,178.0,778.2381441092896,766.0,767.0,38.844424545303895,42.0,41.0,75.41948239072173,72.0,73.0,718.9114151311476,762.1666666666666,766.7916666666666,49.773685459668506,65.0,64.0,1670963400000
2022-12-14 02:15:00+05:30,2658.311557967033,8.652666331978018,114.21110020329675,,,,,,,424.49077701111077,699.0920872722218,141.29200804999994,,,,,,,489.9357336703297,,,38.513333909999986,89.52170011111112,,,,,17.712185227040802,,,11.55289297551019,,,3998.9685191208778,,,17.637866090306098,,,33.003613439226555,72.30064550331497,,,,,-2.427698848877548,,168.552460165746,,,775.9114367277775,,,37.616865959340664,,,74.38101458061227,,,715.5263192111111,,,50.900223794475146,,,1670964300000
2022-12-14 02:30:00+05:30,2688.5858029651167,8.651814494127912,114.21549095930239,,,,,,,424.3381258843922,696.4976156184966,141.1465379653179,,,,,,,490.89724776162745,,,38.56359633583815,89.56146635838142,,,,,17.703569336269418,,,11.56835811709843,,,3997.5844686046503,,,17.642120994818615,,,33.02117345819209,71.2477505632769,,,,,-2.4224055209844524,,168.37224499435035,,,773.7137382254341,,,40.50874962383722,,,73.36293457305696,,,718.4684350693642,,,51.71540587796613,,,1670965200000
2022-12-14 02:45:00+05:30,2661.1928622777777,8.650252802833336,114.25961620000007,,,,,,,424.46801996132575,695.9504370165741,141.2496881988949,,,,,,,495.56658369444426,,,38.57274089116021,89.66288966850817,,,,,17.68533264432993,,,11.546353953092758,,,3994.1621466111073,,,17.63118386907215,,,32.975619397802205,71.10458894945056,,,,,-2.4165356810309246,,168.2402920714286,,,773.1912959447516,,,42.169591696666664,,,73.2480621298969,,,716.5455095635359,,,51.083149258241725,,,1670966100000
......@@ -994,8 +994,8 @@ timestamp,Vaporizer Acid Feed Flow_live,TEP Flow_live,Vaporiser Temp_live,TEP Fl
2022-12-14 01:00:00+05:30,2591.965807916666,8.552308104166668,113.54802383333333,7.916666666666667,2334.9583333333335,7.958333333333333,2335.0,112.0,113.0,142.80421750943398,674.5289220377357,671.0,671.0,141.0,142.0,497.51054637500005,362.3333333333333,362.375,36.16825428867924,37.0,38.0,11.812833840000009,10.0,11.0,17.036899775000006,17.0,18.0,34.070123999999986,69.76522246415091,72.0,73.0,36.0,37.0,-2.4378235927083347,-2.0,0.0,16.848821670769226,19.0,20.0,781.521991679245,785.0,780.0,70.60055467499998,3620.7997802083337,3773.9166666666665,3785.2916666666665,1588.0,1599.0,2444.9083307547176,177.28901126415087,2368.0,2390.0,91.875,93.04166666666667,175.76688737500004,179.0,180.0,87.24517420615389,90.0,91.0,1670959800000
2022-12-14 01:15:00+05:30,2561.9616524390244,8.55378020707317,113.58536695121948,,,,,,,142.992870375,678.8273704750002,,,,,501.7508724390242,,,35.71397925749999,,,11.856404692592596,,,17.05414667073171,,,34.139203224999996,71.37957225000001,,,,,-2.429756968500001,,,16.89824542592593,,,783.4064704500001,,,72.3073175975,3605.3857665000005,,,,,2452.71497275,178.205106775,,,,,175.713602225,,,88.65059976111108,,,1670960700000
2022-12-14 01:30:00+05:30,2578.688927777778,8.557920766888888,113.55043460000002,,,,,,,143.2092583958333,682.3997464791668,,,,,503.6234133111112,,,36.37246151666667,,,11.896159371666673,,,17.124864117777786,,,34.30601996041668,72.33782016875,,,,,-2.4207690297674427,,,16.944270441666664,,,785.4681279375003,,,73.08650272558141,3575.572101860465,,,,,2453.4749145833334,177.91876581250003,,,,,176.1071204651163,,,89.26137956500003,,,1670961600000
2022-12-14 01:45:00+05:30,2563.1361640476193,8.555773261190476,113.54410697619043,,,,,,,143.61941474509808,684.1401165686275,,,,,499.2143860952382,,,36.389700005882354,,,11.807033337931042,,,17.207456997619055,,,34.44806733529413,73.5884623764706,,,,,-2.4194382955813967,,,17.01295482068966,,,787.6222942352941,,,74.37007961627904,3596.825384651162,,,,,2452.6839729411763,176.9136038431373,,,,,175.92814016279067,,,90.41000609827584,,,1670962500000
2022-12-14 02:00:00+05:30,2563.8173380000003,8.550596246133331,113.54047387999996,7.916666666666667,2334.9583333333335,7.958333333333333,2335.0,112.0,113.0,143.38676398795184,683.339958807229,671.0,671.0,141.0,142.0,491.45588095999994,362.3333333333333,362.375,36.65526785060241,37.0,38.0,11.806101652873576,10.0,11.0,17.297630521333346,17.0,18.0,34.51770386144577,73.46068403132524,72.0,73.0,36.0,37.0,-2.431696570810813,-2.0,0.0,17.08977072068965,19.0,20.0,786.826054722892,785.0,780.0,74.16827620270271,3604.8687606756766,3773.9166666666665,3785.2916666666665,1588.0,1599.0,2451.822668915664,175.62833062650594,2368.0,2390.0,91.875,93.04166666666667,175.82035486486478,179.0,180.0,90.04093653678173,90.0,91.0,1670963400000
2022-12-14 01:45:00+05:30,2560.648853161764,8.554670900073532,113.55309607352932,,,,,,,143.55195017266192,684.1720378776979,,,,,498.6770676397056,,,36.39193645395686,,,11.815728470860925,,,17.231015388235292,,,34.44776581366907,73.63655715395684,,,,,-2.4322559935555557,,,17.019626710596018,,,787.7470379999999,,,74.43626102444445,3598.9696217037026,,,,,2452.7618974820152,176.8918849280576,,,,,175.9523474814815,,,90.33319128940413,,,1670962500000
2022-12-14 02:00:00+05:30,2559.018789116022,8.555305684806628,113.53762897237563,7.916666666666667,2334.9583333333335,7.958333333333333,2335.0,112.0,113.0,143.38580025136625,683.5515722131141,671.0,671.0,141.0,142.0,492.29005620442,362.3333333333333,362.375,36.642631463387964,37.0,38.0,11.81658214536082,10.0,11.0,17.283343146961297,17.0,18.0,34.50984533278686,73.56780843879775,72.0,73.0,36.0,37.0,-2.435886133480662,-2.0,0.0,17.084864811340193,19.0,20.0,787.0749539289611,785.0,780.0,74.32709267182321,3602.565418618784,3773.9166666666665,3785.2916666666665,1588.0,1599.0,2452.2288238251354,175.40677150273228,2368.0,2390.0,91.875,93.04166666666667,175.8097216243096,179.0,180.0,90.12738705154628,90.0,91.0,1670963400000
2022-12-14 02:15:00+05:30,2577.1880939560438,8.552044508186814,113.5214531593407,,,,,,,143.05729916111122,680.9409917666667,,,,,489.9357336703297,,,36.642276590555575,,,11.799246472448969,,,17.309393332417557,,,34.517341941666636,72.45378826222226,,,,,-2.4188672691712707,,,17.172645464795924,,,784.6897134555552,,,73.22787398563537,3629.79789005525,,,,,2446.8305693888888,176.08823803888902,,,,,175.82573897237566,,,89.2446640153062,,,1670964300000
2022-12-14 02:30:00+05:30,2563.41675348837,8.549619531569768,113.52483842441849,,,,,,,142.9461757861273,677.8686877225437,,,,,490.89724776162745,,,36.63079254566475,,,11.810782843523317,,,17.328352511627884,,,34.50811628728321,71.36555254335258,,,,,-2.4314286241807905,,,17.262660816580322,,,782.444912566474,,,72.2921608372882,3595.8956255367248,,,,,2445.7588601156076,175.28698349132947,,,,,175.6852165649719,,,88.48429205181348,,,1670965200000
2022-12-14 02:45:00+05:30,2578.515952499999,8.550987788833332,113.54047418888892,,,,,,,143.11835018232046,677.5270791160226,,,,,495.56658369444426,,,36.68902234585634,,,11.796475944845355,,,17.29891262333331,,,34.47687796187846,71.24507546961328,,,,,-2.438410905384616,,,17.35162708195876,,,782.057411817679,,,72.11234600824173,3580.144739285717,,,,,2444.547517790056,176.34740305524855,,,,,175.5356967967032,,,88.45081546030926,,,1670966100000
This diff is collapsed.
......@@ -33,8 +33,8 @@ class Compliance:
logger.info("Calculating overall compliance...")
c_df = pd.DataFrame()
try:
c_df['client'] = [self.site_metadata['client']] * len(final_data_dict)
c_df['site'] = [self.site_metadata['site']] * len(final_data_dict)
c_df['client_name'] = [self.site_metadata['client']] * len(final_data_dict)
c_df['site_name'] = [self.site_metadata['site']] * len(final_data_dict)
c_df['project_name'] = [self.site_metadata['project_name']] * len(final_data_dict)
final_compliance_list = []
timestamp_data = []
......@@ -46,6 +46,8 @@ class Compliance:
else:
timestamp_data.append(v)
count = data_list.count(True)
logger.info(f"Total followed recommendations were {count} and required recommendations were "
f"{total_columns_criteria}/{len(compliance_cols)}")
if count >= total_columns_criteria:
final_compliance_list.append(1)
else:
......@@ -60,18 +62,19 @@ class Compliance:
final_df['time'] = pd.to_datetime(final_df['time'])
final_df['day'] = final_df['time'].dt.date
new_df = final_df.groupby('day')['compliance'].value_counts().unstack(fill_value=0).reset_index()
new_df['date'] = pd.to_datetime(new_df['day'])
new_df['event_date'] = pd.to_datetime(new_df['day'])
new_df = new_df.drop('day', axis=1)
if 0 not in list(new_df.columns):
new_df[0] = 0
if 1 not in list(new_df.columns):
new_df[1] = 0
new_df = new_df.rename(columns={0: 'followed', 1: 'not_followed'})
new_df['client'] = self.site_metadata['client']
new_df['site'] = self.site_metadata['site']
new_df = new_df.rename(columns={0: 'not_followed', 1: 'followed'})
new_df['client_name'] = self.site_metadata['client']
new_df['site_name'] = self.site_metadata['site']
new_df['project_name'] = self.site_metadata['project_name']
new_df['total_recommendations'] = new_df['followed'] + new_df['not_followed']
new_df = new_df[['client', 'site', 'project_name', 'date', 'total_recommendations', 'followed', 'not_followed']]
new_df = new_df[['client_name', 'site_name', 'project_name', 'event_date', 'total_recommendations', 'followed',
'not_followed']]
return new_df
def start_calculation(self, all_timestamps):
......@@ -108,6 +111,8 @@ class Compliance:
rq_cols = compliance_cols.copy()
rq_cols.append('timestamp')
df = df[rq_cols]
df.to_csv(os.path.join(self.data_path, f'{self.site}-{str(start_time.date())}-'
f'{str(end_time.date())}-col-compliance.csv'), index=False)
final_data_dict = df.to_dict(orient='index')
df_final = self.create_compliance_sheet(final_data_dict, compliance_cols, total_columns_criteria)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment