@@ -62,19 +62,20 @@ def test_invalid_concentration():
6262 with pytest .raises (ValueError ):
6363 convert_concentration (data , 'invalid_concentration' , 298.15 , 101325 )
6464
65+
6566@pytest .mark .parametrize ("data, output_unit, temperature, pressure, expected" ,
66- [
67- (1 , 'mol m-3' , 298.15 , 101325 , 1 ),
68- (1 , 'mol cm-3' , 298.15 , 101325 , 1e-6 ),
69- (1 , 'molec m-3' , 298.15 , 101325 , 1 * 6.02214076e+23 ),
70- (1 , 'molec cm-3' , 298.15 , 101325 , 1e-6 * 6.02214076e+23 ),
71- (1 , 'molecule m-3' , 298.15 , 101325 , 1 * 6.02214076e+23 ),
72- (1 , 'molecule cm-3' , 298.15 , 101325 , 1e-6 * 6.02214076e+23 ),
73- (1 , 'ppth' , 298.15 , 101325 , 1e3 / calculate_air_density (298.15 , 101325 )),
74- (1 , 'ppm' , 298.15 , 101325 , 1e6 / calculate_air_density (298.15 , 101325 )),
75- (1 , 'ppb' , 298.15 , 101325 , 1e9 / calculate_air_density (298.15 , 101325 )),
76- (1 , 'ppt' , 298.15 , 101325 , 1e12 / calculate_air_density (298.15 , 101325 )),
77- (1 , 'mol mol-1' , 298.15 , 101325 , 1 / calculate_air_density (298.15 , 101325 )),
78- ])
67+ [
68+ (1 , 'mol m-3' , 298.15 , 101325 , 1 ),
69+ (1 , 'mol cm-3' , 298.15 , 101325 , 1e-6 ),
70+ (1 , 'molec m-3' , 298.15 , 101325 , 1 * 6.02214076e+23 ),
71+ (1 , 'molec cm-3' , 298.15 , 101325 , 1e-6 * 6.02214076e+23 ),
72+ (1 , 'molecule m-3' , 298.15 , 101325 , 1 * 6.02214076e+23 ),
73+ (1 , 'molecule cm-3' , 298.15 , 101325 , 1e-6 * 6.02214076e+23 ),
74+ (1 , 'ppth' , 298.15 , 101325 , 1e3 / calculate_air_density (298.15 , 101325 )),
75+ (1 , 'ppm' , 298.15 , 101325 , 1e6 / calculate_air_density (298.15 , 101325 )),
76+ (1 , 'ppb' , 298.15 , 101325 , 1e9 / calculate_air_density (298.15 , 101325 )),
77+ (1 , 'ppt' , 298.15 , 101325 , 1e12 / calculate_air_density (298.15 , 101325 )),
78+ (1 , 'mol mol-1' , 298.15 , 101325 , 1 / calculate_air_density (298.15 , 101325 )),
79+ ])
7980def test_convert_from_number_density (data , output_unit , temperature , pressure , expected ):
80- assert math .isclose (convert_from_number_density (data , output_unit , temperature , pressure ), expected )
81+ assert math .isclose (convert_from_number_density (data , output_unit , temperature , pressure ), expected )
0 commit comments