From a6f1e3f29d1d1256a502c0993d58bdeedf1dbda2 Mon Sep 17 00:00:00 2001 From: Rouven Lemmerz <lemmerz@mpa-garching.mpg.de> Date: Tue, 19 May 2020 13:10:31 +0200 Subject: [PATCH] Streamlining domain arg to be first --- nifty6/field.py | 2 +- nifty6/operators/outer_product_operator.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nifty6/field.py b/nifty6/field.py index ee5222756..f04a7a05e 100644 --- a/nifty6/field.py +++ b/nifty6/field.py @@ -283,7 +283,7 @@ class Field(Operator): raise TypeError("The multiplier must be an instance of " + "the Field class") from .operators.outer_product_operator import OuterProduct - return OuterProduct(self, x.domain)(x) + return OuterProduct(x.domain, self)(x) def vdot(self, x, spaces=None): """Computes the dot product of 'self' with x. diff --git a/nifty6/operators/outer_product_operator.py b/nifty6/operators/outer_product_operator.py index 89c311155..c597fa24b 100644 --- a/nifty6/operators/outer_product_operator.py +++ b/nifty6/operators/outer_product_operator.py @@ -27,12 +27,12 @@ class OuterProduct(LinearOperator): Parameters --------- - field: Field, domain: DomainTuple, the domain of the input field + field: Field --------- """ - def __init__(self, field, domain): - self._domain = domain + def __init__(self, domain, field): + self._domain = DomainTuple.make(domain) self._field = field self._target = DomainTuple.make( tuple(sub_d for sub_d in field.domain._dom + domain._dom)) -- GitLab