chellow 1724313988.0.0__py3-none-any.whl → 1724318422.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.

@@ -5,7 +5,7 @@ import traceback
5
5
 
6
6
  from flask import g, request
7
7
 
8
- from sqlalchemy import null, or_, true
8
+ from sqlalchemy import null, or_, select, true
9
9
  from sqlalchemy.orm import joinedload
10
10
 
11
11
  from chellow.dloads import open_file
@@ -25,36 +25,38 @@ def content(start_date, finish_date, site_id, user_id):
25
25
  writer = csv.writer(f, lineterminator="\n")
26
26
  write_row(
27
27
  writer,
28
- "Site Id",
29
- "Site Name",
30
- "Associated Site Ids",
31
- "Sources",
32
- "Generator Types",
33
- "HH Start Clock-Time",
34
- "Imported kWh",
35
- "Displaced kWh",
36
- "Exported kWh",
37
- "Used kWh",
38
- "Parasitic kWh",
39
- "Generated kWh",
40
- "3rd Party Import",
41
- "3rd Party Export",
42
- "Meter Type",
28
+ "site_id",
29
+ "site_name",
30
+ "associated_site_ids",
31
+ "sources",
32
+ "generator_types",
33
+ "hh_start_clock_time",
34
+ "imported_kwh",
35
+ "displaced_kwh",
36
+ "exported_kwh",
37
+ "used_kwh",
38
+ "parasitic_kwh",
39
+ "generated_kwh",
40
+ "3rd_party_import",
41
+ "3rd_party_export",
42
+ "meter_type",
43
43
  )
44
44
 
45
- sites = sess.query(Site).order_by(Site.code)
45
+ sites_q = select(Site).order_by(Site.code)
46
46
  if site_id is not None:
47
- sites = sites.filter(Site.id == site_id)
47
+ sites_q = sites_q.where(Site.id == site_id)
48
48
 
49
- for site in sites:
49
+ for site in sess.scalars(sites_q):
50
50
  sources = set()
51
51
  generator_types = set()
52
52
  assoc = site.find_linked_sites(sess, start_date, finish_date)
53
53
  metering_type = ""
54
- for era in (
55
- sess.query(Era)
54
+ for era in sess.scalars(
55
+ select(Era)
56
56
  .join(SiteEra)
57
- .filter(
57
+ .join(Supply)
58
+ .join(Source)
59
+ .where(
58
60
  SiteEra.site == site,
59
61
  SiteEra.is_physical == true(),
60
62
  Era.start_date <= finish_date,
@@ -90,9 +92,9 @@ def content(start_date, finish_date, site_id, user_id):
90
92
  sources_str,
91
93
  generators_str,
92
94
  hh["start_date"],
93
- hh["imp_net"],
95
+ hh["imp_grid"],
94
96
  hh["displaced"],
95
- hh["exp_net"],
97
+ hh["exp_grid"],
96
98
  hh["used"],
97
99
  hh["exp_gen"],
98
100
  hh["imp_gen"],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: chellow
3
- Version: 1724313988.0.0
3
+ Version: 1724318422.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)
@@ -92,7 +92,7 @@ chellow/reports/report_asset_comparison.py,sha256=UN298MHuzyUDUiiZr7F_Ua6SrdVOlF
92
92
  chellow/reports/report_batches.py,sha256=7O5TcB9W1sPKS0LQMsC6sUDzx73X5iyoZE0O3zK91zs,4798
93
93
  chellow/reports/report_bills.py,sha256=AHW6tiZAOE0gXDfencPvemE4zqK6eTqfN8_bWQ4RT5o,3323
94
94
  chellow/reports/report_csv_llfcs.py,sha256=OHSbP64lQ6dlAMcQYgvdANlA4lQyF0iBlwk7V9c9nuo,1944
95
- chellow/reports/report_csv_site_hh_data.py,sha256=T-clGDmYdn0ej7zZfL3kDp4Vyd82WzptxEzxx9KqAZg,4270
95
+ chellow/reports/report_csv_site_hh_data.py,sha256=yWhEoGGyg_ctM8T55raksTPRJ5ycVO6lVfUx5tRBzTQ,4372
96
96
  chellow/reports/report_csv_site_snags.py,sha256=gG2sYQrLoIBwCoMUC8rhmAL7Kffh_rvNb9UOX7cYDko,2668
97
97
  chellow/reports/report_ecoes_comparison.py,sha256=PGDJKI2f6DCVCH0xcp--BzXWAWFfTDGgcKVQnfqxBKg,21653
98
98
  chellow/reports/report_g_monthly_duration.py,sha256=FMMFIWFfGW2Bd9Excpf4LLXXqQ-fbnZZ_KfNa1VaPqA,13034
@@ -365,6 +365,6 @@ chellow/templates/g/supply_note_edit.html,sha256=b8mB6_ucBwoljp03iy6AgVaZUhGw3-1
365
365
  chellow/templates/g/supply_notes.html,sha256=6epNmZ3NKdXZz27fvmRUGeffg_oc1kmwuBeyRzQe3Rg,854
366
366
  chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
367
367
  chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
368
- chellow-1724313988.0.0.dist-info/METADATA,sha256=t9QpJIWe-EWi4KGZqjLBITe47y-OEcQpgZcSWnG5wg4,12241
369
- chellow-1724313988.0.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
370
- chellow-1724313988.0.0.dist-info/RECORD,,
368
+ chellow-1724318422.0.0.dist-info/METADATA,sha256=VR1bg4yGVprAuGnPp_bo8wwpmpcG_tOFHBcamuJ88jo,12241
369
+ chellow-1724318422.0.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
370
+ chellow-1724318422.0.0.dist-info/RECORD,,