@@ -334,24 +334,20 @@ def test_temperature_from_saturation_vapour_pressure_1():
334334
335335
336336@pytest .mark .parametrize (
337- "es,kwargs, expected_values" ,
337+ "es,expected_values" ,
338338 [
339- (4.2 , {}, 219.7796336743947 ),
340- ([4.2 , 0 , 0.001 , np .nan ], {"eps" : 1e-2 , "out" : 100 }, [219.7796336743947 , 100 , 100 , np .nan ]),
341- ([4.2 , 0 , 0.001 , np .nan ], {"eps" : 1e-2 , "out" : np .nan }, [219.7796336743947 , np .nan , np .nan , np .nan ]),
342- (0 , {}, np .nan ),
343- (0.001 , {"eps" : 1e-2 , "out" : 100 }, 100.0 ),
344- (0.001 , {"eps" : 1e-2 , "out" : np .nan }, np .nan ),
339+ (4.2 , 219.7796336743947 ),
340+ (0 , np .nan ),
345341 ],
346342)
347- def test_temperature_from_saturation_vapour_pressure_2 (es , kwargs , expected_values ):
343+ def test_temperature_from_saturation_vapour_pressure_2 (es , expected_values ):
348344
349345 multi = isinstance (es , list )
350346 if multi :
351347 es = np .array (es )
352348 expected_values = np .array (expected_values )
353349
354- t = thermo .array .temperature_from_saturation_vapour_pressure (es , ** kwargs )
350+ t = thermo .array .temperature_from_saturation_vapour_pressure (es )
355351 if multi :
356352 np .testing .assert_allclose (t , expected_values , equal_nan = True )
357353 else :
@@ -448,7 +444,7 @@ def test_specific_humidity_from_relative_humidity():
448444
449445
450446@pytest .mark .parametrize (
451- "t,r,kwargs, expected_values" ,
447+ "t,r,expected_values" ,
452448 [
453449 (
454450 [20.0 , 20 , 0 , 35 , 5 , - 15 , 25 , 25 ],
@@ -462,37 +458,12 @@ def test_specific_humidity_from_relative_humidity():
462458 15.4779832381 ,
463459 0 ,
464460 ],
465- {},
466461 [20.0 , 10 , - 10 , 32 , - 15 , - 24 , - 3 , np .nan ],
467462 ),
468- (
469- [20.0 , 20.0 , 20.0 ],
470- [
471- 52.5224541378 ,
472- 0.0 ,
473- 0.000001 ,
474- ],
475- {"eps" : 1e-3 , "out" : thermo .array .celsius_to_kelvin (100 )},
476- [10 , 100 , 100 ],
477- ),
478- (
479- [20.0 , 20.0 , 20.0 ],
480- [
481- 52.5224541378 ,
482- 0.0 ,
483- 0.000001 ,
484- ],
485- {"eps" : 1e-3 , "out" : np .nan },
486- [10 , np .nan , np .nan ],
487- ),
488- (20.0 , 52.5224541378 , {}, 10.0 ),
489- (20.0 , 0.0 , {"eps" : 1e-3 , "out" : thermo .array .celsius_to_kelvin (100 )}, 100 ),
490- (20.0 , 0.000001 , {"eps" : 1e-3 , "out" : thermo .array .celsius_to_kelvin (100 )}, 100 ),
491- (20.0 , 0.0 , {"eps" : 1e-3 , "out" : np .nan }, np .nan ),
492- (20 , 0.000001 , {"eps" : 1e-3 , "out" : np .nan }, np .nan ),
463+ (20.0 , 52.5224541378 , 10.0 ),
493464 ],
494465)
495- def test_dewpoint_from_relative_humidity (t , r , kwargs , expected_values ):
466+ def test_dewpoint_from_relative_humidity (t , r , expected_values ):
496467 # reference was tested with an online relhum calculator at:
497468 # https://bmcnoldy.rsmas.miami.edu/Humidity.html
498469
@@ -505,50 +476,25 @@ def test_dewpoint_from_relative_humidity(t, r, kwargs, expected_values):
505476 t = thermo .array .celsius_to_kelvin (t )
506477 v_ref = thermo .array .celsius_to_kelvin (expected_values )
507478
508- td = thermo .array .dewpoint_from_relative_humidity (t , r , ** kwargs )
479+ td = thermo .array .dewpoint_from_relative_humidity (t , r )
509480 if multi :
510481 assert np .allclose (td , v_ref , equal_nan = True )
511482 else :
512483 assert np .isclose (td , v_ref , equal_nan = True )
513484
514485
515486@pytest .mark .parametrize (
516- "q,p,kwargs, expected_values" ,
487+ "q,p,expected_values" ,
517488 [
518489 (
519490 [0.0169461501 , 0.0155840075 , 0.0134912382 , 0.0083409720 , 0.0057268584 , 0.0025150791 , 0 ],
520491 [967.5085 , 936.3775 , 872.248 , 756.1647 , 649.157 , 422.4207 , 422.4207 ],
521- {},
522492 [21.78907 , 19.90885 , 16.50236 , 7.104064 , - 0.3548709 , - 16.37916 , np .nan ],
523493 ),
524- (
525- [
526- 0.0169461501 ,
527- 0.0 ,
528- 0.000001 ,
529- ],
530- [967.5085 , 967.5085 , 967.5085 ],
531- {"eps" : 1e-3 , "out" : thermo .array .celsius_to_kelvin (100 )},
532- [21.78907 , 100 , 100 ],
533- ),
534- (
535- [
536- 0.0169461501 ,
537- 0.0 ,
538- 0.000001 ,
539- ],
540- [967.5085 , 967.5085 , 967.5085 ],
541- {"eps" : 1e-3 , "out" : np .nan },
542- [21.78907 , np .nan , np .nan ],
543- ),
544- (0.0169461501 , 967.508 , {}, 21.78907 ),
545- (0.0 , 967.5085 , {"eps" : 1e-3 , "out" : thermo .array .celsius_to_kelvin (100 )}, 100 ),
546- (0.000001 , 967.5085 , {"eps" : 1e-3 , "out" : thermo .array .celsius_to_kelvin (100 )}, 100 ),
547- (0.0 , 967.5085 , {"eps" : 1e-3 , "out" : np .nan }, np .nan ),
548- (0.000001 , 967.5085 , {"eps" : 1e-3 , "out" : np .nan }, np .nan ),
494+ (0.0169461501 , 967.508 , 21.78907 ),
549495 ],
550496)
551- def test_dewpoint_from_specific_humidity (q , p , kwargs , expected_values ):
497+ def test_dewpoint_from_specific_humidity (q , p , expected_values ):
552498 multi = isinstance (q , list )
553499 if multi :
554500 q = np .array (q )
@@ -558,7 +504,7 @@ def test_dewpoint_from_specific_humidity(q, p, kwargs, expected_values):
558504 p = p * 100.0
559505 v_ref = thermo .array .celsius_to_kelvin (expected_values )
560506
561- td = thermo .array .dewpoint_from_specific_humidity (q , p , ** kwargs )
507+ td = thermo .array .dewpoint_from_specific_humidity (q , p )
562508 if multi :
563509 assert np .allclose (td , v_ref , equal_nan = True )
564510 else :
0 commit comments