Skip to content

Commit

Permalink
Only override callbacks_dir if not None
Browse files Browse the repository at this point in the history
  • Loading branch information
schmoelder committed May 3, 2024
1 parent b38923c commit a9a34a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CADETProcess/optimization/optimizationProblem.py
Original file line number Diff line number Diff line change
Expand Up @@ -3929,6 +3929,7 @@ def __init__(
callbacks_dir = Path(callbacks_dir)
callbacks_dir.mkdir(exist_ok=True, parents=True)
self.callbacks_dir = callbacks_dir
self._callbacks_dir = callbacks_dir

self.keep_progress = keep_progress

Expand Down Expand Up @@ -3982,7 +3983,8 @@ def __call__(self, request, evaluation_object):
callbacks_dir = self.callbacks_dir
else:
callbacks_dir = self._callbacks_dir
kwargs['callbacks_dir'] = callbacks_dir
if callbacks_dir is not None:
kwargs['callbacks_dir'] = callbacks_dir

self.callback(request, *args, **kwargs)

Expand Down

0 comments on commit a9a34a0

Please sign in to comment.