Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,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 <https://numpy.org/doc/stable/reference/generated/numpy.matrix.html>`_
Expand Down
15 changes: 15 additions & 0 deletions uncertainties/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,12 @@ def derivatives(self):

This mapping is cached, for subsequent calls.
"""
warn(
f"{self.__class__.__name__}.derivatives() is deprecated. It will "
Comment thread
jagerber48 marked this conversation as resolved.
f"be removed in a future release.",
FutureWarning,
stacklevel=2,
)

if not self._linear_part.expanded():
self._linear_part.expand()
Expand All @@ -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 = {}
Expand Down
Loading