diff --git a/CHANGES.rst b/CHANGES.rst index 71be3f72..64bae290 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -18,6 +18,10 @@ Adds: Deprecates: +- The `AffineScalarFunc.derivatives` property has been marked as deprecated. This + property will be removed in a future release. +- The `AffineScalarFunc.error_components()` method has been marked as deprecated. This + method will be replaced by a property of the same name in a future release. - Support for interoperability between `uncertainties` `AffineScalarFunc` scalar objects and `np.matrix` objects is now marked as deprecated. According to the `numpy documentation `_ diff --git a/uncertainties/core.py b/uncertainties/core.py index 0b2f4018..1c7ff51e 100644 --- a/uncertainties/core.py +++ b/uncertainties/core.py @@ -445,6 +445,12 @@ def derivatives(self): This mapping is cached, for subsequent calls. """ + warn( + f"{self.__class__.__name__}.derivatives() is deprecated. It will " + f"be removed in a future release.", + FutureWarning, + stacklevel=2, + ) if not self._linear_part.expanded(): self._linear_part.expand() @@ -469,6 +475,15 @@ def error_components(self): object take scalar values (and are not a tuple, like what math.frexp() returns, for instance). """ + warn( + f"{self.__class__.__name__}.error_components() is currently an " + f"instance method. This method is deprecated. In a future release it will " + f"be replaced with an instance property by the same name. It will be " + f"accessed by {self.__class__.__name__}.error_components (with no " + f"parentheses).", + FutureWarning, + stacklevel=2, + ) # Calculation of the variance: error_components = {}