caimira: inject package version
This commit is contained in:
parent
73bed86bca
commit
c7a5948cd2
3 changed files with 8 additions and 7 deletions
|
|
@ -24,7 +24,7 @@ class Application(tornado.web.Application):
|
|||
settings = dict(
|
||||
debug=True,
|
||||
)
|
||||
super(Application, self).__init__(handlers, **settings)
|
||||
super().__init__(handlers, **settings)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import re
|
|||
|
||||
import numpy as np
|
||||
|
||||
from caimira import __version__ as calculator_version
|
||||
from ..form_validator import FormData, cast_class_fields, time_string_to_minutes
|
||||
from ..defaults import (DEFAULTS, CONFIDENCE_LEVEL_OPTIONS,
|
||||
MECHANICAL_VENTILATION_TYPES, MASK_WEARING_OPTIONS, MONTH_NAMES, VACCINE_BOOSTER_TYPE, VACCINE_TYPE,
|
||||
|
|
@ -199,7 +200,7 @@ class VirusFormData(FormData):
|
|||
if total_percentage != 100:
|
||||
raise ValueError(
|
||||
f'The sum of all respiratory activities should be 100. Got {total_percentage}.')
|
||||
|
||||
|
||||
# Validate number of people with short-range interactions
|
||||
max_occupants_for_sr = self.total_people - self.infected_people
|
||||
if self.short_range_occupants > max_occupants_for_sr:
|
||||
|
|
@ -559,7 +560,7 @@ def baseline_raw_form_data() -> typing.Dict[str, typing.Union[str, float]]:
|
|||
'mask_type': 'Type I',
|
||||
'mask_wearing_option': 'mask_off',
|
||||
'mechanical_ventilation_type': '',
|
||||
'calculator_version': '4.17.0', #TODO different version for API and calculator form?
|
||||
'calculator_version': calculator_version,
|
||||
'opening_distance': '0.2',
|
||||
'event_month': 'January',
|
||||
'room_heating_option': '0',
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ class ConcentrationModel(BaseRequestHandler):
|
|||
self.set_status(400)
|
||||
self.finish(json.dumps(response_json))
|
||||
return
|
||||
|
||||
|
||||
base_url = self.request.protocol + "://" + self.request.host
|
||||
report_generator: VirusReportGenerator = self.settings['report_generator']
|
||||
executor = loky.get_reusable_executor(
|
||||
|
|
@ -265,7 +265,7 @@ class StaticModel(BaseRequestHandler):
|
|||
data_service.update_registry(data_registry)
|
||||
|
||||
form = virus_report_controller.generate_form_obj(virus_validator.baseline_raw_form_data(), data_registry)
|
||||
|
||||
|
||||
base_url = self.request.protocol + "://" + self.request.host
|
||||
report_generator: VirusReportGenerator = self.settings['report_generator']
|
||||
executor = loky.get_reusable_executor(max_workers=self.settings['handler_worker_pool_size'])
|
||||
|
|
@ -429,7 +429,7 @@ class CO2ModelResponse(BaseRequestHandler):
|
|||
report_task = executor.submit(
|
||||
CO2_report_generator.build_fitting_results, form,
|
||||
)
|
||||
|
||||
|
||||
report = await asyncio.wrap_future(report_task)
|
||||
self.finish(report)
|
||||
|
||||
|
|
@ -529,7 +529,7 @@ def make_app(
|
|||
data_service_enabled = int(os.environ.get('DATA_SERVICE_ENABLED', 0))
|
||||
except ValueError:
|
||||
data_service_enabled = None
|
||||
|
||||
|
||||
if data_service_enabled: data_service = DataService.create()
|
||||
|
||||
return Application(
|
||||
|
|
|
|||
Loading…
Reference in a new issue