From 834017621e53d1c8abe180b1f733d63097fbea77 Mon Sep 17 00:00:00 2001 From: Martin Campos Pinto Date: Fri, 2 Aug 2024 09:11:51 +0200 Subject: [PATCH] Use public properties `domain` & `codomain` in `LinearOperator.__neg__` (#410) The `__neg__` function in class `LinearOperator` uses the `_domain` and `_codomain` attributes, which is wrong since these may not be defined. It should use the exposed (interface) properties `domain` and `codomain` instead. --- psydac/linalg/basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psydac/linalg/basic.py b/psydac/linalg/basic.py index 07ff42670..81079a5c7 100644 --- a/psydac/linalg/basic.py +++ b/psydac/linalg/basic.py @@ -279,7 +279,7 @@ def __neg__(self): a new object of the class ScaledLinearOperator. """ - return ScaledLinearOperator(self._domain, self._codomain, -1.0, self) + return ScaledLinearOperator(self.domain, self.codomain, -1.0, self) def __mul__(self, c): """