Spaces:
Running
Running
| from mcp_tox_calc.units import ( | |
| normalize_air_concentration, | |
| normalize_csf, | |
| normalize_iur, | |
| normalize_oral_exposure, | |
| ) | |
| def test_normalize_oral_exposure_ug_per_kg_day(): | |
| out = normalize_oral_exposure(2500, "ug/kg-day", 70) | |
| assert round(out["value_mg_per_kg_day"], 6) == 2.5 | |
| def test_normalize_oral_exposure_mg_day_with_bw(): | |
| out = normalize_oral_exposure(7, "mg/day", 70) | |
| assert round(out["value_mg_per_kg_day"], 6) == 0.1 | |
| def test_normalize_air_concentration_mg_to_ug(): | |
| out = normalize_air_concentration(0.2, "mg/m3") | |
| assert round(out["value_ug_per_m3"], 6) == 200.0 | |
| def test_normalize_csf_from_ug_basis(): | |
| out = normalize_csf(0.001, "(ug/kg-day)^-1") | |
| assert round(out["value_per_mg_per_kg_day"], 6) == 1.0 | |
| def test_normalize_iur_from_mg_basis(): | |
| out = normalize_iur(0.002, "(mg/m3)^-1") | |
| assert round(out["value_per_ug_per_m3"], 9) == 0.000002 | |