Problem: Remove unnecessary x and y arguments in 1D optimization routines
Description:
Currently, the black-box function zheight_tune in our 1D optimization routine calls:
tf_acquisition.move_stage_translation_absolute(x=x_old, y=y_old, z=z/1e6)
This implies that x_old and y_old must be passed even though the optimization is only being performed over z. This is reflected in [MLlayerBO.py](https://github.com/pycroscopy/pyAutoMic/blob/main/TEM/stemOrchestrator/stemOrchestrator/MLlayer/MLlayerBO.py#L2), specifically in the Tune1d class:
def _acquire_data(self, x):
result = self.python_command(self.old_x, self.old_y, x.item())
return result
However, in cases like defocus tuning, where we use:
tf_acquisition.microscope.optics.defocus = z / 1e6
there is no need to pass x and y at all. Still, the Tune1d class requires those parameters, which makes the interface unnecessarily rigid and confusing for use cases that do not involve x or y movements.
Suggested Fix:
- Refactor
Tune1d and similar routines to allow optional x and y arguments.
- Update
python_command calls accordingly, using only relevant parameters for the specific optimization.
- Ensure backward compatibility where
x, y, and z stage control is required.
Problem: Remove unnecessary
xandyarguments in 1D optimization routinesDescription:
Currently, the black-box function
zheight_tunein our 1D optimization routine calls:This implies that
x_oldandy_oldmust be passed even though the optimization is only being performed overz. This is reflected in[MLlayerBO.py](https://github.com/pycroscopy/pyAutoMic/blob/main/TEM/stemOrchestrator/stemOrchestrator/MLlayer/MLlayerBO.py#L2), specifically in theTune1dclass:However, in cases like defocus tuning, where we use:
there is no need to pass
xandyat all. Still, theTune1dclass requires those parameters, which makes the interface unnecessarily rigid and confusing for use cases that do not involvexorymovements.Suggested Fix:
Tune1dand similar routines to allow optionalxandyarguments.python_commandcalls accordingly, using only relevant parameters for the specific optimization.x,y, andzstage control is required.