cara/caimira/tests/models/test_mask.py
lrdossan 20b0467f89 Backend separation
- extract, isolate and package it in a completely independent Python module, versioned and in a way that allows releases on PyPI.org
- fixed error in placeholder for secondary school (data registry defaults)
- added restriction in pytest version to install
- expected number of new cases fix
- data registry update (schema v2.1.1)
- github update
- deprecate ExpertApplication and CO2Application
- changes to reflect schema update 2.0.2
- version update
- Fixed error with f_inf (short-range)
- new folder layout
- Conditional probability data update
- General fixes
- Fitting results in L/S/person
- CO2 fitting algorithm refinement
2024-09-02 17:39:46 +02:00

34 lines
968 B
Python

import numpy as np
import numpy.testing as npt
import pytest
from caimira.calculator.models import models
@pytest.mark.parametrize(
"η_inhale, expected_inhale_efficiency",
[
[0.5, 0.5],
[np.array([0.3, 0.5]), np.array([0.3, 0.5])],
],
)
def test_mask_inhale(η_inhale, expected_inhale_efficiency):
mask = models.Mask(η_inhale=η_inhale)
npt.assert_equal(mask.inhale_efficiency(),
expected_inhale_efficiency)
@pytest.mark.parametrize(
"diameter, factor_exhale, expected_exhale_efficiency",
[
[0.3, 1., 0.],
[0.7, 0.3, 0.56711*0.3],
[1., 1., 0.7149],
[4., 0.5, 0.8167*0.5],
[5., 0., 0.],
],
)
def test_mask_exhale(diameter, factor_exhale, expected_exhale_efficiency):
mask = models.Mask(η_inhale=0.3, factor_exhale=factor_exhale)
npt.assert_almost_equal(mask.exhale_efficiency(diameter),
expected_exhale_efficiency)