1414from typing import Any , Hashable
1515
1616import tcod .constants
17+ from tcod ._internal import deprecate
1718from tcod .cffi import ffi , lib
1819
1920MERSENNE_TWISTER = tcod .constants .RNG_MT
@@ -110,7 +111,7 @@ def uniform(self, low: float, high: float) -> float:
110111 """
111112 return float (lib .TCOD_random_get_double (self .random_c , low , high ))
112113
113- def guass (self , mu : float , sigma : float ) -> float :
114+ def gauss (self , mu : float , sigma : float ) -> float :
114115 """Return a random number using Gaussian distribution.
115116
116117 Args:
@@ -119,10 +120,17 @@ def guass(self, mu: float, sigma: float) -> float:
119120
120121 Returns:
121122 float: A random float.
123+
124+ .. versionchanged:: Unreleased
125+ Renamed from `guass` to `gauss`.
122126 """
123127 return float (lib .TCOD_random_get_gaussian_double (self .random_c , mu , sigma ))
124128
125- def inverse_guass (self , mu : float , sigma : float ) -> float :
129+ @deprecate ("This is a typo, rename this to 'gauss'" , category = FutureWarning )
130+ def guass (self , mu : float , sigma : float ) -> float : # noqa: D102
131+ return self .gauss (mu , sigma )
132+
133+ def inverse_gauss (self , mu : float , sigma : float ) -> float :
126134 """Return a random Gaussian number using the Box-Muller transform.
127135
128136 Args:
@@ -131,9 +139,16 @@ def inverse_guass(self, mu: float, sigma: float) -> float:
131139
132140 Returns:
133141 float: A random float.
142+
143+ .. versionchanged:: Unreleased
144+ Renamed from `inverse_guass` to `inverse_gauss`.
134145 """
135146 return float (lib .TCOD_random_get_gaussian_double_inv (self .random_c , mu , sigma ))
136147
148+ @deprecate ("This is a typo, rename this to 'inverse_gauss'" , category = FutureWarning )
149+ def inverse_guass (self , mu : float , sigma : float ) -> float : # noqa: D102
150+ return self .inverse_gauss (mu , sigma )
151+
137152 def __getstate__ (self ) -> Any :
138153 """Pack the self.random_c attribute into a portable state."""
139154 state = self .__dict__ .copy ()
0 commit comments