Skip to content

Commit

Permalink
Fix codacy issues in callback_fx.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mgkwill committed Jun 28, 2023
1 parent 2b069fe commit e189d8a
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/lava/magma/core/callback_fx.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,26 @@ class IterableCallBack(NxSdkCallbackFx):
as pre and post run."""

def __init__(self,
pre_run_fxs: Iterable = [],
post_run_fxs: Iterable = []) -> None:
pre_run_fxs: Iterable = None,
post_run_fxs: Iterable = None) -> None:
super().__init__()
if pre_run_fxs is None:
pre_run_fxs = []
if post_run_fxs is None:
post_run_fxs = []
self.pre_run_fxs = pre_run_fxs
self.post_run_fxs = post_run_fxs

def pre_run_callback(self, board: NxBoard, **_) -> None:
def pre_run_callback(self,
board: NxBoard,
_var_id_to_var_model_map: dict = None
) -> None:
for fx in self.pre_run_fxs:
fx(board)

def post_run_callback(self, board: NxBoard, **_) -> None:
def post_run_callback(self,
board: NxBoard,
_var_id_to_var_model_map: dict = None
) -> None:
for fx in self.post_run_fxs:
fx(board)

0 comments on commit e189d8a

Please sign in to comment.