Closed github-actions[bot] closed 2 months ago
The issue is not arising from the results of the last iteration being copy-pasted into the results for the first iteration, but rather a result of the sweep index starting from -1 (e.g. sweepIndex follows -1, 0, 1, 2, ..., len-3, len-2). This means that for the following sweepFunction defining the action of the sweep:
def cavity_sweep_func(sweep):
val = sweep.sweepList[sweep._sweepIndex]
H_cavity.dimension = val
...
The sweep starts using the last value of the sweepList, and then goes back to the start.
I'm not sure if this is a bug or intended functionality.
It appears that this isn't a bug. The attribute/property that is expected to be used to access the sweepIndex is sweep.index
instead of sweep._sweepIndex
:
@property
def index(self):
r"""
returns ``self._sweepIndex + 1``. reason for +1 is explained in :py:attr:`~_sweepIndex`. There is no setter,
the value of _sweepIndex is updated by the :meth:`~runSweep` and is an internal process.
"""
return self._sweepIndex + 1
closes #264