chellow 1729269304.0.0__py3-none-any.whl → 1729755916.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/hh_importer.py +9 -1
- chellow/e/hh_parser_schneider_csv.py +75 -0
- chellow/e/hh_parser_schneider_xlsx.py +118 -0
- chellow/e/views.py +2 -140
- chellow/reports/report_g_monthly_duration.py +234 -153
- chellow/templates/e/channel_snags.html +1 -1
- chellow/templates/home.html +1 -1
- chellow/templates/scenario.html +61 -0
- chellow/templates/scenario_add.html +21 -0
- chellow/templates/scenario_docs.html +256 -0
- chellow/templates/scenario_edit.html +35 -0
- chellow/templates/scenarios.html +39 -0
- chellow/views.py +140 -0
- {chellow-1729269304.0.0.dist-info → chellow-1729755916.0.0.dist-info}/METADATA +1 -1
- {chellow-1729269304.0.0.dist-info → chellow-1729755916.0.0.dist-info}/RECORD +16 -9
- {chellow-1729269304.0.0.dist-info → chellow-1729755916.0.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
<h2>Docs For Electricity</h2>
|
|
2
|
+
|
|
3
|
+
<h3>Template Scenario Properties</h3>
|
|
4
|
+
|
|
5
|
+
<pre>
|
|
6
|
+
{
|
|
7
|
+
"scenario_start_year": 2011, /* clock-time year, or null for current year */
|
|
8
|
+
"scenario_start_month": 1, /* clock-time month or null for this month */
|
|
9
|
+
|
|
10
|
+
"scenario_start_day": 1, /* used by Duration */
|
|
11
|
+
"scenario_start_hour": 1, /* used by Duration */
|
|
12
|
+
"scenario_start_minute": 1, /* used by Duration */
|
|
13
|
+
|
|
14
|
+
"scenario_duration": 1, /* Number of months (used by Monthly Duration) */
|
|
15
|
+
|
|
16
|
+
"scenario_finish_year": 2011, /* used by Duration */
|
|
17
|
+
"scenario_finish_month": 1, /* used by Duration */
|
|
18
|
+
"scenario_finish_day": 1, /* used by Duration */
|
|
19
|
+
"scenario_finish_hour": 1, /* used by Duration */
|
|
20
|
+
"scenario_finish_minute": 1, /* used by Duration */
|
|
21
|
+
|
|
22
|
+
"forecast_from": 2016-10-01T00:00:00Z, /* omit if forecast from current month */
|
|
23
|
+
|
|
24
|
+
"by_hh": false, /* To show a line per half hour rather than each month */
|
|
25
|
+
|
|
26
|
+
/* Run only for these supplies */
|
|
27
|
+
"mpan_cores": [
|
|
28
|
+
"22 7458 7682 127",
|
|
29
|
+
],
|
|
30
|
+
|
|
31
|
+
/* Run only for these sites */
|
|
32
|
+
"site_codes": [
|
|
33
|
+
"XJJK4",
|
|
34
|
+
],
|
|
35
|
+
|
|
36
|
+
/* Rates */
|
|
37
|
+
|
|
38
|
+
"rates": [
|
|
39
|
+
{
|
|
40
|
+
"contract_id": 46,
|
|
41
|
+
"start_date": 2014-10-01T00:00:00Z,
|
|
42
|
+
"finish_date": 2015-05-01T00:00:00Z,
|
|
43
|
+
"script": {
|
|
44
|
+
"gbp_per_msp_kwh": 0.667
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
{
|
|
49
|
+
"contract_id": 3,
|
|
50
|
+
"start_date": 2015-01-01T00:00:00Z,
|
|
51
|
+
"finish_date": 2015-03-01T00:00:00Z,
|
|
52
|
+
"script": {
|
|
53
|
+
"gbp_per_gsp_kwh": 5.77
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
"era_maps": {
|
|
60
|
+
2012-09-01T00:00:00Z: {
|
|
61
|
+
"llfcs": {
|
|
62
|
+
"20": {
|
|
63
|
+
"409": "607",
|
|
64
|
+
"090": "502"
|
|
65
|
+
},
|
|
66
|
+
"22": {
|
|
67
|
+
"711": "003",
|
|
68
|
+
"new_export": "003"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"pcs": {
|
|
72
|
+
"03": "00",
|
|
73
|
+
"04": "00"
|
|
74
|
+
},
|
|
75
|
+
"sscs": {
|
|
76
|
+
"0038": "0336"
|
|
77
|
+
},
|
|
78
|
+
"cops": {
|
|
79
|
+
"6c": "5"
|
|
80
|
+
},
|
|
81
|
+
"supplier_contracts": {
|
|
82
|
+
74: 3,
|
|
83
|
+
"new_export": 3,
|
|
84
|
+
9: 51
|
|
85
|
+
},
|
|
86
|
+
"imp_sc": 400,
|
|
87
|
+
"exp_sc": 400,
|
|
88
|
+
"mpan_cores": {
|
|
89
|
+
"22 8679 7237 782": "20 7568 7217 378"
|
|
90
|
+
}
|
|
91
|
+
"dnos": {
|
|
92
|
+
"22": "20"
|
|
93
|
+
},
|
|
94
|
+
"gsp_groups": {
|
|
95
|
+
"*": "_L"
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
"dtc_meter_types": {
|
|
99
|
+
"*": "H"
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
/* Use hh data rather than register reads for AMRs */
|
|
103
|
+
"use_amr_hh_data": false
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
/* HH data to use instead of the data in the database. For each site code,
|
|
109
|
+
you can specify the hh data that's used, generated, parasitic or gen_grid
|
|
110
|
+
on the site. */
|
|
111
|
+
|
|
112
|
+
"hh_data": {
|
|
113
|
+
|
|
114
|
+
/* For site code 12098 */
|
|
115
|
+
|
|
116
|
+
"12098": {
|
|
117
|
+
"used": "
|
|
118
|
+
2017-10-04 19:00, 78.0
|
|
119
|
+
2017-10-04 19:30, 74.8
|
|
120
|
+
2017-10-04 20:00, 65.3",
|
|
121
|
+
"generated": "
|
|
122
|
+
2017-10-04 19:00, 8.0
|
|
123
|
+
2017-10-04 19:30, 8.7
|
|
124
|
+
2017-10-04 20:00, 8.5",
|
|
125
|
+
"parasitic": "
|
|
126
|
+
2017-10-04 19:00, 2.0
|
|
127
|
+
2017-10-04 19:30, 2.1
|
|
128
|
+
2017-10-04 20:00, 2.0"
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
/* For site code 59987 */
|
|
132
|
+
|
|
133
|
+
"59987": {
|
|
134
|
+
"generated": "
|
|
135
|
+
2017-10-09 10:00, 3.0
|
|
136
|
+
2017-10-09 10:30, 2.7
|
|
137
|
+
2017-10-09 11:00, 3.5"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
"is_bill_check": false, /* Use the bill check rates */
|
|
141
|
+
|
|
142
|
+
"save_report_run": false, /* Save the report as a Report Run */
|
|
143
|
+
}</pre>
|
|
144
|
+
|
|
145
|
+
<h3>HH Data</h3>
|
|
146
|
+
|
|
147
|
+
<h4>Default forecasting</h4>
|
|
148
|
+
|
|
149
|
+
<p>
|
|
150
|
+
Before the <code>forecast_date</code> Chellow uses data in the database (if any), and
|
|
151
|
+
after that date it uses data from the same month but in the year before the
|
|
152
|
+
<code>forecast_date</code>.
|
|
153
|
+
</p>
|
|
154
|
+
|
|
155
|
+
<p>
|
|
156
|
+
If a rate script isn't found for a particular date, then the most recent rate script
|
|
157
|
+
is used.
|
|
158
|
+
</p>
|
|
159
|
+
|
|
160
|
+
<p>
|
|
161
|
+
Virtual bills can include TRIAD estimates and actuals in a variety of ways. For
|
|
162
|
+
example, a virtual bill may use TRIAD estimates for all months until triad dates are
|
|
163
|
+
available for that financial year, in which case it switches to using the actual TRIAD
|
|
164
|
+
for March.
|
|
165
|
+
</p>
|
|
166
|
+
|
|
167
|
+
<p>
|
|
168
|
+
TRIAD estimates are calculated using the actual TRIAD from the latest historical year
|
|
169
|
+
for which we have TRIAD dates. Historical kW and status are used, together with
|
|
170
|
+
current LAFs and TRIAD rates, with the result apportioned throughout each month.
|
|
171
|
+
</p>
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
<h4>Applying HH data in the scenario runner</h4>
|
|
175
|
+
|
|
176
|
+
<p>
|
|
177
|
+
Taking 'generated' as an example, for each half-hour Chellow will calculate the
|
|
178
|
+
difference between the <code>scenario_generated</code> and the
|
|
179
|
+
<code>existing_generated</code>. If <code>scenario_generated</code> >=
|
|
180
|
+
<code>existing_generated</code> then any <code>imported_grid</code> will be reduced
|
|
181
|
+
first, then <code>exported_grid</code> will be increased until all the difference is
|
|
182
|
+
exhausted. Otherwise if <code>scenario_generated</code> <
|
|
183
|
+
<code>existing_generated</code> then <code>exported_grid</code> will be reduced first,
|
|
184
|
+
and then <code>imported_grid</code> will be increased. A similar approach is taken with
|
|
185
|
+
used, parasitic and gen_grid kWh.
|
|
186
|
+
</p>
|
|
187
|
+
|
|
188
|
+
<p>
|
|
189
|
+
The method is the same for months after the <code>forecast_date</code> but with the
|
|
190
|
+
<code>existing_generated</code> being found from the default forecast.
|
|
191
|
+
</p>
|
|
192
|
+
|
|
193
|
+
<h2>Docs For Gas</h2>
|
|
194
|
+
|
|
195
|
+
<h3>Template Scenario Properties</h3>
|
|
196
|
+
|
|
197
|
+
<pre>
|
|
198
|
+
{
|
|
199
|
+
"utility": "gas",
|
|
200
|
+
"scenario_start_year": 2011, /* clock-time year, or null for current year */
|
|
201
|
+
"scenario_start_month": 1, /* clock-time month or null for this month */
|
|
202
|
+
|
|
203
|
+
"scenario_start_day": 1, /* used by Duration */
|
|
204
|
+
"scenario_start_hour": 1, /* used by Duration */
|
|
205
|
+
"scenario_start_minute": 1, /* used by Duration */
|
|
206
|
+
|
|
207
|
+
"scenario_duration": 1, /* Number of months (used by Monthly Duration) */
|
|
208
|
+
|
|
209
|
+
"scenario_finish_year": 2011, /* used by Duration */
|
|
210
|
+
"scenario_finish_month": 1, /* used by Duration */
|
|
211
|
+
"scenario_finish_day": 1, /* used by Duration */
|
|
212
|
+
"scenario_finish_hour": 1, /* used by Duration */
|
|
213
|
+
"scenario_finish_minute": 1, /* used by Duration */
|
|
214
|
+
|
|
215
|
+
"forecast_from": 2016-10-01T00:00:00Z, /* omit if forecast from current month */
|
|
216
|
+
|
|
217
|
+
/* Run only for these supplies */
|
|
218
|
+
"mprns": [
|
|
219
|
+
"22 7458 7682 127",
|
|
220
|
+
],
|
|
221
|
+
|
|
222
|
+
/* Run only for these sites */
|
|
223
|
+
"site_codes": [
|
|
224
|
+
"XJJK4",
|
|
225
|
+
],
|
|
226
|
+
|
|
227
|
+
/* Rates */
|
|
228
|
+
|
|
229
|
+
"rates": [
|
|
230
|
+
{
|
|
231
|
+
"contract_id": 46,
|
|
232
|
+
"start_date": 2014-10-01T00:00:00Z,
|
|
233
|
+
"finish_date": 2015-05-01T00:00:00Z,
|
|
234
|
+
"script": {
|
|
235
|
+
"gbp_per_msp_kwh": 0.667
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
|
|
239
|
+
{
|
|
240
|
+
"contract_id": 3,
|
|
241
|
+
"start_date": 2015-01-01T00:00:00Z,
|
|
242
|
+
"finish_date": 2015-03-01T00:00:00Z,
|
|
243
|
+
"script": {
|
|
244
|
+
"gbp_per_gsp_kwh": 5.77
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
"era_maps": {
|
|
251
|
+
2012-09-01T00:00:00Z: {
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
|
|
255
|
+
"save_report_run": false, /* Save the report as a Report Run */
|
|
256
|
+
}</pre>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
|
|
3
|
+
{% block title %}
|
|
4
|
+
» Scenarios » {{scenario.name}}
|
|
5
|
+
{% endblock %}
|
|
6
|
+
|
|
7
|
+
{% block nav %}
|
|
8
|
+
<a href="/scenarios">Scenarios</a> »
|
|
9
|
+
<a href="/scenarios/{{scenario.id}}">{{scenario.name}}</a> » Edit
|
|
10
|
+
{% endblock %}
|
|
11
|
+
|
|
12
|
+
{% block content %}
|
|
13
|
+
|
|
14
|
+
<form method="post" action="/scenarios/{{scenario.id}}/edit">
|
|
15
|
+
<fieldset>
|
|
16
|
+
<legend>Update Scenario</legend>
|
|
17
|
+
<input type="hidden" name="scenario_id" value="{{scenario.id}}">
|
|
18
|
+
<label>Name</label> {{input_text('name', scenario.name)}}
|
|
19
|
+
<label>Properties</label>
|
|
20
|
+
{{input_textarea('properties', scenario.properties, 20, 80, show_pos=True)}}
|
|
21
|
+
<input type="submit" value="Update">
|
|
22
|
+
</fieldset>
|
|
23
|
+
</form>
|
|
24
|
+
|
|
25
|
+
{% include "scenario_docs.html" %}
|
|
26
|
+
|
|
27
|
+
<form hx-delete="/scenarios/{{scenario.id}}/edit"
|
|
28
|
+
hx-confirm="Are you sure you want to delete this scenario?">
|
|
29
|
+
<fieldset>
|
|
30
|
+
<legend>Delete this scenario</legend>
|
|
31
|
+
<input type="hidden" name="scenario_id" value="{{scenario.id}}">
|
|
32
|
+
<input type="submit" name="delete" value="Delete">
|
|
33
|
+
</fieldset>
|
|
34
|
+
</form>
|
|
35
|
+
{% endblock %}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{% extends "base.html" %}
|
|
2
|
+
|
|
3
|
+
{% block title %}
|
|
4
|
+
» Scenarios
|
|
5
|
+
{% endblock %}
|
|
6
|
+
|
|
7
|
+
{% block nav %}
|
|
8
|
+
Scenarios [<a href="/scenarios/add">add</a>]
|
|
9
|
+
{% endblock %}
|
|
10
|
+
|
|
11
|
+
{% block content %}
|
|
12
|
+
<table>
|
|
13
|
+
<thead>
|
|
14
|
+
<tr>
|
|
15
|
+
<th>Scenario</th>
|
|
16
|
+
<th>View</th>
|
|
17
|
+
<th>Edit</th>
|
|
18
|
+
<th>Description</th>
|
|
19
|
+
</tr>
|
|
20
|
+
</thead>
|
|
21
|
+
<tbody>
|
|
22
|
+
{% for scenario in scenarios %}
|
|
23
|
+
<tr>
|
|
24
|
+
<td>{{scenario.name}}</td>
|
|
25
|
+
<td><a href="/scenarios/{{scenario.id}}">View</a></td>
|
|
26
|
+
<td>[<a href="/scenarios/{{scenario.id}}/edit">edit</a>]</td>
|
|
27
|
+
<td>
|
|
28
|
+
{% if 'description' in scenario.props %}
|
|
29
|
+
{{scenario.props.description}}
|
|
30
|
+
{% else %}
|
|
31
|
+
To add a description to the scenario, add something like
|
|
32
|
+
<code>"description": "My description",</code>
|
|
33
|
+
{% endif %}
|
|
34
|
+
</td>
|
|
35
|
+
</tr>
|
|
36
|
+
{% endfor %}
|
|
37
|
+
</tbody>
|
|
38
|
+
</table>
|
|
39
|
+
{% endblock %}
|
chellow/views.py
CHANGED
|
@@ -55,6 +55,8 @@ from sqlalchemy.orm.attributes import flag_modified
|
|
|
55
55
|
|
|
56
56
|
from werkzeug.exceptions import BadRequest, Forbidden
|
|
57
57
|
|
|
58
|
+
from zish import dumps
|
|
59
|
+
|
|
58
60
|
import chellow.bank_holidays
|
|
59
61
|
import chellow.dloads
|
|
60
62
|
import chellow.e.bill_importer
|
|
@@ -108,6 +110,7 @@ from chellow.models import (
|
|
|
108
110
|
)
|
|
109
111
|
from chellow.utils import (
|
|
110
112
|
HH,
|
|
113
|
+
c_months_c,
|
|
111
114
|
c_months_u,
|
|
112
115
|
csv_make_val,
|
|
113
116
|
ct_datetime,
|
|
@@ -243,6 +246,143 @@ def local_report_post(report_id):
|
|
|
243
246
|
return chellow_redirect(f"/local_reports/{report.id}", 303)
|
|
244
247
|
|
|
245
248
|
|
|
249
|
+
@home.route("/scenarios")
|
|
250
|
+
def scenarios_get():
|
|
251
|
+
scenarios = g.sess.query(Scenario).order_by(Scenario.name).all()
|
|
252
|
+
return render_template("scenarios.html", scenarios=scenarios)
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
@home.route("/scenarios/add", methods=["POST"])
|
|
256
|
+
def scenario_add_post():
|
|
257
|
+
try:
|
|
258
|
+
name = req_str("name")
|
|
259
|
+
properties = req_zish("properties")
|
|
260
|
+
scenario = Scenario.insert(g.sess, name, properties)
|
|
261
|
+
g.sess.commit()
|
|
262
|
+
return chellow_redirect(f"/scenarios/{scenario.id}", 303)
|
|
263
|
+
except BadRequest as e:
|
|
264
|
+
g.sess.rollback()
|
|
265
|
+
flash(e.description)
|
|
266
|
+
scenarios = g.sess.query(Scenario).order_by(Scenario.name)
|
|
267
|
+
return make_response(
|
|
268
|
+
render_template("scenario_add.html", scenarios=scenarios), 400
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
@home.route("/scenarios/add")
|
|
273
|
+
def scenario_add_get():
|
|
274
|
+
now = utc_datetime_now()
|
|
275
|
+
props = {
|
|
276
|
+
"scenario_start_month": now.month,
|
|
277
|
+
"scenario_start_year": now.year,
|
|
278
|
+
"scenario_duration": 1,
|
|
279
|
+
}
|
|
280
|
+
return render_template("scenario_add.html", initial_props=dumps(props))
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
@home.route("/scenarios/<int:scenario_id>")
|
|
284
|
+
def scenario_get(scenario_id):
|
|
285
|
+
start_date = None
|
|
286
|
+
finish_date = None
|
|
287
|
+
duration = 1
|
|
288
|
+
|
|
289
|
+
scenario = Scenario.get_by_id(g.sess, scenario_id)
|
|
290
|
+
props = scenario.props
|
|
291
|
+
site_codes = "\n".join(props.get("site_codes", []))
|
|
292
|
+
try:
|
|
293
|
+
duration = props["scenario_duration"]
|
|
294
|
+
_, finish_date_ct = list(
|
|
295
|
+
c_months_c(
|
|
296
|
+
start_year=props["scenario_start_year"],
|
|
297
|
+
start_month=props["scenario_start_month"],
|
|
298
|
+
months=duration,
|
|
299
|
+
)
|
|
300
|
+
)[-1]
|
|
301
|
+
finish_date = to_utc(finish_date_ct)
|
|
302
|
+
except KeyError:
|
|
303
|
+
pass
|
|
304
|
+
|
|
305
|
+
try:
|
|
306
|
+
start_date = to_utc(
|
|
307
|
+
ct_datetime(
|
|
308
|
+
props["scenario_start_year"],
|
|
309
|
+
props["scenario_start_month"],
|
|
310
|
+
props["scenario_start_day"],
|
|
311
|
+
props["scenario_start_hour"],
|
|
312
|
+
props["scenario_start_minute"],
|
|
313
|
+
)
|
|
314
|
+
)
|
|
315
|
+
except KeyError:
|
|
316
|
+
pass
|
|
317
|
+
|
|
318
|
+
try:
|
|
319
|
+
finish_date = to_utc(
|
|
320
|
+
ct_datetime(
|
|
321
|
+
props["scenario_finish_year"],
|
|
322
|
+
props["scenario_finish_month"],
|
|
323
|
+
props["scenario_finish_day"],
|
|
324
|
+
props["scenario_finish_hour"],
|
|
325
|
+
props["scenario_finish_minute"],
|
|
326
|
+
)
|
|
327
|
+
)
|
|
328
|
+
except KeyError:
|
|
329
|
+
pass
|
|
330
|
+
return render_template(
|
|
331
|
+
"scenario.html",
|
|
332
|
+
scenario=scenario,
|
|
333
|
+
scenario_start_date=start_date,
|
|
334
|
+
scenario_finish_date=finish_date,
|
|
335
|
+
scenario_duration=duration,
|
|
336
|
+
site_codes=site_codes,
|
|
337
|
+
scenario_props=props,
|
|
338
|
+
)
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
@home.route("/scenarios/<int:scenario_id>/edit")
|
|
342
|
+
def scenario_edit_get(scenario_id):
|
|
343
|
+
scenario = Scenario.get_by_id(g.sess, scenario_id)
|
|
344
|
+
return render_template("scenario_edit.html", scenario=scenario)
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
@home.route("/scenarios/<int:scenario_id>/edit", methods=["POST"])
|
|
348
|
+
def scenario_edit_post(scenario_id):
|
|
349
|
+
try:
|
|
350
|
+
scenario = Scenario.get_by_id(g.sess, scenario_id)
|
|
351
|
+
name = req_str("name")
|
|
352
|
+
properties = req_zish("properties")
|
|
353
|
+
scenario.update(name, properties)
|
|
354
|
+
g.sess.commit()
|
|
355
|
+
return chellow_redirect(f"/scenarios/{scenario.id}", 303)
|
|
356
|
+
except BadRequest as e:
|
|
357
|
+
g.sess.rollback()
|
|
358
|
+
description = e.description
|
|
359
|
+
flash(description)
|
|
360
|
+
return make_response(
|
|
361
|
+
render_template(
|
|
362
|
+
"scenario_edit.html",
|
|
363
|
+
scenario=scenario,
|
|
364
|
+
),
|
|
365
|
+
400,
|
|
366
|
+
)
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
@home.route("/scenarios/<int:scenario_id>/edit", methods=["DELETE"])
|
|
370
|
+
def scenario_edit_delete(scenario_id):
|
|
371
|
+
try:
|
|
372
|
+
scenario = Scenario.get_by_id(g.sess, scenario_id)
|
|
373
|
+
scenario.delete(g.sess)
|
|
374
|
+
g.sess.commit()
|
|
375
|
+
res = make_response()
|
|
376
|
+
res.headers["HX-Redirect"] = f"{chellow.utils.url_root}/e/scenarios"
|
|
377
|
+
return res
|
|
378
|
+
except BadRequest as e:
|
|
379
|
+
g.sess.rollback()
|
|
380
|
+
flash(e.description)
|
|
381
|
+
return make_response(
|
|
382
|
+
render_template("scenario_edit.html", scenario=scenario), 400
|
|
383
|
+
)
|
|
384
|
+
|
|
385
|
+
|
|
246
386
|
@home.route("/system")
|
|
247
387
|
def system_get():
|
|
248
388
|
traces = []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: chellow
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1729755916.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)
|
|
@@ -12,7 +12,7 @@ chellow/rate_server.py,sha256=fg-Pf_9Hk3bXmC9riPQNGQxBvLvBa_WtNYdwDCjnCSg,5678
|
|
|
12
12
|
chellow/rrun.py,sha256=1Kt2q_K9UoDG_nsZz-Q6XJiMNKroWqlqFdxn2M6Q8CA,2088
|
|
13
13
|
chellow/testing.py,sha256=Od4HHH6pZrhJ_De118_F55RJEKmAvhUH2S24QE9qFQk,3635
|
|
14
14
|
chellow/utils.py,sha256=32qPWEGzCPKPhSM7ztpzcR6ZG74sVZanScDIdK50Rq4,19308
|
|
15
|
-
chellow/views.py,sha256=
|
|
15
|
+
chellow/views.py,sha256=eb7WUqqu7LmAX5m_9ICJFVpo0i8WZ9GV89AkqRA3aac,84383
|
|
16
16
|
chellow/e/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
chellow/e/aahedc.py,sha256=d2usudp7KYWpU6Pk3fal5EQ47EbvkvKeaFGylnb3NWw,606
|
|
18
18
|
chellow/e/bill_importer.py,sha256=7UcnqNlKbJc2GhW9gy8sDp9GuqambJVpZLvbafOZztA,7411
|
|
@@ -25,10 +25,12 @@ chellow/e/dno_rate_parser.py,sha256=A5TP6KjyfT5lVWh7dX4SiXRi6wnf2lGv-H_T4Sod8CI,
|
|
|
25
25
|
chellow/e/duos.py,sha256=nwviRjz-qIt3GxIMHk0hItIT4dtKsxOWq9TUC1z-hO8,30864
|
|
26
26
|
chellow/e/elexon.py,sha256=ALhXS9Es7PV0z9ukPbIramn3cf3iLyFi-PMWPSm5iOs,5487
|
|
27
27
|
chellow/e/energy_management.py,sha256=aXC2qlGt3FAODlNl_frWzVYAQrJLP8FFOiNX3m-QE_Y,12388
|
|
28
|
-
chellow/e/hh_importer.py,sha256=
|
|
28
|
+
chellow/e/hh_importer.py,sha256=adfogJgPWsJurPOVSBLLQ7m68s1LhfQmDYpAFnGm0eM,21510
|
|
29
29
|
chellow/e/hh_parser_bg_csv.py,sha256=W5SU2MSpa8BGA0VJw1JXF-IwbCNLFy8fe35yxLZ7gEw,2453
|
|
30
30
|
chellow/e/hh_parser_df2.py,sha256=tRAoVUUoJDlfPopm6usEBnhJz7dXMc2_KEWbkW9Gyq4,4330
|
|
31
31
|
chellow/e/hh_parser_edf_csv.py,sha256=CLkkL1Z6BPgVV_3uwS6McmtMzgXkoEIoJnH8FsQk1C8,2839
|
|
32
|
+
chellow/e/hh_parser_schneider_csv.py,sha256=m8FHwXp1Tbas91RPS7TriCskSNRuSaFf1SD9v2HXfSk,2366
|
|
33
|
+
chellow/e/hh_parser_schneider_xlsx.py,sha256=Vtq0TNz-oojoKJm4PeH4ZwBp2I-mjArB9-FL71ctCHs,3590
|
|
32
34
|
chellow/e/hh_parser_simple_csv.py,sha256=lJx9tw9BWFSoBmns1Cws_vY-OIn90LPt2yvIN_CFcTE,2177
|
|
33
35
|
chellow/e/hh_parser_vital_xlsx.py,sha256=g9-CElfH1PPfwpuUcVvD6WQpBlNxCo8j9pq_0Yza0ZM,4125
|
|
34
36
|
chellow/e/laf_import.py,sha256=aqkcbjnvfBPszBLSNg6getP7iW1uWiTVHy6N5Z5x39U,5514
|
|
@@ -41,7 +43,7 @@ chellow/e/system_price.py,sha256=6w5J7bzwFAZubE2zdOFRiS8IIrVP8hkoIOaG2yCt-Ic,623
|
|
|
41
43
|
chellow/e/tlms.py,sha256=M33D6YpMixu2KkwSCzDRM3kThLgShg8exp63Obo75l8,8905
|
|
42
44
|
chellow/e/tnuos.py,sha256=XseYztPUsQXNKuBmystO2kzzwAG9ehCZgpGBTdgSk-A,4313
|
|
43
45
|
chellow/e/triad.py,sha256=lIQj7EdUrcFwEqleuHZXYU_bfzIwNOqUVVxB3NPQt4A,13710
|
|
44
|
-
chellow/e/views.py,sha256=
|
|
46
|
+
chellow/e/views.py,sha256=ZISAhDQZHM8j0VKdMOqfNBtwSLTE9c0OtnsGVCaT0kE,216706
|
|
45
47
|
chellow/e/bill_parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
46
48
|
chellow/e/bill_parsers/activity_mop_stark_xlsx.py,sha256=UgWXDPzQkQghyj_lfgBqoSJpHB-t-qOdSaB8qY6GLog,4071
|
|
47
49
|
chellow/e/bill_parsers/annual_mop_stark_xlsx.py,sha256=-HMoIfa_utXYKA44RuC0Xqv3vd2HLeQU_4P0iBUd3WA,4219
|
|
@@ -99,7 +101,7 @@ chellow/reports/report_csv_llfcs.py,sha256=OHSbP64lQ6dlAMcQYgvdANlA4lQyF0iBlwk7V
|
|
|
99
101
|
chellow/reports/report_csv_site_hh_data.py,sha256=yWhEoGGyg_ctM8T55raksTPRJ5ycVO6lVfUx5tRBzTQ,4372
|
|
100
102
|
chellow/reports/report_csv_site_snags.py,sha256=gG2sYQrLoIBwCoMUC8rhmAL7Kffh_rvNb9UOX7cYDko,2668
|
|
101
103
|
chellow/reports/report_ecoes_comparison.py,sha256=CaeMCpLifP-kh2O9MZPs0EYf4UqksL-xFjwki41DTRA,21444
|
|
102
|
-
chellow/reports/report_g_monthly_duration.py,sha256=
|
|
104
|
+
chellow/reports/report_g_monthly_duration.py,sha256=0b2ze1qW0jSVTEGQhJAg0s42AvkeqjMGNge4OQTIm7s,15919
|
|
103
105
|
chellow/reports/report_g_supplies_snapshot.py,sha256=0M0x_0o0985Hu45gUJJJwzfx0DDOAuXBJ1UVUDbQ36g,4718
|
|
104
106
|
chellow/reports/report_g_supply_virtual_bill.py,sha256=x_KtQ02dwgmXvAEUXJ1poK0BRwqxa-GcbJ5pddEina0,3694
|
|
105
107
|
chellow/reports/report_g_virtual_bills.py,sha256=t3hmTiURk1E_mPucIboCdPBlSLapDIUdHYRpVTFtJgw,4569
|
|
@@ -121,7 +123,7 @@ chellow/templates/downloads.html,sha256=R9QPcFz-PLJOX7rDlmquIk-Hp9Iq-thzWCTfOexS
|
|
|
121
123
|
chellow/templates/edi_viewer.html,sha256=szUthgHOdph6Of-7f_1LeC_zYlNJaMeS5ctn6xTAeiM,1437
|
|
122
124
|
chellow/templates/general_import.html,sha256=SMemHGu466Be3_cAWSS6Hn-Kv-1psbEMDD6NQG6bfbI,1013
|
|
123
125
|
chellow/templates/general_imports.html,sha256=VRmBqYsXsirm880WiFrJ3CknAXAoLR9Mnpz9cKjIeM8,13069
|
|
124
|
-
chellow/templates/home.html,sha256=
|
|
126
|
+
chellow/templates/home.html,sha256=illtSabepcScYwmKss0o2gwvjXGBtr6LkfwmeL6ezSA,5655
|
|
125
127
|
chellow/templates/input_date.html,sha256=rpgB5n0LfN8Y5djN_ZiuSxqdskxzCoKrEqI7hyJkVQo,1248
|
|
126
128
|
chellow/templates/local_report.html,sha256=pV7_0QwyQ-D3OS9LXrly5pq3qprZnwTCoq6vCnMTkS4,1332
|
|
127
129
|
chellow/templates/local_reports.html,sha256=4wbfVkY4wUfSSfWjxqIsvCpIsa9k7H_dGAjznrG5jNM,701
|
|
@@ -145,6 +147,11 @@ chellow/templates/report_run_row.html,sha256=bmtcdqJaS1CXpL0i8PuqvmeF98jKNYX5-mn
|
|
|
145
147
|
chellow/templates/report_run_row_bill_check.html,sha256=aC2LMu_6NvmTN3ZdxHJPPPczyxPN6hg0F-PPcqIWUws,4683
|
|
146
148
|
chellow/templates/report_run_supply_contacts.html,sha256=JNzwz9M6qbLRDMkCzFCxxANapUer5klxo7t5a48nAzg,2117
|
|
147
149
|
chellow/templates/report_runs.html,sha256=ecoIkl2WtfYtifiTxnslmpMGYYGVQW-CVSBpqhXyiE4,1131
|
|
150
|
+
chellow/templates/scenario.html,sha256=eHXgCszqyPW7fzBH-nr25XpKbPj4FIobKRFv3G8uJFY,2010
|
|
151
|
+
chellow/templates/scenario_add.html,sha256=qQpxvhlrQqrNYiIQTHu_NvSoeSKuRNEJQYwLqRlQ8_U,516
|
|
152
|
+
chellow/templates/scenario_docs.html,sha256=901ug6cOmcErEGOqY1H2wcVxl4KavD7-mZz12h3RRB4,6508
|
|
153
|
+
chellow/templates/scenario_edit.html,sha256=x2Eicq_eFs7ax2EtL4GrD73qKF-LhN41OQdPFbDivrc,1060
|
|
154
|
+
chellow/templates/scenarios.html,sha256=FIDOSWs9VO_3bJkQoNHh-DdRzVfUyJGK9WbdEHRxxdM,841
|
|
148
155
|
chellow/templates/site.html,sha256=dj0VgcmjaKJHuTOZDESO2E2MOyluYJtx4YaSOaWOkwU,10024
|
|
149
156
|
chellow/templates/site_add.html,sha256=NxYmOIZQH6X8EBOuJUbhUJ8IYB3t0BukjR1yVRhnJhM,422
|
|
150
157
|
chellow/templates/site_edit.html,sha256=TJ_ZDDkodj-uDB3GPP9Cel3FGZY2oP42KCzHOydPWVc,2909
|
|
@@ -165,7 +172,7 @@ chellow/templates/e/channel_add.html,sha256=szwQJBHx2kAoSFomXDHD0N_7PSd4drqOoAWh
|
|
|
165
172
|
chellow/templates/e/channel_edit.html,sha256=OUkdiS2NBQ_w4gmxRxXAcRToM5BT8DWWJrtQMFs-GUU,2198
|
|
166
173
|
chellow/templates/e/channel_snag.html,sha256=wBJ5KBfeJdAeRmaB0qu0AD9Z4nM5fn6tJ_8bNqTWtoo,1477
|
|
167
174
|
chellow/templates/e/channel_snag_edit.html,sha256=sUFI4Ml3F1B35x8_t_Pz3hWuQN9Xtxr3kt4u8hdxNwY,1911
|
|
168
|
-
chellow/templates/e/channel_snags.html,sha256=
|
|
175
|
+
chellow/templates/e/channel_snags.html,sha256=PuYnDycsQcwmmW9TfCCa_WgJRHOFn9HAnNm51rH7l9k,3157
|
|
169
176
|
chellow/templates/e/comm.html,sha256=DSlAaDg1r4KYq9VUgDtt2lgW6apZjZvwhMujIJINmps,383
|
|
170
177
|
chellow/templates/e/comms.html,sha256=bUXZePnMfpKk1E71qLGOSkx8r3GxdPPD_-MosIXXq4s,434
|
|
171
178
|
chellow/templates/e/cop.html,sha256=ULv7ALFJHMUgPX96hQNm2irc3edtKYHS6fYAxvmzj8M,376
|
|
@@ -370,6 +377,6 @@ chellow/templates/g/supply_note_edit.html,sha256=b8mB6_ucBwoljp03iy6AgVaZUhGw3-1
|
|
|
370
377
|
chellow/templates/g/supply_notes.html,sha256=6epNmZ3NKdXZz27fvmRUGeffg_oc1kmwuBeyRzQe3Rg,854
|
|
371
378
|
chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
|
|
372
379
|
chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
|
|
373
|
-
chellow-
|
|
374
|
-
chellow-
|
|
375
|
-
chellow-
|
|
380
|
+
chellow-1729755916.0.0.dist-info/METADATA,sha256=Lp-eMn2y-rPI63-sLA4iivu6086Tw8IPmrMrBk43EZ0,12204
|
|
381
|
+
chellow-1729755916.0.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
382
|
+
chellow-1729755916.0.0.dist-info/RECORD,,
|
|
File without changes
|