33Users should import only from non-private modules, of course.
44"""
55
6+ import numpy
7+
68from ._wrapped_ufuncs import *
79
810_p_from_z = p_from_z
@@ -15,5 +17,25 @@ def z_from_p(p, lat, geo_strf_dyn_height=0, sea_surface_geopotential=0):
1517 return _z_from_p (p , lat , geo_strf_dyn_height , sea_surface_geopotential )
1618z_from_p .__doc__ = _z_from_p .__doc__
1719
20+ _gibbs = gibbs
21+ def gibbs (ns , nt , np , SA , t , p ):
22+ params = {"ns" : ns , "nt" : nt , "np" : np }
23+ for k , v in params .items ():
24+ u = numpy .unique (v )
25+ if u .min () < 0 or u .max () > 2 or u .dtype .kind != "i" :
26+ raise ValueError ("ns, nt, np must contain integers 0, 1, or 2;"
27+ f" found { k } ={ v } " )
28+ return _gibbs (ns , nt , np , SA , t , p )
29+ gibbs .__doc__ = _gibbs .__doc__
1830
1931
32+ _gibbs_ice = gibbs_ice
33+ def gibbs_ice (nt , np , t , p ):
34+ params = {"nt" : nt , "np" : np }
35+ for k , v in params .items ():
36+ u = numpy .unique (v )
37+ if u .min () < 0 or u .max () > 2 or u .dtype .kind != "i" :
38+ raise ValueError ("nt, np must contain integers 0, 1, or 2;"
39+ f" found { k } ={ v } " )
40+ return _gibbs_ice (nt , np , t , p )
41+ gibbs_ice .__doc__ = _gibbs_ice .__doc__
0 commit comments