fixed mypy errors
This commit is contained in:
parent
11be1abf8e
commit
4a965edde6
2 changed files with 8 additions and 7 deletions
|
|
@ -124,8 +124,8 @@ class ExposureModelResult(View):
|
|||
figure_legends = [mlines.Line2D([], [], color='#3530fe', markersize=15, label='CO₂ concentration'),
|
||||
patches.Patch(edgecolor="#96cbff", facecolor='#96cbff', label='Presence of person(s)')]
|
||||
self.ax.legend(handles=figure_legends)
|
||||
if 1500 < max(concentration):
|
||||
self.ax.set_ylim(top=max(concentration)*1.1)
|
||||
if 1500 < concentration_top:
|
||||
self.ax.set_ylim(top=concentration_top*1.1)
|
||||
else:
|
||||
self.ax.set_ylim(top=1550)
|
||||
self.ax.hlines([800, 1500], xmin=min(model.CO2_emitters.presence.boundaries()[0])*0.95, xmax=max(model.CO2_emitters.presence.boundaries()[1])*1.05, colors=['limegreen', 'salmon'], linestyles='dashed')
|
||||
|
|
@ -139,7 +139,7 @@ class CO2Application(Controller):
|
|||
|
||||
#: A list of scenario name and ModelState instances. This is intended to be
|
||||
#: mutated. Any mutation should notify the appropriate Views for handling.
|
||||
self._model_scenarios = []
|
||||
self._model_scenarios: typing.List[ScenarioType] = []
|
||||
self._active_scenario = 0
|
||||
self.multi_model_view = MultiModelView(self)
|
||||
# self.comparison_view = ExposureComparissonResult()
|
||||
|
|
|
|||
|
|
@ -1008,11 +1008,12 @@ class _ConcentrationModelBase:
|
|||
if not self.population.person_present(time):
|
||||
return self.min_background_concentration()/self.normalization_factor()
|
||||
V = self.room.volume
|
||||
# RR = self.removal_rate(time) if self.removal_rate(time) != 0 else 0.25
|
||||
RR = self.removal_rate(time)
|
||||
|
||||
return (1. / (RR * V) + self.min_background_concentration()/
|
||||
try:
|
||||
return (1. / (RR * V) + self.min_background_concentration()/
|
||||
self.normalization_factor())
|
||||
except ZeroDivisionError:
|
||||
return 0
|
||||
|
||||
@method_cache
|
||||
def state_change_times(self) -> typing.List[float]:
|
||||
|
|
@ -1211,7 +1212,7 @@ class CO2ConcentrationModel(_ConcentrationModelBase):
|
|||
return self.CO2_emitters
|
||||
|
||||
def removal_rate(self, time: float) -> _VectorisedFloat:
|
||||
return self.ventilation.air_exchange(self.room, time) + 0.25
|
||||
return self.ventilation.air_exchange(self.room, time)
|
||||
|
||||
def min_background_concentration(self) -> _VectorisedFloat:
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue