Skip to content

Commit

Permalink
bug: fixed changes in argument handling for mixers
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Papior <[email protected]>
  • Loading branch information
zerothi committed Feb 11, 2023
1 parent 98514be commit 9bf4d16
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sisl/mixing/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ def __init__(self, op: Callable[[Any, Any], Any], A: Any, B: Any):

def __call__(self, f: T, df: T, *args: Any, **kwargs: Any) -> T:
if isinstance(self.A, BaseMixer):
A = self.A(*args, **kwargs)
A = self.A(f, df, *args, **kwargs)
else:
A = self.A
if isinstance(self.B, BaseMixer):
B = self.B(*args, **kwargs)
B = self.B(f, df, *args, **kwargs)
else:
B = self.B
return self._op(A, B)
Expand Down Expand Up @@ -157,7 +157,7 @@ def __repr__(self) -> str:


def __call__(self, f: T, df: T, *args: Any, append: bool = True) -> None:
""" Append data to thMix quantities based on arguments """
""" Append data to the history (omitting None values)! """
if not append:
# do nothing
return
Expand All @@ -166,7 +166,7 @@ def __call__(self, f: T, df: T, *args: Any, append: bool = True) -> None:
args = list(filter(lambda arg: arg is not None, args))

# append *args
self.history.append(*args)
self.history.append(f, df, *args)

@property
def history(self) -> TypeHistory:
Expand Down Expand Up @@ -252,7 +252,7 @@ def mixer(self) -> TypeBaseMixer:

def __call__(self, f: T, df: T, *args: Any, **kwargs: Any) -> T:
""" Apply the mixing routine """
return self.next()(*args, **kwargs)
return self.next()(f, df, *args, **kwargs)

def __getattr__(self, attr: str) -> Any:
""" Divert all unknown attributes to the current mixer
Expand Down

0 comments on commit 9bf4d16

Please sign in to comment.