chellow 1755078653.0.0__py3-none-any.whl → 1755614564.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.

@@ -11,7 +11,7 @@ from openpyxl import load_workbook
11
11
 
12
12
  from werkzeug.exceptions import BadRequest
13
13
 
14
- from chellow.utils import to_ct, to_utc
14
+ from chellow.utils import hh_max, hh_min, to_ct, to_utc
15
15
 
16
16
 
17
17
  class Title(Enum):
@@ -131,11 +131,11 @@ ELEMENT_LOOKUP = {
131
131
  "Gas": "admin_variable",
132
132
  "Management Fee": "admin_variable",
133
133
  "Metering and Data": "metering",
134
- "LDZ Customer Capacity": "dn_customer_capacity_fixed",
134
+ "LDZ Customer Capacity": "dn_customer_capacity",
135
135
  "LDZ Customer Fixed": "dn_customer_fixed",
136
- "LDZ System Capacity": "dn_system_capacity_fixed",
136
+ "LDZ System Capacity": "dn_system_capacity",
137
137
  "LDZ System Commodity": "dn_system_commodity",
138
- "NTS Exit Capacity (ECN)": "dn_ecn_fixed",
138
+ "NTS Exit Capacity (ECN)": "dn_ecn",
139
139
  "NTS SO Exit": "so_exit_commodity",
140
140
  "NTS TO Exit": "to_exit_commodity",
141
141
  "Unidentified Gas": "ug",
@@ -159,6 +159,12 @@ def _parse_row(bills, sheet, row, title_row):
159
159
  charge_period_end_naive = get_date_naive(
160
160
  sheet, row, column_map[Title.CHARGE_PERIOD_END]
161
161
  )
162
+ if charge_period_end_naive is None:
163
+ charge_period_end = None
164
+ else:
165
+ charge_period_end = to_utc(
166
+ to_ct(charge_period_end_naive) + relativedelta(hours=23, minutes=30)
167
+ )
162
168
 
163
169
  try:
164
170
  mprn_values = bills[mprn]
@@ -174,18 +180,25 @@ def _parse_row(bills, sheet, row, title_row):
174
180
  "reference": reference,
175
181
  "account": account,
176
182
  "issue_date": issue_date,
177
- "start_date": charge_period_from,
178
- "finish_date": to_utc(
179
- to_ct(charge_period_end_naive) + relativedelta(hours=23, minutes=30)
180
- ),
181
183
  "kwh": Decimal("0"),
182
184
  "breakdown": defaultdict(int, {}),
183
185
  "net_gbp": Decimal("0.00"),
184
186
  "vat_gbp": Decimal("0.00"),
185
187
  "gross_gbp": Decimal("0.00"),
186
- "raw_lines": str([(c.value) for c in sheet[row]]),
188
+ "raw_lines": [],
187
189
  "reads": [],
188
190
  }
191
+ if charge_period_from is not None:
192
+ if "start_date" in bill:
193
+ bill["start_date"] = hh_min(bill["start_date"], charge_period_from)
194
+ else:
195
+ bill["start_date"] = charge_period_from
196
+ if charge_period_end is not None:
197
+ if "finish_date" in bill:
198
+ bill["finish_date"] = hh_max(bill["finish_date"], charge_period_end)
199
+ else:
200
+ bill["finish_date"] = charge_period_end
201
+ bill["raw_lines"].append([c.value for c in sheet[row]])
189
202
 
190
203
  bd = bill["breakdown"]
191
204
  element_desc = get_value(sheet, row, column_map[Title.CHARGE_TYPE])
@@ -1,16 +1,4 @@
1
1
  def vb(ds):
2
- to_exit_commodity_rate_set = ds.rate_sets["to_exit_commodity_rate"]
3
- so_exit_commodity_rate_set = ds.rate_sets["so_exit_commodity_rate"]
4
- dn_system_commodity_rate_set = ds.rate_sets["dn_system_commodity_rate"]
5
- dn_system_capacity_rate_set = ds.rate_sets["dn_system_capacity_rate"]
6
- dn_system_capacity_fixed_rate_set = ds.rate_sets["dn_system_capacity_fixed_rate"]
7
- dn_customer_capacity_rate_set = ds.rate_sets["dn_customer_capacity_rate"]
8
- dn_customer_capacity_fixed_rate_set = ds.rate_sets[
9
- "dn_customer_capacity_fixed_rate"
10
- ]
11
- dn_customer_fixed_rate_set = ds.rate_sets["dn_customer_fixed_rate"]
12
- dn_ecn_rate_set = ds.rate_sets["dn_ecn_rate"]
13
- dn_ecn_fixed_rate_set = ds.rate_sets["dn_ecn_fixed_rate"]
14
2
 
15
3
  for hh in ds.hh_data:
16
4
  start_date = hh["start_date"]
@@ -19,11 +7,9 @@ def vb(ds):
19
7
  nts_rates = ds.g_industry_rates("nts_commodity", start_date)
20
8
 
21
9
  to_exit_commodity_rate = float(nts_rates["to_exit_gbp_per_kwh"])
22
- to_exit_commodity_rate_set.add(to_exit_commodity_rate)
23
10
  hh["to_exit_commodity_rate"] = to_exit_commodity_rate
24
11
 
25
12
  so_exit_commodity_rate = float(nts_rates["so_exit_gbp_per_kwh"])
26
- so_exit_commodity_rate_set.add(so_exit_commodity_rate)
27
13
  hh["so_exit_commodity_rate"] = so_exit_commodity_rate
28
14
 
29
15
  rates = ds.g_industry_rates("dn", start_date)
@@ -89,24 +75,18 @@ def vb(ds):
89
75
 
90
76
  dn_customer_fixed_rate = 0
91
77
 
92
- dn_system_commodity_rate_set.add(dn_system_commodity_rate)
93
78
  hh["dn_system_commodity_rate"] = dn_system_commodity_rate
94
79
 
95
- dn_system_capacity_rate_set.add(dn_system_capacity_rate)
96
80
  hh["dn_system_capacity_rate"] = dn_system_capacity_rate
97
81
 
98
82
  dn_system_capacity_fixed_rate = soq * dn_system_capacity_rate
99
- dn_system_capacity_fixed_rate_set.add(dn_system_capacity_fixed_rate)
100
83
  hh["dn_system_capacity_fixed_rate"] = dn_system_capacity_fixed_rate
101
84
 
102
- dn_customer_capacity_rate_set.add(dn_customer_capacity_rate)
103
85
  hh["dn_customer_capacity_rate"] = dn_customer_capacity_rate
104
86
 
105
87
  dn_customer_capacity_fixed_rate = soq * dn_customer_capacity_rate
106
- dn_customer_capacity_fixed_rate_set.add(dn_customer_capacity_fixed_rate)
107
88
  hh["dn_customer_capacity_fixed_rate"] = dn_customer_capacity_fixed_rate
108
89
 
109
- dn_customer_fixed_rate_set.add(dn_customer_fixed_rate)
110
90
  hh["dn_customer_fixed_rate"] = dn_customer_fixed_rate
111
91
 
112
92
  dn_ecn_rate = float(
@@ -114,9 +94,7 @@ def vb(ds):
114
94
  "exit_capacity_gbp_per_kwh_per_day"
115
95
  ]
116
96
  )
117
- dn_ecn_rate_set.add(dn_ecn_rate)
118
97
  hh["dn_ecn_rate"] = dn_ecn_rate
119
98
 
120
99
  dn_ecn_fixed_rate = dn_ecn_rate * soq
121
- dn_ecn_fixed_rate_set.add(dn_ecn_fixed_rate)
122
100
  hh["dn_ecn_fixed_rate"] = dn_ecn_fixed_rate
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chellow
3
- Version: 1755078653.0.0
3
+ Version: 1755614564.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)
@@ -67,7 +67,7 @@ chellow/e/bill_parsers/settlement_dc_stark_xlsx.py,sha256=osCpUYUdLcPtlo7ngXWGw0
67
67
  chellow/e/bill_parsers/sse_edi.py,sha256=L85DOfNkqexeEIEr8pCBn_2sHJI-zEaw6cogpE3YyYM,15204
68
68
  chellow/e/bill_parsers/sww_xls.py,sha256=QEjiuvwvr5FuWCfqqVw8LaA_vZyAKsvRAS5fw3xtFhM,7533
69
69
  chellow/gas/bill_import.py,sha256=w0lPgK_Drzh8rtnEBQe3qFuxrgzZ6qQSgpaGrrGznMU,6549
70
- chellow/gas/bill_parser_bgs_xlsx.py,sha256=ZuLts8Y31gxtCQoXJq2CQRRMMpYbAWqsbfMB1S6fPqU,7757
70
+ chellow/gas/bill_parser_bgs_xlsx.py,sha256=S7sfUKNaCig_sOEow48fKs8aADiVhh03rZbIk5LF758,8247
71
71
  chellow/gas/bill_parser_csv.py,sha256=Ecdy-apFT-mWAxddAsM4k1s-9-FpIaOfjP0oFc0rdQg,5557
72
72
  chellow/gas/bill_parser_engie_edi.py,sha256=Ko0vZP-QdVQ1uuhS_5cdrii60_cM4b_LFJMoY0pZqnk,8950
73
73
  chellow/gas/bill_parser_total_edi.py,sha256=8HZH5Le24bVNFDc7vaKbauMaYR-n9P6u0ZG7gDdqbIA,11325
@@ -75,7 +75,7 @@ chellow/gas/ccl.py,sha256=DMlcPUELZi00CaDekVJINYk3GgH5apFrImVdmkbyba0,2913
75
75
  chellow/gas/cv.py,sha256=4cdYYQ8Qak6NeYdBCB4YaQ0jX8-UkaydIIdibCQuXxM,7344
76
76
  chellow/gas/dn_rate_parser.py,sha256=pmdYcqcvx8lt65Qt0dLLPi5igSET336KA0NBlNYYRTA,11378
77
77
  chellow/gas/engine.py,sha256=d2rR1y8b3u2QhmfqyFwwLu_loeZxY_3WwwtDyGJfam0,25282
78
- chellow/gas/transportation.py,sha256=Bkg8TWOs-v0ES-4qqwbleiOhqbE_t2KauUx9JYMZELM,5300
78
+ chellow/gas/transportation.py,sha256=uWFh0v-ViA02nH9Vof9JG3PiyAPXwhYZ1SvPxuzsQ0I,3912
79
79
  chellow/gas/views.py,sha256=GeCvi6BGTUN7bu7sVkypNckwG3Crl6AbUcRob9qMi0E,59733
80
80
  chellow/reports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
81
81
  chellow/reports/report_109.py,sha256=Exb-FQ5f70-ier_h15CgHGysQ7vJ7k3gFZ1001zM3iM,11171
@@ -386,6 +386,6 @@ chellow/templates/g/supply_note_edit.html,sha256=b8mB6_ucBwoljp03iy6AgVaZUhGw3-1
386
386
  chellow/templates/g/supply_notes.html,sha256=6epNmZ3NKdXZz27fvmRUGeffg_oc1kmwuBeyRzQe3Rg,854
387
387
  chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
388
388
  chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
389
- chellow-1755078653.0.0.dist-info/METADATA,sha256=KbKInBogTjyWa07u4oygauNjPH3P6FDkHayi_EazfJY,12519
390
- chellow-1755078653.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
391
- chellow-1755078653.0.0.dist-info/RECORD,,
389
+ chellow-1755614564.0.0.dist-info/METADATA,sha256=zzVEGtZ6hBBRt5ehFdTiG1V0jgz3MHdbi8xfh01K0dQ,12519
390
+ chellow-1755614564.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
391
+ chellow-1755614564.0.0.dist-info/RECORD,,