chellow 1751619264.0.0__py3-none-any.whl → 1751980348.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/computer.py CHANGED
@@ -22,6 +22,7 @@ from chellow.models import (
22
22
  Channel,
23
23
  ClockInterval,
24
24
  Contract,
25
+ DtcMeterType,
25
26
  Era,
26
27
  HhDatum,
27
28
  Llfc,
@@ -694,7 +695,14 @@ class SiteSource(DataSource):
694
695
  self.dtc_meter_type_code = self.era_map_dtc_meter_types[
695
696
  era_dtc_meter_type_code
696
697
  ]
698
+ if self.dtc_meter_type_code is None:
699
+ self.dtc_meter_type = None
700
+ else:
701
+ self.dtc_meter_type = DtcMeterType.get_by_code(
702
+ sess, era_dtc_meter_type_code
703
+ )
697
704
  else:
705
+ self.dtc_meter_type = era.dtc_meter_type
698
706
  self.dtc_meter_type_code = era_dtc_meter_type_code
699
707
 
700
708
  self.is_import = True
@@ -1086,7 +1094,14 @@ class SupplySource(DataSource):
1086
1094
  self.dtc_meter_type_code = self.era_map_dtc_meter_types[
1087
1095
  era_dtc_meter_type_code
1088
1096
  ]
1097
+ if self.dtc_meter_type_code is None:
1098
+ self.dtc_meter_type_code = None
1099
+ else:
1100
+ self.dtc_meter_type = DtcMeterType.get_by_code(
1101
+ sess, self.dtc_meter_type_code
1102
+ )
1089
1103
  else:
1104
+ self.dtc_meter_type = era.dtc_meter_type
1090
1105
  self.dtc_meter_type_code = era_dtc_meter_type_code
1091
1106
 
1092
1107
  self.id = self.mpan_core
@@ -1196,11 +1211,15 @@ class SupplySource(DataSource):
1196
1211
  - Datetime(chunk_start.year, 1, 1)
1197
1212
  ).total_seconds()
1198
1213
  )
1214
+ if hist_era.pc.code == "00":
1215
+ ssc = Ssc.get_by_code(sess, "0393", chunk_start)
1216
+ else:
1217
+ ssc = hist_era.ssc
1199
1218
 
1200
- for tpr in (
1201
- sess.query(Tpr)
1219
+ for tpr in sess.scalars(
1220
+ select(Tpr)
1202
1221
  .join(MeasurementRequirement)
1203
- .filter(MeasurementRequirement.ssc == hist_era.ssc)
1222
+ .where(MeasurementRequirement.ssc == ssc)
1204
1223
  ):
1205
1224
  for hist_date in hh_range(self.caches, chunk_start, chunk_finish):
1206
1225
  if is_tpr(sess, self.caches, tpr.code, hist_date):
chellow/e/triad.py CHANGED
@@ -27,7 +27,7 @@ from chellow.utils import (
27
27
 
28
28
  def hh(ds, rate_period="monthly", est_kw=None):
29
29
  for hh in ds.hh_data:
30
- if hh["ct-is-month-end"]:
30
+ if hh["ct-is-month-end"] and ds.dtc_meter_type is not None:
31
31
  _process_triad_hh(ds, rate_period, est_kw, hh)
32
32
 
33
33
 
@@ -471,14 +471,13 @@ def _process_site(
471
471
  if supply_ids is not None:
472
472
  q = q.where(Supply.id.in_(supply_ids))
473
473
  for supply in sess.execute(q).scalars():
474
- last_era = (
475
- sess.execute(
476
- select(Era).where(Era.supply == supply).order_by(Era.start_date.desc())
477
- )
478
- .scalars()
479
- .first()
480
- )
481
- if last_era.finish_date is not None and last_era.start_date <= finish_date:
474
+ last_era = sess.scalars(
475
+ select(Era)
476
+ .join(SiteEra)
477
+ .where(Era.supply == supply)
478
+ .order_by(Era.start_date.desc())
479
+ ).first()
480
+ if last_era.finish_date is not None and last_era.finish_date < finish_date:
482
481
  site_era = sess.execute(
483
482
  select(SiteEra).where(
484
483
  SiteEra.era == last_era,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: chellow
3
- Version: 1751619264.0.0
3
+ Version: 1751980348.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)
@@ -86,6 +86,19 @@ in Windows an environment variable can be set by doing:
86
86
  `admin@example.com` and the password `admin`, and then the home page should appear.
87
87
  Change the admin password from the `users` page.
88
88
 
89
+ ### Azure
90
+
91
+ SSH into the machine and you'll be in ``/home/site/wwwroot``.
92
+
93
+ * Create a virtual environment: ``python -m venv antenv``
94
+ * Activate the virtual environment with: ``source antenv/bin/activate``
95
+ *
96
+ In ``/home/site/wwwroot`` create a file called ``app.py`` containing the following:
97
+
98
+ import chellow
99
+
100
+ app = chellow.create_app()
101
+
89
102
 
90
103
  ### Manually Upgrading Chellow
91
104
 
@@ -21,7 +21,7 @@ chellow/e/bmarketidx.py,sha256=9PDY-JKQwcQhGpgJEj8EktQXrUITBvQ35YryzTxwle8,7936
21
21
  chellow/e/bsuos.py,sha256=2L7pgiGbV4k1Udfzjj4B2Qye02sV_FhNjwh7_sIxXFg,15525
22
22
  chellow/e/ccl.py,sha256=30dh_SvlgzsTQPPAJNZWILaMvbeDsv9-P-S1JxS5_SQ,3184
23
23
  chellow/e/cfd.py,sha256=CWLdYeNjgqT6Ro8YRf4vhwXIAJ2aV4Wi6HLNClVSeaQ,14260
24
- chellow/e/computer.py,sha256=aGti5aXRTdC85M-WRiAoZkC_76sqfAiP-79ggWZF09Q,68020
24
+ chellow/e/computer.py,sha256=lt4Zlr8EOClL1acuuvKA-tNPCI5RRHnAZbsaGQnB9j4,68835
25
25
  chellow/e/dno_rate_parser.py,sha256=NOVfS9HRDsc0rO282hU-IdrcuvMlC7VE8RySqd_5eT0,21762
26
26
  chellow/e/duos.py,sha256=RHrn93I1ASO2uYkuF18qlhG4p-jpuJhd_g3o69wtP4U,31004
27
27
  chellow/e/elexon.py,sha256=ALhXS9Es7PV0z9ukPbIramn3cf3iLyFi-PMWPSm5iOs,5487
@@ -43,7 +43,7 @@ chellow/e/scenario.py,sha256=FLgh03r_SgXx0hMWFbAvwsz2ScDL8LUwYWSWVv2rQlg,24973
43
43
  chellow/e/system_price.py,sha256=6w5J7bzwFAZubE2zdOFRiS8IIrVP8hkoIOaG2yCt-Ic,6232
44
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=NSIIDsj6mPLr_jIFxce-cXzh7bxLTv5cFsNBJhY4CH0,13686
46
+ chellow/e/triad.py,sha256=uQIngSrz8irBXQ0Rp_s8nAUzu-y2Ms7aj4B38_Ff8y8,13720
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
@@ -88,7 +88,7 @@ chellow/reports/report_219.py,sha256=3Zs16ka6dWWY_lCDoA-ZFrlPb4vHk1LQoa2yrlTMntA
88
88
  chellow/reports/report_231.py,sha256=WARLztV2HzBFSi5_xvY_DTXVyuBBbBYiU0RazfjKw-Y,5270
89
89
  chellow/reports/report_233.py,sha256=qJdPFuBgQAWD24BsljgGJ44L_RGdHOA1RqsxGjTWhFc,4975
90
90
  chellow/reports/report_241.py,sha256=lfivElRkV_CZAhck0rxAuhqzgponj3aWwmwGMNQvUxg,5343
91
- chellow/reports/report_247.py,sha256=SnbGqvCkakeYrPvFA13NRSiuwJWaO_CVO2hU4_pw4w0,46044
91
+ chellow/reports/report_247.py,sha256=00a-shl3TRRWyana42OZHvPnjE803rQc_2HzlSA5xKE,46029
92
92
  chellow/reports/report_29.py,sha256=ZXnq6Kg5on-IPquUsH4bn46mBVESY_WhwqDWZPXOJwo,2695
93
93
  chellow/reports/report_291.py,sha256=BnWtxe0eWN2QKKWpwjs5-RI5LbReBKL119QbkrkNhV8,7478
94
94
  chellow/reports/report_33.py,sha256=lt1EN_LNx6u-AgdaS3YRkPMZA33JgMcELolHF4oJUMw,16689
@@ -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-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,,
388
+ chellow-1751980348.0.0.dist-info/METADATA,sha256=cQNBuWTEa9-hyJkd1XVznNi0ItxpmbWKgYp3PB6V2qY,12585
389
+ chellow-1751980348.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
390
+ chellow-1751980348.0.0.dist-info/RECORD,,