chellow 1708506090.0.0__py3-none-any.whl → 1708963708.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of chellow might be problematic. Click here for more details.

chellow/e/bsuos.py CHANGED
@@ -218,7 +218,13 @@ def _process_url(logger, sess, url, contract, s):
218
218
 
219
219
  for row in reader:
220
220
  date_str = row[0].strip()
221
- date_format = "%Y-%m-%dT%H:%M:%S" if len(date_str) == 19 else "%d-%m-%y"
221
+ len_date_str = len(date_str)
222
+ if len_date_str == 19:
223
+ date_format = "%Y-%m-%dT%H:%M:%S"
224
+ elif len_date_str == 20:
225
+ date_format = "%Y-%m-%d-T%H:%M:%S"
226
+ else:
227
+ date_format = "%d-%m-%y"
222
228
  date = Datetime.strptime(date_str, date_format)
223
229
  period_str = row[1]
224
230
  period = int(period_str)
@@ -403,7 +409,12 @@ def rate_server_import(sess, log, set_progress, s, paths):
403
409
  def national_grid_import(sess, log, set_progress, s):
404
410
  log("Starting to check for new BSUoS forecast")
405
411
 
406
- contract = Contract.get_non_core_by_name(sess, "bsuos")
412
+ CONTRACT_NAME = "bsuos"
413
+ contract = Contract.find_non_core_by_name(sess, CONTRACT_NAME)
414
+ if contract is None:
415
+ contract = Contract.insert_non_core(
416
+ sess, CONTRACT_NAME, "", {}, to_utc(ct_datetime(1996, 4, 1)), None, {}
417
+ )
407
418
 
408
419
  block = None
409
420
 
chellow/e/computer.py CHANGED
@@ -682,6 +682,7 @@ class SiteSource(DataSource):
682
682
  self.gsp_group_code = self.supply.gsp_group.code
683
683
  self.ssc = self.era.ssc
684
684
  self.ssc_code = None if self.ssc is None else self.ssc.code
685
+ self.energisation_status_code = era.energisation_status.code
685
686
 
686
687
  era_q = (
687
688
  select(Era.id)
@@ -165,6 +165,17 @@ def _process_site(
165
165
  None,
166
166
  None,
167
167
  None,
168
+ imp_ss.pc_code,
169
+ imp_ss.energisation_status_code,
170
+ imp_ss.gsp_group_code,
171
+ imp_ss.dno_code,
172
+ imp_ss.voltage_level_code,
173
+ imp_ss.is_substation,
174
+ imp_ss.llfc_code,
175
+ imp_ss.llfc.description,
176
+ None,
177
+ None,
178
+ None,
168
179
  None,
169
180
  site.code,
170
181
  site.name,
@@ -345,7 +356,8 @@ def _process_site(
345
356
  raise BadRequest("Role code not recognized.")
346
357
 
347
358
  if imp_ss is None:
348
- imp_supplier_contract_name = None
359
+ imp_supplier_contract_name = imp_voltage_level_code = None
360
+ imp_is_substation = imp_llfc_code = imp_llfc_description = None
349
361
  pc_code = exp_ss.pc_code
350
362
  else:
351
363
  if imp_supplier_contract is None:
@@ -353,14 +365,23 @@ def _process_site(
353
365
  else:
354
366
  imp_supplier_contract_name = imp_supplier_contract.name
355
367
  pc_code = imp_ss.pc_code
368
+ imp_voltage_level_code = imp_ss.voltage_level_code
369
+ imp_is_substation = imp_ss.is_substation
370
+ imp_llfc_code = imp_ss.llfc_code
371
+ imp_llfc_description = imp_ss.llfc.description
356
372
 
357
373
  if exp_ss is None:
358
- exp_supplier_contract_name = None
374
+ exp_supplier_contract_name = exp_voltage_level_code = None
375
+ exp_is_substation = exp_llfc_code = exp_llfc_description = None
359
376
  else:
360
377
  if exp_supplier_contract is None:
361
378
  exp_supplier_contract_name = ""
362
379
  else:
363
380
  exp_supplier_contract_name = exp_supplier_contract.name
381
+ exp_voltage_level_code = exp_ss.voltage_level_code
382
+ exp_is_substation = exp_ss.is_substation
383
+ exp_llfc_code = exp_ss.llfc_code
384
+ exp_llfc_description = exp_ss.llfc.description
364
385
 
365
386
  out = (
366
387
  [
@@ -376,6 +397,17 @@ def _process_site(
376
397
  sss.supply_name,
377
398
  sss.msn,
378
399
  pc_code,
400
+ sss.energisation_status_code,
401
+ sss.gsp_group_code,
402
+ sss.dno_code,
403
+ imp_voltage_level_code,
404
+ imp_is_substation,
405
+ imp_llfc_code,
406
+ imp_llfc_description,
407
+ exp_voltage_level_code,
408
+ exp_is_substation,
409
+ exp_llfc_code,
410
+ exp_llfc_description,
379
411
  site.code,
380
412
  site.name,
381
413
  ",".join(sorted(list(era_associates))),
@@ -486,7 +518,26 @@ def _process_site(
486
518
  data[key] += bill_prop_gbp
487
519
 
488
520
  imp_supplier_contract = last_era.imp_supplier_contract
521
+ imp_llfc = last_era.imp_llfc
522
+ if imp_llfc is None:
523
+ imp_llfc_code = imp_voltage_level_code = None
524
+ imp_is_substation = imp_llfc_description = None
525
+ else:
526
+ imp_llfc_code = imp_llfc.code
527
+ imp_voltage_level_code = imp_llfc.voltage_level.code
528
+ imp_is_substation = imp_llfc.is_substation
529
+ imp_llfc_description = imp_llfc.description
530
+
489
531
  exp_supplier_contract = last_era.exp_supplier_contract
532
+ exp_llfc = last_era.exp_llfc
533
+ if exp_llfc is None:
534
+ exp_llfc_code = exp_voltage_level_code = None
535
+ exp_is_substation = exp_llfc_description = None
536
+ else:
537
+ exp_llfc_code = exp_llfc.code
538
+ exp_voltage_level_code = exp_llfc.voltage_level.code
539
+ exp_is_substation = exp_llfc.is_substation
540
+ exp_llfc_description = exp_llfc.description
490
541
  out = [
491
542
  now,
492
543
  last_era.imp_mpan_core,
@@ -508,6 +559,17 @@ def _process_site(
508
559
  last_era.supply.name,
509
560
  last_era.msn,
510
561
  last_era.pc.code,
562
+ last_era.energisation_status.code,
563
+ last_era.supply.gsp_group.code,
564
+ last_era.supply.dno.dno_code,
565
+ imp_voltage_level_code,
566
+ imp_is_substation,
567
+ imp_llfc_code,
568
+ imp_llfc_description,
569
+ exp_voltage_level_code,
570
+ exp_is_substation,
571
+ exp_llfc_code,
572
+ exp_llfc_description,
511
573
  site.code,
512
574
  site.name,
513
575
  None,
@@ -593,6 +655,25 @@ def _process_site(
593
655
  data[key] += bill_prop_gbp
594
656
 
595
657
  imp_supplier_contract = first_era.imp_supplier_contract
658
+ imp_llfc = last_era.imp_llfc
659
+ if imp_llfc is None:
660
+ imp_llfc_code = imp_voltage_level_code = None
661
+ imp_is_substation = imp_llfc_description = None
662
+ else:
663
+ imp_llfc_code = imp_llfc.code
664
+ imp_voltage_level_code = imp_llfc.voltage_level.code
665
+ imp_is_substation = imp_llfc.is_substation
666
+ imp_llfc_description = imp_llfc.description
667
+
668
+ exp_llfc = last_era.exp_llfc
669
+ if exp_llfc is None:
670
+ exp_llfc_code = exp_voltage_level_code = None
671
+ exp_is_substation = exp_llfc_description = None
672
+ else:
673
+ exp_llfc_code = exp_llfc.code
674
+ exp_voltage_level_code = exp_llfc.voltage_level.code
675
+ exp_is_substation = exp_llfc.is_substation
676
+ exp_llfc_description = exp_llfc.description
596
677
  exp_supplier_contract = first_era.exp_supplier_contract
597
678
  out = [
598
679
  now,
@@ -615,6 +696,17 @@ def _process_site(
615
696
  last_era.supply.name,
616
697
  last_era.msn,
617
698
  last_era.pc.code,
699
+ last_era.energisation_status.code,
700
+ last_era.supply.gsp_group.code,
701
+ last_era.supply.dno.dno_code,
702
+ imp_voltage_level_code,
703
+ imp_is_substation,
704
+ imp_llfc_code,
705
+ imp_llfc_description,
706
+ exp_voltage_level_code,
707
+ exp_is_substation,
708
+ exp_llfc_code,
709
+ exp_llfc_description,
618
710
  site.code,
619
711
  site.name,
620
712
  None,
@@ -812,6 +904,17 @@ def content(
812
904
  "supply-name",
813
905
  "msn",
814
906
  "pc",
907
+ "energisation-status",
908
+ "gsp-group",
909
+ "dno",
910
+ "imp-voltage-level",
911
+ "imp-is-substation",
912
+ "imp-llfc-code",
913
+ "imp-llfc-description",
914
+ "exp-voltage-level",
915
+ "exp-is-substation",
916
+ "exp-llfc-code",
917
+ "exp-llfc-description",
815
918
  "site-id",
816
919
  "site-name",
817
920
  "associated-site-ids",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: chellow
3
- Version: 1708506090.0.0
3
+ Version: 1708963708.0.0
4
4
  Summary: Web Application for checking UK energy bills.
5
5
  Project-URL: Homepage, https://github.com/WessexWater/chellow
6
6
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
@@ -16,10 +16,10 @@ chellow/e/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  chellow/e/aahedc.py,sha256=d2usudp7KYWpU6Pk3fal5EQ47EbvkvKeaFGylnb3NWw,606
17
17
  chellow/e/bill_importer.py,sha256=y1bpn49xDwltj0PRFowWsjAVamcD8eyxUbCTdGxEZiE,7389
18
18
  chellow/e/bmarketidx.py,sha256=0JCBBnP3xfLq2eFjXO_u-gzHyTizab4Pp6PRK6OZLcw,7134
19
- chellow/e/bsuos.py,sha256=YtEhce5589kJWNp0HlA7N9L1hHl2KjYkUm54cUCOB8w,15080
19
+ chellow/e/bsuos.py,sha256=aqteIr0YdkWDLlfJIQ8bW4mDsUxffi5zhsUAzykkqtk,15442
20
20
  chellow/e/ccl.py,sha256=CYeFrg0TNF7Av49nqxa0guA8CMcJhdMpBRmOq8PH6G0,564
21
21
  chellow/e/cfd.py,sha256=3yRchycC-WZwgqryGQK3B59OcMGVIWgbxrkekUOy-9k,14914
22
- chellow/e/computer.py,sha256=J8VvYjcSeJNrG2Ak8Zi2t2bb_8tMrkHWny4JQlgIyy8,67032
22
+ chellow/e/computer.py,sha256=YL1JFUYfFW-i9DODfvSnp6gTL_MwIfwoWj1TWtOsxPg,67105
23
23
  chellow/e/dno_rate_parser.py,sha256=5MYEbcYngh7n6Szn2h9zLTwQKXH-WHKy6c80PYwNLLQ,20983
24
24
  chellow/e/duos.py,sha256=ISTcNqe9KNjVNM2Qs8IBoQxnmSXOt5W_G7tZxp4T78M,28870
25
25
  chellow/e/elexon.py,sha256=s8QdLUQMeylLhghxvvhLyOL3-0ifUnMfmo3vcbot_DY,5487
@@ -78,7 +78,7 @@ chellow/reports/report_219.py,sha256=o2eEg3mX9_raP2b4gjc2Gu4vqnMqcvvJBYQ1oQjxvpE
78
78
  chellow/reports/report_231.py,sha256=jE68IXQrk71gqVLTDMGvhndUbxcf2_HkC4ApUF6Mv-Q,4100
79
79
  chellow/reports/report_233.py,sha256=DLAmkoHFKH-N8OEIoX4jeCxAaCfJK0e7ssjFJJpPqzw,4334
80
80
  chellow/reports/report_241.py,sha256=se2V1tb5scvH9-RRuGG3U-IbqUYd-BZcNFwvTRjkbsw,5625
81
- chellow/reports/report_247.py,sha256=m2YgZY1YkAkSI2Qn3cNlFe2Gv8ToXfFs1zHiQd9RwbM,41556
81
+ chellow/reports/report_247.py,sha256=ozgCcee8XeqYbOpZCyU2STJKaz6h2x7TYQogagTaYLw,46626
82
82
  chellow/reports/report_29.py,sha256=KDFjgrLBv4WbG9efCdu_geMR7gT_QV9N97Wfdt7aDc4,2736
83
83
  chellow/reports/report_291.py,sha256=q04Y9EfMhQuEX4ObpmUs8vJTL76QwdG1A2-2HDVWhHQ,7587
84
84
  chellow/reports/report_33.py,sha256=3WXPN0xV6PGMKY_Oc5bKR84JuiXirYlYdrghqIgYY_s,16675
@@ -363,6 +363,6 @@ chellow/templates/g/supply_note_edit.html,sha256=6UQf_qbhFDys3cVsTp-c7ABWZpggW9R
363
363
  chellow/templates/g/supply_notes.html,sha256=WR3YwGh_qqTklSJ7JqWX6BKBc9rk_jMff4RiWZiF2CM,936
364
364
  chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
365
365
  chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
366
- chellow-1708506090.0.0.dist-info/METADATA,sha256=wp5GvZ_7hSjlE2jkjOabQPR1gHXug70SwlYb1YF2mTg,12203
367
- chellow-1708506090.0.0.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
368
- chellow-1708506090.0.0.dist-info/RECORD,,
366
+ chellow-1708963708.0.0.dist-info/METADATA,sha256=DltGdJaV-zsWDI7LROQ05hzCQtV2-LCKYzhQLN5DKZQ,12203
367
+ chellow-1708963708.0.0.dist-info/WHEEL,sha256=TJPnKdtrSue7xZ_AVGkp9YXcvDrobsjBds1du3Nx6dc,87
368
+ chellow-1708963708.0.0.dist-info/RECORD,,