Skip to content

Commit

Permalink
guarding against reset=False users
Browse files Browse the repository at this point in the history
  • Loading branch information
gvarnavi committed May 6, 2024
1 parent b5c0432 commit 0aa9bab
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions py4DSTEM/process/phase/ptychographic_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,11 @@ def _reset_reconstruction(
else:
self.error_iterations = []
self._exit_waves = None
else:
# reset=False first start
if not hasattr(self, "error"):
self.error_iterations = []
self._exit_waves = None

@property
def object_fft(self):
Expand Down Expand Up @@ -3413,6 +3418,14 @@ def _reset_reconstruction(
self._exit_waves = [None] * len(self._probes_all)
else:
self._exit_waves = None
else:
# reset=False first start
if not hasattr(self, "error"):
self.error_iterations = []
if use_projection_scheme:
self._exit_waves = [None] * len(self._probes_all)
else:
self._exit_waves = None

def _return_single_probe(self, probe=None):
"""Current probe estimate"""
Expand Down

0 comments on commit 0aa9bab

Please sign in to comment.