From 9322c27af93718df6938672d585590ae4e5d583c Mon Sep 17 00:00:00 2001 From: Nicolas Mounet Date: Wed, 26 May 2021 18:57:56 +0200 Subject: [PATCH] Introducing _MaskBase class, of which Mask is a subclass --- cara/models.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/cara/models.py b/cara/models.py index c2500d68..f5e80d1a 100644 --- a/cara/models.py +++ b/cara/models.py @@ -472,8 +472,21 @@ Virus.types = { @dataclass(frozen=True) -class Mask: - #: Filtration efficiency. (In %/100) +class _MaskBase: + """ + Represents the filtration of aerosols by a mask, both inward and + outward. + The nature of the various air exchange schemes means that it is expected + for subclasses of _MaskBase to exist. + """ + def exhale_efficiency(self, diameter: float) -> _VectorisedFloat: + # Overall efficiency, including the effect of the leaks. + raise NotImplementedError("Subclass must implement") + + +@dataclass(frozen=True) +class Mask(_MaskBase): + #: Filtration efficiency. η_exhale: _VectorisedFloat #: Leakage through side of masks.