Skip to content

Commit 190dc31

Browse files
committed
fixes from user testing feedbacks
1 parent cbcdefe commit 190dc31

14 files changed

Lines changed: 66 additions & 41 deletions

infra/helm/qmra/dev.values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace: qmra
66
domain: dev.qmra.org
77
monitoring_domain: dev2.qmra.org
88
replicaCount: 1
9+
debug: true
910

1011
app_secret_key:
1112
secret_name: qmra-secret-key-secret

infra/helm/qmra/prod.values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ namespace: qmra
66
domain: qmra.org
77
monitoring_domain: monitoring.qmra.org
88
replicaCount: 1
9+
debug: false
910

1011
app_secret_key:
1112
secret_name: qmra-secret-key-secret

infra/helm/qmra/templates/configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
namespace: {{ .Values.namespace }}
55
name: {{ .Values.configmap_name }}
66
data:
7-
DEBUG: "true"
7+
DEBUG: {{ .values.debug }}
88
DOMAIN_NAME: {{ .Values.domain }}
99
SQLITE_PATH: {{ .Values.sqlite.mount_path }}
1010
STATIC_ROOT: {{ .Values.static.mount_path }}

qmra/risk_assessment/plots.py

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def risk_plots(risk_assessment_results, output_type="div"):
3131
q3=[r.infection_minimum_lrv_q3, r.infection_maximum_lrv_q3],
3232
median=[r.infection_minimum_lrv_median, r.infection_maximum_lrv_median],
3333
name=r.pathogen,
34-
marker=dict(color=COLORS[r.pathogen])
34+
marker=dict(color=COLORS[r.pathogen]),
35+
hoverinfo="y"
3536
))
3637
# infection_prob_fig.add_annotation(text=r.pathogen, showarrow=False, xref="paper", yref="paper", x=(i+1)/7, y=0)
3738
dalys_fig.add_trace(go.Box(
@@ -42,7 +43,8 @@ def risk_plots(risk_assessment_results, output_type="div"):
4243
q3=[r.dalys_minimum_lrv_q3, r.dalys_maximum_lrv_q3],
4344
median=[r.dalys_minimum_lrv_median, r.dalys_maximum_lrv_median],
4445
name=r.pathogen,
45-
marker=dict(color=COLORS[r.pathogen])
46+
marker=dict(color=COLORS[r.pathogen]),
47+
hoverinfo="y"
4648
))
4749
# dalys_fig.add_annotation(text=r.pathogen, showarrow=False, xref="paper", yref="paper", x=(i+1)/7, y=0)
4850

@@ -73,9 +75,9 @@ def risk_plots(risk_assessment_results, output_type="div"):
7375
text="tolerable risk level",
7476
textposition="end",
7577
yanchor="top",
76-
font=dict(color="#FFAA27")
78+
font=dict(color="#FF0000")
7779
),
78-
line=dict(color="#FFAA27", width=3)
80+
line=dict(color="#FF0000", width=1)
7981
)
8082
infection_prob_fig.update_traces(
8183
marker_size=8
@@ -107,14 +109,24 @@ def risk_plots(risk_assessment_results, output_type="div"):
107109
text="tolerable risk level",
108110
textposition="end",
109111
yanchor="top",
110-
font=dict(color="#FFAA27")
112+
font=dict(color="#FF0000")
111113
),
112-
line=dict(color="#FFAA27", width=3)
114+
line=dict(color="#FF0000", width=1)
113115
)
114116
dalys_fig.update_traces(
115117
marker_size=8
116118
)
117119
if output_type == "div":
118-
return plot(infection_prob_fig, output_type="div", config={"displaylogo": False, "modeBarButtonsToRemove": ['zoom2d', 'pan2d', 'select2d', 'lasso2d', 'zoomIn2d', 'zoomOut2d', 'autoScale2d', 'resetScale2d']}, include_plotlyjs=False), \
119-
plot(dalys_fig, output_type="div", config={"displaylogo": False, "modeBarButtonsToRemove": ['zoom2d', 'pan2d', 'select2d', 'lasso2d', 'zoomIn2d', 'zoomOut2d', 'autoScale2d', 'resetScale2d']}, include_plotlyjs=False)
120+
return plot(infection_prob_fig, output_type="div", config={"displaylogo": False,
121+
"modeBarButtonsToRemove": ['zoom2d', 'pan2d',
122+
'select2d', 'lasso2d',
123+
'zoomIn2d', 'zoomOut2d',
124+
'autoScale2d',
125+
'resetScale2d']},
126+
include_plotlyjs=False), \
127+
plot(dalys_fig, output_type="div", config={"displaylogo": False,
128+
"modeBarButtonsToRemove": ['zoom2d', 'pan2d', 'select2d',
129+
'lasso2d', 'zoomIn2d', 'zoomOut2d',
130+
'autoScale2d', 'resetScale2d']},
131+
include_plotlyjs=False)
120132
return infection_prob_fig.to_image(format=output_type), dalys_fig.to_image(format=output_type)

qmra/risk_assessment/risk.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ def get_annual_risk(
1414
n_events: int = 10_000,
1515
n_years: int = 1000,
1616
):
17-
inflow = np.random.normal(
17+
generator = np.random.default_rng(seed=42)
18+
inflow = generator.normal(
1819
loc=(np.log10(inflow_min + 10 ** (-8)) + np.log10(inflow_max)) / 2,
1920
scale=(np.log10(inflow_max) - np.log10(inflow_min + 10 ** (-8))) / 4,
2021
size=n_events
@@ -23,7 +24,7 @@ def get_annual_risk(
2324
outflow = inflow - lrv
2425
dose = (10 ** outflow) * volume_per_event
2526
event_probs = distribution.pdf(dose)
26-
event_samples = np.random.choice(event_probs, size=(n_years, events_per_year), replace=True)
27+
event_samples = generator.choice(event_probs, size=(n_years, events_per_year), replace=True)
2728
return 1 - np.prod(1 - event_samples, axis=1)
2829

2930

qmra/risk_assessment/templates/assessment-configurator.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ <h4 class="ml-3">Risk assessment parameters</h4>
8585
<h4>Exposure: <span id="exposure-info-name"></span></h4>
8686
<div class="test-muted small mb-4" id="exposure-info-description"></div>
8787
<div class="mb-4" id="exposure-info-values"></div>
88-
<div class="small mb-4"><sup>[1]</sup>values taken from <a id="exposure-info-reference" href=""></a>
88+
<div class="small mb-4"><sup>[1]</sup>values taken from <a id="exposure-info-reference" href="" target="_blank" rel="noopener noreferrer"></a>
8989
</div>
9090
</div>
9191
<div id="source-info">
@@ -115,7 +115,7 @@ <h4>Source water: <span id="source-info-name"></span></h4>
115115
</tr>
116116
</table>
117117
</div>
118-
<div class="small mb-4"><sup>[1]</sup>values taken from <a id="source-info-reference" href=""></a>
118+
<div class="small mb-4"><sup>[1]</sup>values taken from <a id="source-info-reference" href="" target="_blank" rel="noopener noreferrer"></a>
119119
</div>
120120
</div>
121121
<div id="treatment-info">
@@ -156,6 +156,8 @@ <h4>Treatments</h4>
156156
e.preventDefault();
157157
e.stopPropagation();
158158
if (!form.checkValidity()) { form.reportValidity(); return; }
159+
const accepted_redirect = confirm("Any unsaved changes to your risk assessment will be lost.\nAre you sure you want to continue?")
160+
if (!accepted_redirect) return;
159161
const frm = new FormData(form);
160162
return fetch(form.action, {
161163
method: "POST",

qmra/risk_assessment/templates/assessment-result.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ <h4 class="mt-3 mx-5 text-center">Result</h4>
4040
<br/>
4141
<div>
4242
<strong>More efficient treatments or additional treatment
43-
steps are necessary to achieve a tolerable risk level for the water reuse scenario.
43+
steps are likely to be necessary to achieve a tolerable risk level for the water reuse scenario.
4444
</strong>
4545
</div>
4646
{% endif %}

qmra/risk_assessment/templates/configurator-guided-tour.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
{
2222
title: "Step 4: Treatment",
23-
content: "Finally, select the treatment processes that have been planned or are currently implemented in your system to complete your risk assessment. Each treatment option is associated with a specific Log Removal Value (LRV) for viruses, bacteria, and protozoan parasites. The QMRA tool includes a range of default LRVs derived from international guidance documents for both wastewater and drinking water technologies. For the most accurate results, consider using locally obtained removal values. The tool is highly customizable, allowing you to add your own treatments by clicking on “My Treatments” in the navigation bar, include non-technical barriers (e.g. hygiene practices), or even apply a negative LRV to simulate recontamination scenarios.",
23+
content: "Finally, select the treatment processes that have been planned or are currently implemented in your system to complete your risk assessment. Each treatment option is associated with a specific Log Removal Value (LRV) for viruses, bacteria, and protozoan parasites. LRVs are determined by measuring pathogens (or indicator organisms) in the influent and effluent of the treatment step and calculating LRV by: <math display='block'><mrow><mi>LRV</mi><mo>=</mo><msub><mi>log</mi><mn>10</mn></msub><mfrac><mrow><mi>influent concentration</mi></mrow><mrow><mi>effluent concentration</mi></mrow></mrow></math> The QMRA tool includes a range of default LRVs derived from international guidance documents for both wastewater and drinking water technologies. For the most accurate results, consider using locally obtained removal values. The tool is highly customizable, allowing you to add your own treatments in the “New Treatment” tab on the right of the risk assessment configuration page, include non-technical barriers (e.g. hygiene practices), or even apply a negative LRV to simulate recontamination scenarios. Note: Click the “Save & Continue” Button and save your risk assessment before creating a new treatment.",
2424
target: "#treatment-content",
2525
order: 3
2626
},

qmra/risk_assessment/templates/faqs.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ <h5>1. What is Quantitative Microbial Risk Assessment (QMRA)?</h5>
99
to assess the likelihood of illness from pathogens in water.</p>
1010
<h5>2. Is this tool free to use?</h5>
1111
<p>Yes, the QMRA tool is completely free to use. It provides you with powerful resources and guidance to assess
12-
microbial risks in your water reuse schemes without any cost. You can access the underlying database here (link
13-
to
14-
Aquanes database) and associated <a href="https://github.com/KWB-R/qmra-webapp">github repository</a>.</p>
12+
microbial risks in your water reuse schemes without any cost.</p>
1513
<h5>3. Who should use this QMRA tool?</h5>
1614
<p>This tool is designed for water safety professionals, engineers, and public health officials involved in water
1715
reuse schemes. It is also suitable for researchers, students, and anyone interested in understanding the risks
@@ -87,7 +85,7 @@ <h5>6. What types of water reuse schemes can this tool assess?</h5>
8785
<h5>7. What data are used in the tool and where can I access them?</h5>
8886
<p>The tool uses data (e.g. pathogen concentrations in different source waters, LRV for specific water treatments)
8987
derived from scientific literature and international guidance documents. All references are transparently listed in
90-
the “Reference” tab of the risk assessment configuration page, and in the QMRA tool database (Link to the database).</p>
88+
the “Reference” tab of the risk assessment configuration page.</p>
9189
<h5>8. Can I customize the parameters in the tool?</h5>
9290
<p>Absolutely! While the tool provides default values and guidance, you can fully customize the parameters, such as
9391
pathogen concentrations, treatment effectiveness (Log Removal Values - LRV), and exposure scenarios, to match your
@@ -108,8 +106,8 @@ <h5>11. What support is available if I have questions?</h5>
108106
documentation or contact our support team for assistance.</p>
109107
<h5>12. Is the tool compliant with international guidelines?</h5>
110108
<p>Yes, the tool is developed based on international guidelines for water safety and QMRA, ensuring that your
111-
assessments are aligned with best practices and standards. The specific guidelines used are accessible via the QMRA
112-
database (Link to database).</p>
109+
assessments are aligned with best practices and standards. The specific guidelines used are accessible via the "Reference"
110+
tab of the risk assessment configuration page.</p>
113111
<h5>13. What are the limitations of this tool?</h5>
114112
<p>While the QMRA Tool is a powerful resource for assessing microbial risks in water reuse schemes, it does have some
115113
limitations:</p>

qmra/risk_assessment/templates/risk-assessment-list.html

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<script type="text/javascript">
55
const baseUrl = '/assessment'
66
function deleteAssessment(assessmentId) {
7+
const confirmed = confirm("Are you sure that you want to delete this assessment?")
8+
if (!confirmed) return;
79
fetch(baseUrl + '/' + assessmentId, {
810
method: "DELETE",
911
headers: { 'X-CSRFToken': document.querySelector('[name=csrfmiddlewaretoken]').value },
@@ -97,7 +99,8 @@ <h4 class="media-heading text-truncate kwb_headline">
9799
<a data-toggle="tooltip" title="edit" class="mr-1" href="{% url 'assessment' assessment.id %}">
98100
<img src="{% static 'img/pen.svg' %}">
99101
</a>
100-
<label data-toggle="tooltip" title="delete" onclick="event.stopPropagation(); deleteAssessment('{{assessment.id}}')" style="cursor: pointer;">
102+
<label data-toggle="tooltip" title="delete"
103+
onclick="event.preventDefault(); deleteAssessment('{{assessment.id}}')" style="cursor: pointer;">
101104
<input type="submit" hidden="hidden">
102105

103106
<img src="{% static 'img/close.svg' %}">
@@ -135,7 +138,7 @@ <h4 class="media-heading text-truncate kwb_headline">
135138
<h5>Welcome to the QMRA Tool for Water Reuse</h5>
136139
<p>This tool is designed to support Quantitative Microbial Risk Assessment (QMRA) for human health in the
137140
context of water reuse. Whether you're evaluating the safety of treated wastewater or other reclaimed
138-
water sources, this tool helps you assess potential health risks associated with microbial contaminants.</p>
141+
water sources, this tool helps you toassess potential health risks associated with microbial contaminants.</p>
139142
<h5>Free and User-Friendly</h5>
140143
<p>Our QMRA tool is completely free to use, offering you a powerful resource to assess microbial risks in
141144
water reuse schemes. You can use the tool without logging in, making it quick and easy to get started.</p>
@@ -196,22 +199,23 @@ <h5>Enhanced Features for Registered Users</h5>
196199
},
197200
shapes: [{
198201
type: 'line',
199-
label: {text: "tolerable risk level", font: {color: '#FFAA27', size: 14}, textposition: "end"},
202+
label: {text: "tolerable risk level", font: {color: '#FF0000', size: 14}, textposition: "end"},
200203
x0: 0,
201204
y0: .0001,
202205
x1: 1,
203206
y1: .0001,
204207
xref: "paper",
205208
line: {
206-
color: '#FFAA27',
207-
width: 2,
209+
color: '#FF0000',
210+
width: 1,
208211
dash: 'dashdot'
209212
}
210213
}],
211214
xaxis: {
212215
autorange: true,
213-
automargin: true
214-
},
216+
automargin: true,
217+
tickfont: {size: 16}
218+
},
215219
autosize: true,
216220
font_color: "black",
217221
margin: { t: 0 },
@@ -253,7 +257,6 @@ <h5>Enhanced Features for Registered Users</h5>
253257
xaxis: "x",
254258
yaxis: "y",
255259
marker: { color: color, opacity: .75, fillmode: "overlay", pattern: {shape: "/"} },
256-
257260
showlegend: i === 0,
258261
offsetgroup: r.pathogen,
259262
legendgroup: "min - max range",

0 commit comments

Comments
 (0)