chellow 1751477752.0.0__py3-none-any.whl → 1751619264.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.

@@ -167,7 +167,7 @@ def _process_BCD(elements, headers):
167
167
  bill_type_code = elements["BTCD"][0]
168
168
  sumo = elements["SUMO"]
169
169
  headers["start_date"] = to_date(sumo[0])
170
- headers["finish_date"] = to_date(sumo[1]) - HH
170
+ headers["finish_date"] = to_finish_date(sumo[1])
171
171
 
172
172
  headers["issue_date"] = issue_date
173
173
  headers["bill_type_code"] = bill_type_code
chellow/e/tlms.py CHANGED
@@ -89,7 +89,10 @@ def _find_complete_date(caches, sess, contract, cache):
89
89
  rates["id"] = rs.id
90
90
  cache["rate_scripts"].append(rates)
91
91
  timestamps = cache["timestamps"]
92
- tlms = rates["tlms"]
92
+ try:
93
+ tlms = rates["tlms"]
94
+ except KeyError:
95
+ tlms = rates["tlms"] = {}
93
96
  complete = True
94
97
  for dt in hh_range(caches, rs.start_date, rs.finish_date):
95
98
  timestamps[dt] = rates
@@ -236,6 +239,11 @@ def _process_line(cache, sess, contract, log_func, values, complete_date, caches
236
239
  .order_by(RateScript.start_date.desc())
237
240
  .first()
238
241
  )
242
+ if hh_date < latest_rs.start_date:
243
+ raise BadRequest(
244
+ f"The start of the latest rate script must be before "
245
+ f"{hh_format(hh_date)}"
246
+ )
239
247
  contract.update_rate_script(
240
248
  sess,
241
249
  latest_rs,
chellow/e/triad.py CHANGED
@@ -94,10 +94,8 @@ def _process_triad_hh(ds, rate_period, est_kw, hh):
94
94
  if ds.site is None:
95
95
  era = ds.supply.find_era_at(ds.sess, earliest_triad)
96
96
  if (
97
- era is None
98
- or era.get_channel(ds.sess, ds.is_import, "ACTIVE") is None
99
- and est_kw is None
100
- ):
97
+ era is None or era.get_channel(ds.sess, ds.is_import, "ACTIVE") is None
98
+ ) and est_kw is None:
101
99
  est_kw = 0.85 * max(datum["msp-kwh"] for datum in ds.hh_data) * 2
102
100
  if est_kw is not None:
103
101
  for est_datum in est_triad_kws:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chellow
3
- Version: 1751477752.0.0
3
+ Version: 1751619264.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)
@@ -41,16 +41,16 @@ chellow/e/rcrc.py,sha256=92CA1uIotIHd1epQ_jEPdJKzXqDFV-AoJOJeRO6MEyA,4274
41
41
  chellow/e/ro.py,sha256=dZKZv_9wXSWuwcb3jiKavoD_9ot-PZseNVeEEe0siLo,596
42
42
  chellow/e/scenario.py,sha256=FLgh03r_SgXx0hMWFbAvwsz2ScDL8LUwYWSWVv2rQlg,24973
43
43
  chellow/e/system_price.py,sha256=6w5J7bzwFAZubE2zdOFRiS8IIrVP8hkoIOaG2yCt-Ic,6232
44
- chellow/e/tlms.py,sha256=Wb9ZuxscMzxXs0FT06Iu5YXeccmO6ai_mUjnJGJwTM4,9045
44
+ chellow/e/tlms.py,sha256=K2n-dF6qNW7VQp4m_sVK1HWnXarmAIzpotWXYqWQacY,9363
45
45
  chellow/e/tnuos.py,sha256=NBmc-f3oezrl4gviAKobljHfICTpBKxxxEGBGJi_lRk,4927
46
- chellow/e/triad.py,sha256=lIQj7EdUrcFwEqleuHZXYU_bfzIwNOqUVVxB3NPQt4A,13710
46
+ chellow/e/triad.py,sha256=NSIIDsj6mPLr_jIFxce-cXzh7bxLTv5cFsNBJhY4CH0,13686
47
47
  chellow/e/views.py,sha256=e5rMZFT2fNO3P14_0nCyOEwNWnMiayx2wqo4PJmBwRM,220111
48
48
  chellow/e/bill_parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
49
  chellow/e/bill_parsers/activity_mop_stark_xlsx.py,sha256=opjXRrqrgBTbSKzL0JfTLP0fnz3DL3oRZZ4P0DifQ3I,4119
50
50
  chellow/e/bill_parsers/annual_mop_stark_xlsx.py,sha256=-HMoIfa_utXYKA44RuC0Xqv3vd2HLeQU_4P0iBUd3WA,4219
51
51
  chellow/e/bill_parsers/bgb_edi.py,sha256=GuwHeYbAGk7BVg5n19FcTANFDyKI-y0z3f9niQaPSSw,4828
52
52
  chellow/e/bill_parsers/csv.py,sha256=U5zcIaZ6B5QTTpFDAcBnk4G2r8B3j5kJhDPL4AJNkEk,5640
53
- chellow/e/bill_parsers/drax_edi.py,sha256=syHvC-q1DK3fuSfI1IgMejNlVa7zEnrr4H9zU2mxqlA,15081
53
+ chellow/e/bill_parsers/drax_edi.py,sha256=cqd1YhW_IsxUMsW5xcyC_0CHpqkMRWKQgcXERZoIqGM,15083
54
54
  chellow/e/bill_parsers/drax_element_edi.py,sha256=kxjg1KA4UheMa8doGp9skXtQYrNK8Eisy9ksafR5TQo,13661
55
55
  chellow/e/bill_parsers/edf_export_xlsx.py,sha256=J4lY8epiSTIePZ6D1SGD76TXRoev35KrUC2sjHkNqlE,6632
56
56
  chellow/e/bill_parsers/engie_edi.py,sha256=PDMDI0aqUM1lalgzxih1YmMho11n1rMqE0vyL-aEIs8,15840
@@ -385,6 +385,6 @@ chellow/templates/g/supply_note_edit.html,sha256=b8mB6_ucBwoljp03iy6AgVaZUhGw3-1
385
385
  chellow/templates/g/supply_notes.html,sha256=6epNmZ3NKdXZz27fvmRUGeffg_oc1kmwuBeyRzQe3Rg,854
386
386
  chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
387
387
  chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
388
- chellow-1751477752.0.0.dist-info/METADATA,sha256=SMC0kIII5STfrFFJtcp-1ItxYWQwx9OunE-nbBb3WNQ,12238
389
- chellow-1751477752.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
390
- chellow-1751477752.0.0.dist-info/RECORD,,
388
+ chellow-1751619264.0.0.dist-info/METADATA,sha256=xlK5YqUwEKANf3zGXV4UcDjBQRjqy22tD54jbvo4XS4,12238
389
+ chellow-1751619264.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
390
+ chellow-1751619264.0.0.dist-info/RECORD,,