Changed "short range" to "short-range"

This commit is contained in:
Luis Aleixo 2022-03-24 11:18:08 +01:00
parent 616e56f8a9
commit a1e577015f
6 changed files with 32 additions and 32 deletions

View file

@ -110,7 +110,7 @@ def concentrations_with_sr_breathing(model: models.ExposureModel, times: typing.
lower_concentrations = []
for time in times:
for index, (start, stop) in enumerate(short_range_intervals):
# For visualization issues, add short range breathing activity to the initial long range concentrations
# For visualization issues, add short-range breathing activity to the initial long range concentrations
if start <= time <= stop and short_range_activities[index] == 'Breathing':
lower_concentrations.append(np.array(model.concentration(float(time))).mean())
break

View file

@ -403,7 +403,7 @@ function validate_form(form) {
}
}
// Generate the short range interactions list
// Generate the short-range interactions list
var short_range_interactions = [];
$(".form_field_outer_row").each(function (index, element){
let obj = {};
@ -598,7 +598,7 @@ function validate_sr_time(obj) {
return overlapped_times(obj, start_time, finish_time);
};
// Check if short range durations are filled, and if there is no repetitions
// Check if short-range durations are filled, and if there is no repetitions
function validate_sr_parameter(obj, error_message) {
if ($(obj).val() == "" || $(obj).val() == null) {
if (!$(obj).hasClass("red_border") && !$(obj).prop("disabled")) {
@ -651,7 +651,7 @@ $(document).ready(function () {
elemObj.checked = (value==1);
}
// Read short range from URL
// Read short-range from URL
else if (name == 'short_range_interactions') {
let index = 1;
for (const interaction of JSON.parse(value)) {
@ -911,7 +911,7 @@ $(document).ready(function () {
});
});
//Edit short range activity type
//Edit short-range activity type
$("body").on("click", ".edit_node_btn_frm_field", function() {
$(this).hide();
let id = $(this).attr('id').split('_').slice(-1)[0];
@ -921,7 +921,7 @@ $(document).ready(function () {
document.getElementById('validate_row_no_' + String(id)).style.cssText = 'display:inline !important';
})
//Remove short range interaction (modal field row).
//Remove short-range interaction (modal field row).
$("body").on("click", ".remove_node_btn_frm_field", function() {
$(this).closest(".form_field_outer_row").remove();
// On delete, check open/unvalidated rows.
@ -932,7 +932,7 @@ $(document).ready(function () {
});
});
//Short range modal - close and save button
//Short-range modal - close and save button
$("body").on("click", ".close_btn_frm_field", function() {
$(".validate_node_btn_frm_field").click();
if ($(".form_field_outer").find(".form_field_outer_row.row_validated").length == $(".form_field_outer").find(".form_field_outer_row").length) {
@ -942,7 +942,7 @@ $(document).ready(function () {
}
});
//Short range modal - reset button
//Short-range modal - reset button
$("body").on("click", ".dismiss_btn_frm_field", function() {
$(".form_field_outer_row").remove();
$("#sr_interactions").text(0);

View file

@ -1,7 +1,7 @@
/* Generate the concentration plot using d3 library. */
function draw_plot(svg_id) {
// Used for controlling the short range interactions
// Used for controlling the short-range interactions
let button_full_exposure = document.getElementById("button_full_exposure");
let button_hide_high_concentration = document.getElementById("button_hide_high_concentration");
let long_range_checkbox = document.getElementById('long_range_cumulative_checkbox')
@ -117,7 +117,7 @@ function draw_plot(svg_id) {
var legendShortRangeText = {};
sr_unique_activities.forEach((b, index) => {
legendShortRangeText[index] = vis.append('text')
.text('Short range - ' + sr_unique_activities[index])
.text('Short-range - ' + sr_unique_activities[index])
.style('font-size', '15px')
.attr('alignment-baseline', 'central');
});
@ -179,7 +179,7 @@ function draw_plot(svg_id) {
.attr('fill-opacity', '0.1');
});
// Area representing the short range interaction(s).
// Area representing the short-range interaction(s).
var shortRangeArea = {};
var drawShortRangeArea = {};
short_range_intervals.forEach((b, index) => {
@ -273,7 +273,7 @@ function draw_plot(svg_id) {
})));
});
// Short Range Area.
// Short-Range Area.
short_range_intervals.forEach((b, index) => {
shortRangeArea[index].x(d => xTimeRange(d.time))
.y0(graph_height - 50)
@ -510,7 +510,7 @@ function draw_alternative_scenarios_plot(concentration_plot_svg_id, alternative_
// D3 array of ten categorical colors represented as RGB hexadecimal strings.
var colors = d3.schemeAccent;
// Used for controlling the short range interactions
// Used for controlling the short-range interactions
let button_full_exposure = document.getElementById("button_alternative_full_exposure");
let button_hide_high_concentration = document.getElementById("button_alternative_hide_high_concentration");

View file

@ -366,7 +366,7 @@
<hr width="80%">
<div class="split">
<div style="min-width: 22em">Short range interactions (without masks):</div>
<div style="min-width: 22em">Short-range interactions (without masks):</div>
<div>
<input class="ml-2" type="radio" id="short_range_no" name="short_range_option" value="short_range_no" checked="checked">
<label for="short_range_no">No</label>
@ -374,12 +374,12 @@
<label for="short_range_yes">Yes</label>
</div>
</div>
<p id="short_range_warning" class="red_text" style="margin-right: 2rem">The use of masks mitigates exposure at short-range. The analytical model with short range interactions does not take mask wearing into account.</p>
<p id="short_range_warning" class="red_text" style="margin-right: 2rem">The use of masks mitigates exposure at short-range. The analytical model with short-range interactions does not take mask wearing into account.</p>
<div id="DIVsr_interactions" class="none">
<div class="d-flex">
<button type="button" id="set_interactions_button" class="btn btn-primary btn-sm" data-toggle="modal" data-target="#short_range_dialog" data-keyboard="false" data-backdrop="static">Set interactions</button>
<p class="align-self-center pl-4"><b id="sr_interactions">0</b> short range interactions.</p>
<p class="align-self-center pl-4"><b id="sr_interactions">0</b> short-range interactions.</p>
</div>
</div>
@ -387,7 +387,7 @@
<div class="modal-dialog modal-xl" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="short_range_dialogTitle">Short range interactions</h5>
<h5 class="modal-title" id="short_range_dialogTitle">Short-range interactions</h5>
</div>
<div class="modal-body">
<div class="col-md-12 p-0 form-group" id="dialog_sr">

View file

@ -326,7 +326,7 @@
</p></li>
{% if form.short_range_option == "short_range_yes" %}
<li><p class="data_text">
Short range interactions: {{ form.short_range_interactions|length }}
Short-range interactions: {{ form.short_range_interactions|length }}
</p></li>
<ul>
{% for interaction in form.short_range_interactions %}

View file

@ -1074,7 +1074,7 @@ class ConcentrationModel:
@dataclass(frozen=True)
class ShortRangeModel:
#: Short range activities and respective interactions
#: Short-range activities and respective interactions
presence: typing.Tuple[typing.Tuple[str, SpecificInterval], ...]
#: Expiration types
@ -1085,15 +1085,15 @@ class ShortRangeModel:
def _normed_concentration(self, concentration_model: ConcentrationModel, time: float) -> _VectorisedFloat:
"""
Virus short range exposure concentration, as a function of time.
Virus short-range exposure concentration, as a function of time.
If the given time falls within a short range interval it returns the
short range concentration normalized by the virus viral load. Otherwise
If the given time falls within a short-range interval it returns the
short-range concentration normalized by the virus viral load. Otherwise
it returns 0.
"""
for index, (activity, period) in enumerate(self.presence):
start, stop = tuple(period.boundaries())
# Verifies if the given time falls within a short range interaction
# Verifies if the given time falls within a short-range interaction
if start < time <= stop:
dilution = self.dilutions[index]
jet_origin_concentration = self.expirations[index].jet_origin_concentration()
@ -1101,19 +1101,19 @@ class ShortRangeModel:
long_range_normed_concentration = concentration_model.concentration(time) / concentration_model.virus.viral_load_in_sputum
# The long range concentration values are then approximated using interpolation:
# The set of points where we want the interpolated values are the short range particle diameters (given the current expiration);
# The set of points where we want the interpolated values are the short-range particle diameters (given the current expiration);
# The set of points with a known value are the long range particle diameters (given the initial expiration);
# The set of known values are the long range concentration values normalized by the viral load.
long_range_normed_concentration_interpolated=np.interp(self.expirations[index].particle.diameter, concentration_model.infected.particle.diameter, long_range_normed_concentration)
# Short range concentration formula. The long range concentration is added in the concentration method (ExposureModel).
# Short-range concentration formula. The long range concentration is added in the concentration method (ExposureModel).
return ((1/dilution)*(jet_origin_concentration - long_range_normed_concentration_interpolated))
return 0.
def short_range_concentration(self, concentration_model: ConcentrationModel, time: float):
"""
Virus short range exposure concentration, as a function of time.
Virus short-range exposure concentration, as a function of time.
"""
return (self._normed_concentration(concentration_model, time) *
concentration_model.virus.viral_load_in_sputum)
@ -1121,13 +1121,13 @@ class ShortRangeModel:
@method_cache
def _normed_short_range_concentration_cached(self, concentration_model: ConcentrationModel, time: float) -> _VectorisedFloat:
# A cached version of the _normed_concentration method. Use this
# method if you expect that there may be multiple short range concentration
# method if you expect that there may be multiple short-range concentration
# calculations for the same time (e.g. at state change times).
return self._normed_concentration(concentration_model, time)
def normed_exposure_between_bounds(self, concentration_model: ConcentrationModel, time1: float, time2: float):
"""
Get the integrated short range concentration of viruses in the air between the times start and stop,
Get the integrated short-range concentration of viruses in the air between the times start and stop,
normalized by the virus viral load.
"""
for index, (activity, period) in enumerate(self.presence):
@ -1165,7 +1165,7 @@ class ExposureModel:
#: The virus concentration model which this exposure model should consider.
concentration_model: ConcentrationModel
#: The short range model which this exposure model should consider.
#: The short-range model which this exposure model should consider.
short_range: ShortRangeModel
#: The population of non-infected people to be used in the model.
@ -1207,7 +1207,7 @@ class ExposureModel:
Virus exposure concentration, as a function of time.
It considers the long range concentration with the
contribution of the short range concentration.
contribution of the short-range concentration.
"""
return (self.concentration_model.concentration(time) +
self.short_range.short_range_concentration(self.concentration_model, time))
@ -1249,8 +1249,8 @@ class ExposureModel:
The number of virus per m^3 deposited on the respiratory tract
between any two times.
Considers a contribution between the short range and long range exposures:
It calculates the deposited exposure given a short range interaction (if any).
Considers a contribution between the short-range and long range exposures:
It calculates the deposited exposure given a short-range interaction (if any).
Then, the deposited exposure given the long range interactions is added to the
initial deposited exposure.
"""