From 3206a069a0cdcfad3a42df027675abcbf2758163 Mon Sep 17 00:00:00 2001 From: Phil Elson Date: Fri, 6 Aug 2021 14:29:47 +0200 Subject: [PATCH] After review under snakeviz, introduce some further caching for performance gains. --- cara/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cara/models.py b/cara/models.py index 51fc2bbf..53cf52bc 100644 --- a/cara/models.py +++ b/cara/models.py @@ -676,6 +676,7 @@ class InfectedPopulation(Population): #: The type of expiration that is being emitted whilst doing the activity. expiration: _ExpirationBase + @method_cache def emission_rate_when_present(self) -> _VectorisedFloat: """ The emission rate if the infected population is present. @@ -751,6 +752,7 @@ class ConcentrationModel: + self.ventilation.air_exchange(self.room, time) ) + @method_cache def _concentration_limit(self, time: float) -> _VectorisedFloat: """ Provides a constant that represents the theoretical asymptotic