chellow 1713292610.0.0__py3-none-any.whl → 1713453402.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/dno_rate_parser.py +8 -7
- chellow/e/duos.py +75 -25
- chellow/general_import.py +6 -0
- {chellow-1713292610.0.0.dist-info → chellow-1713453402.0.0.dist-info}/METADATA +1 -1
- {chellow-1713292610.0.0.dist-info → chellow-1713453402.0.0.dist-info}/RECORD +6 -6
- {chellow-1713292610.0.0.dist-info → chellow-1713453402.0.0.dist-info}/WHEEL +1 -1
chellow/e/dno_rate_parser.py
CHANGED
|
@@ -316,7 +316,7 @@ def tab_ehv(sheet, gsp_rates):
|
|
|
316
316
|
band_col = col_find(title_row, "residual")
|
|
317
317
|
band = "" if band_col is None else int(get_decimal(row, band_col))
|
|
318
318
|
tariffs[llfc] = {
|
|
319
|
-
"gbp-per-kwh": get_rate(
|
|
319
|
+
"super-red-gbp-per-kwh": get_rate(
|
|
320
320
|
row, col_match(title_row, polarity + " super red")
|
|
321
321
|
),
|
|
322
322
|
"gbp-per-day": get_zero_rate(
|
|
@@ -338,10 +338,11 @@ def tab_ehv(sheet, gsp_rates):
|
|
|
338
338
|
period_str = " ".join(get_value(row, 0).split()).lower()
|
|
339
339
|
periods = []
|
|
340
340
|
|
|
341
|
-
if (
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
341
|
+
if period_str in (
|
|
342
|
+
"monday to friday nov to feb (excluding "
|
|
343
|
+
"22nd dec to 4th jan inclusive)",
|
|
344
|
+
"monday to friday (including bank holidays) nov to feb inclusive "
|
|
345
|
+
"(excluding 22nd dec to 4th jan inclusive)",
|
|
345
346
|
):
|
|
346
347
|
periods.append(
|
|
347
348
|
{
|
|
@@ -381,8 +382,8 @@ def tab_ehv(sheet, gsp_rates):
|
|
|
381
382
|
bands.append(
|
|
382
383
|
{
|
|
383
384
|
**period,
|
|
384
|
-
"
|
|
385
|
-
"
|
|
385
|
+
"start-hour": slot["start"],
|
|
386
|
+
"finish-hour": slot["finish"],
|
|
386
387
|
}
|
|
387
388
|
)
|
|
388
389
|
|
chellow/e/duos.py
CHANGED
|
@@ -16,7 +16,7 @@ from chellow.utils import (
|
|
|
16
16
|
)
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
BANDS = ("red", "amber", "green")
|
|
19
|
+
BANDS = ("super-red", "red", "amber", "green")
|
|
20
20
|
|
|
21
21
|
KEYS = dict(
|
|
22
22
|
(
|
|
@@ -659,34 +659,83 @@ def datum_2012_02_23(ds, hh):
|
|
|
659
659
|
|
|
660
660
|
tariffs[start_date] = tariff
|
|
661
661
|
|
|
662
|
-
|
|
663
|
-
band = gsp_group_cache["bands"][start_date]
|
|
664
|
-
except KeyError:
|
|
662
|
+
if KEYS["super-red"]["tariff-rate"] in tariff:
|
|
665
663
|
try:
|
|
666
|
-
|
|
664
|
+
band = gsp_group_cache["super-red-band"][start_date]
|
|
667
665
|
except KeyError:
|
|
668
|
-
|
|
666
|
+
try:
|
|
667
|
+
bands_cache = gsp_group_cache["super-red-band"]
|
|
668
|
+
except KeyError:
|
|
669
|
+
bands_cache = gsp_group_cache["super-red-band"] = {}
|
|
670
|
+
|
|
671
|
+
try:
|
|
672
|
+
band = bands_cache[start_date]
|
|
673
|
+
except KeyError:
|
|
674
|
+
band = None
|
|
675
|
+
ct_hr = hh["ct-decimal-hour"]
|
|
676
|
+
weekend = hh["ct-day-of-week"] > 4
|
|
677
|
+
try:
|
|
678
|
+
slots = ds.hh_rate(ds.dno_contract.id, start_date)[
|
|
679
|
+
ds.gsp_group_code
|
|
680
|
+
]["super_red"]
|
|
681
|
+
except KeyError as e:
|
|
682
|
+
raise BadRequest(str(e))
|
|
683
|
+
|
|
684
|
+
for slot in slots:
|
|
685
|
+
if (
|
|
686
|
+
slot["weekend"] == weekend
|
|
687
|
+
and slot["start-hour"] <= ct_hr < slot["finish-hour"]
|
|
688
|
+
and (
|
|
689
|
+
hh["ct-month"] > slot["start-month"]
|
|
690
|
+
or (
|
|
691
|
+
hh["ct-month"] == slot["start-month"]
|
|
692
|
+
and hh["ct-day"] >= slot["start-day"]
|
|
693
|
+
)
|
|
694
|
+
)
|
|
695
|
+
and (
|
|
696
|
+
hh["ct-month"] < slot["finish-month"]
|
|
697
|
+
or (
|
|
698
|
+
hh["ct-month"] == slot["finish-month"]
|
|
699
|
+
and hh["ct-day"] <= slot["finish-day"]
|
|
700
|
+
)
|
|
701
|
+
)
|
|
702
|
+
):
|
|
703
|
+
band = "super-red"
|
|
704
|
+
break
|
|
705
|
+
|
|
706
|
+
bands_cache[start_date] = band
|
|
707
|
+
else:
|
|
669
708
|
|
|
670
709
|
try:
|
|
671
|
-
band =
|
|
710
|
+
band = gsp_group_cache["rag-bands"][start_date]
|
|
672
711
|
except KeyError:
|
|
673
|
-
band = "green"
|
|
674
|
-
ct_hr = hh["ct-decimal-hour"]
|
|
675
|
-
weekend = hh["ct-day-of-week"] > 4
|
|
676
712
|
try:
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
]
|
|
680
|
-
except KeyError as e:
|
|
681
|
-
raise BadRequest(str(e))
|
|
713
|
+
bands_cache = gsp_group_cache["rag-bands"]
|
|
714
|
+
except KeyError:
|
|
715
|
+
bands_cache = gsp_group_cache["rag-bands"] = {}
|
|
682
716
|
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
717
|
+
try:
|
|
718
|
+
band = bands_cache[start_date]
|
|
719
|
+
except KeyError:
|
|
720
|
+
band = "green"
|
|
721
|
+
ct_hr = hh["ct-decimal-hour"]
|
|
722
|
+
weekend = hh["ct-day-of-week"] > 4
|
|
723
|
+
try:
|
|
724
|
+
slots = ds.hh_rate(ds.dno_contract.id, start_date)[
|
|
725
|
+
ds.gsp_group_code
|
|
726
|
+
]["bands"]
|
|
727
|
+
except KeyError as e:
|
|
728
|
+
raise BadRequest(str(e))
|
|
688
729
|
|
|
689
|
-
|
|
730
|
+
for slot in slots:
|
|
731
|
+
if (
|
|
732
|
+
slot["weekend"] == weekend
|
|
733
|
+
and slot["start"] <= ct_hr < slot["finish"]
|
|
734
|
+
):
|
|
735
|
+
band = slot["band"]
|
|
736
|
+
break
|
|
737
|
+
|
|
738
|
+
bands_cache[start_date] = band
|
|
690
739
|
|
|
691
740
|
try:
|
|
692
741
|
laf = dno_cache["lafs"][ds.llfc_code][start_date]
|
|
@@ -759,10 +808,11 @@ def datum_2012_02_23(ds, hh):
|
|
|
759
808
|
hh["duos-reactive-rate"] = duos_reactive_rate
|
|
760
809
|
hh["duos-reactive-gbp"] = kvarh * duos_reactive_rate
|
|
761
810
|
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
811
|
+
if band is not None:
|
|
812
|
+
rate = float(tariff[KEYS[band]["tariff-rate"]])
|
|
813
|
+
hh[KEYS[band]["bill-rate"]] = rate
|
|
814
|
+
hh[KEYS[band]["kwh"]] = hh["msp-kwh"]
|
|
815
|
+
hh[KEYS[band]["gbp"]] = rate * hh["msp-kwh"]
|
|
766
816
|
|
|
767
817
|
if hh["ct-decimal-hour"] == 23.5 and not ds.is_displaced:
|
|
768
818
|
hh["duos-fixed-days"] = 1
|
chellow/general_import.py
CHANGED
|
@@ -557,6 +557,10 @@ def general_import_g_supply(sess, action, vals, args):
|
|
|
557
557
|
g_reading_frequency = GReadingFrequency.get_by_code(
|
|
558
558
|
sess, g_reading_frequency_code
|
|
559
559
|
)
|
|
560
|
+
aq_str = add_arg(args, "AQ", vals, 12)
|
|
561
|
+
aq = Decimal(aq_str)
|
|
562
|
+
soq_str = add_arg(args, "SOQ", vals, 13)
|
|
563
|
+
soq = Decimal(soq_str)
|
|
560
564
|
|
|
561
565
|
site.insert_g_supply(
|
|
562
566
|
sess,
|
|
@@ -571,6 +575,8 @@ def general_import_g_supply(sess, action, vals, args):
|
|
|
571
575
|
g_contract,
|
|
572
576
|
account,
|
|
573
577
|
g_reading_frequency,
|
|
578
|
+
aq,
|
|
579
|
+
soq,
|
|
574
580
|
)
|
|
575
581
|
sess.flush()
|
|
576
582
|
elif action == "update":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: chellow
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1713453402.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)
|
|
@@ -4,7 +4,7 @@ chellow/bank_holidays.py,sha256=T_utYMwe_g1dz5X-aOTdIPryg49SvB7QsWM1yphlqG8,4423
|
|
|
4
4
|
chellow/commands.py,sha256=ESBe9ZWj1c3vdZgqMZ9gFvYAB3hRag2R1PzOwuw9yFo,1302
|
|
5
5
|
chellow/dloads.py,sha256=5SmP-0QPK6xCkd_wjIWh_8FAzN5OxNHCzyEQ1Xb-Y-M,5256
|
|
6
6
|
chellow/edi_lib.py,sha256=het3R0DBGtXEo-Sy1zvXQuX9EWQ1X6Y33G4l1hYYuds,51859
|
|
7
|
-
chellow/general_import.py,sha256=
|
|
7
|
+
chellow/general_import.py,sha256=_IaxpltSdfjhy1Dn9-pgBIB5PRmGWbDvEJyYHFkcOGU,65558
|
|
8
8
|
chellow/models.py,sha256=POIL0dfwZFuqht7xHZaE6KJ7fk4kxMZC2aXzgg5kEFY,236921
|
|
9
9
|
chellow/national_grid.py,sha256=uxcv0qisHPyzw9AVIYPzsRqwt2XPAcZL-SBR12qcrS0,4364
|
|
10
10
|
chellow/proxy.py,sha256=cVXIktPlX3tQ1BYcwxq0nJXKE6r3DtFTtfFHPq55HaM,1351
|
|
@@ -20,8 +20,8 @@ chellow/e/bsuos.py,sha256=hdP9vnOJSuZl46OAkJeUg1XJYvYIBj4J6Sqce1Hy9Vs,15542
|
|
|
20
20
|
chellow/e/ccl.py,sha256=CYeFrg0TNF7Av49nqxa0guA8CMcJhdMpBRmOq8PH6G0,564
|
|
21
21
|
chellow/e/cfd.py,sha256=V1DTT5XBQbt8hO1gae1u3315fZ4iuYk3XC7J2sUbhKQ,14352
|
|
22
22
|
chellow/e/computer.py,sha256=YL1JFUYfFW-i9DODfvSnp6gTL_MwIfwoWj1TWtOsxPg,67105
|
|
23
|
-
chellow/e/dno_rate_parser.py,sha256=
|
|
24
|
-
chellow/e/duos.py,sha256=
|
|
23
|
+
chellow/e/dno_rate_parser.py,sha256=thNjT7HeAcvwV5vACvyGZ-yYzCs4keiIJEoCL8FjJ3E,21488
|
|
24
|
+
chellow/e/duos.py,sha256=nwviRjz-qIt3GxIMHk0hItIT4dtKsxOWq9TUC1z-hO8,30864
|
|
25
25
|
chellow/e/elexon.py,sha256=ALhXS9Es7PV0z9ukPbIramn3cf3iLyFi-PMWPSm5iOs,5487
|
|
26
26
|
chellow/e/energy_management.py,sha256=aXC2qlGt3FAODlNl_frWzVYAQrJLP8FFOiNX3m-QE_Y,12388
|
|
27
27
|
chellow/e/hh_importer.py,sha256=-jvJaex756NpygSapsWxXl6RK0Z4ymkz3QA6ETrdnac,21476
|
|
@@ -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-
|
|
367
|
-
chellow-
|
|
368
|
-
chellow-
|
|
366
|
+
chellow-1713453402.0.0.dist-info/METADATA,sha256=RobDE04PcgQzlT8CKH37XijphYEe9f9tRzmv0BYtf4c,12205
|
|
367
|
+
chellow-1713453402.0.0.dist-info/WHEEL,sha256=osohxoshIHTFJFVPhsi1UkZuLRGMHRXZzwEBW2ezjrc,87
|
|
368
|
+
chellow-1713453402.0.0.dist-info/RECORD,,
|