fix: Renamed differential function to derivitive

This commit is contained in:
2025-06-17 13:45:51 -04:00
parent 1165c03955
commit a761efe28e

View File

@ -126,6 +126,26 @@ class Function:
"""
Calculates the derivative of the function.
Returns:
Function: A new Function object representing the derivative.
"""
warnings.warn(
"The 'differential' function has been renamed. Please use 'derivitive' instead.",
DeprecationWarning,
stacklevel=2
)
self._check_initialized()
if self._largest_exponent == 0:
raise ValueError("Cannot differentiate a constant (Function of degree 0).")
return self.derivitive()
def derivitive(self) -> 'Function':
"""
Calculates the derivative of the function.
Returns:
Function: A new Function object representing the derivative.
"""
@ -139,6 +159,7 @@ class Function:
diff_func.set_coeffs(derivative_coefficients.tolist())
return diff_func
def get_real_roots(self, options: GA_Options = GA_Options(), use_cuda: bool = False) -> np.ndarray:
"""
Uses a genetic algorithm to find the approximate real roots of the function (where y=0).