Introducing _MaskBase class, of which Mask is a subclass
This commit is contained in:
parent
fd4ceef0f1
commit
9322c27af9
1 changed files with 15 additions and 2 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue