mirror of
https://github.com/ivan-usov-org/bec.git
synced 2025-04-21 10:10:02 +02:00
docs: adjusted init for flyer class
This commit is contained in:
parent
ff9d4ad950
commit
fa0c96f2db
@ -43,15 +43,13 @@ With this in mind, we can define the `__init__` method of our scan class as foll
|
|||||||
relative: bool = False,
|
relative: bool = False,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
):
|
||||||
super().__init__(**kwargs)
|
super().__init__(exp_time=exp_time, relative=relative, **kwargs)
|
||||||
self.motor = motor
|
self.motor = motor
|
||||||
self.start = start
|
self.start = start
|
||||||
self.stop = stop
|
self.stop = stop
|
||||||
self.exp_time = exp_time
|
|
||||||
self.relative = relative
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Here, the `**kwargs` parameter allows us to pass additional keyword arguments to the base class. This is important as the base class may require additional parameters that we do not need to define in our scan class. After initializing the base class (FlyScanBase) using `super().__init__(**kwargs)`, we store the motor, start, stop, exp_time, and relative parameters as attributes of the scan class.
|
Here, the `**kwargs` parameter allows us to pass additional keyword arguments to the base class. This is important as the base class may require additional parameters that we do not need to define in our scan class. After initializing the base class (FlyScanBase) using `super().__init__(exp_time=exp_time, relative=relative, **kwargs)`, we store the motor, start, stop, exp_time, and relative parameters as attributes of the scan class.
|
||||||
|
|
||||||
Let's also add a proper doc string for the users of our scan:
|
Let's also add a proper doc string for the users of our scan:
|
||||||
|
|
||||||
@ -82,12 +80,10 @@ Let's also add a proper doc string for the users of our scan:
|
|||||||
>>> scans.tutorial_cont_line_fly_scan(dev.sam_rot, 0, 180, exp_time=0.1)
|
>>> scans.tutorial_cont_line_fly_scan(dev.sam_rot, 0, 180, exp_time=0.1)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
super().__init__(**kwargs)
|
super().__init__(exp_time=exp_time, relative=relative, **kwargs)
|
||||||
self.motor = motor
|
self.motor = motor
|
||||||
self.start = start
|
self.start = start
|
||||||
self.stop = stop
|
self.stop = stop
|
||||||
self.exp_time = exp_time
|
|
||||||
self.relative = relative
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Step 3: Prepare the positions
|
## Step 3: Prepare the positions
|
||||||
@ -192,12 +188,10 @@ class TutorialFlyScanContLine(AsyncFlyScanBase):
|
|||||||
>>> scans.tutorial_cont_line_fly_scan(dev.sam_rot, 0, 180, exp_time=0.1)
|
>>> scans.tutorial_cont_line_fly_scan(dev.sam_rot, 0, 180, exp_time=0.1)
|
||||||
|
|
||||||
"""
|
"""
|
||||||
super().__init__(**kwargs)
|
super().__init__(exp_time=exp_time, relative=relative, **kwargs)
|
||||||
self.motor = motor
|
self.motor = motor
|
||||||
self.start = start
|
self.start = start
|
||||||
self.stop = stop
|
self.stop = stop
|
||||||
self.exp_time = exp_time
|
|
||||||
self.relative = relative
|
|
||||||
|
|
||||||
def prepare_positions(self):
|
def prepare_positions(self):
|
||||||
self.positions = np.array([[self.start], [self.stop]])
|
self.positions = np.array([[self.start], [self.stop]])
|
||||||
@ -523,12 +517,10 @@ import uuid
|
|||||||
|
|
||||||
...
|
...
|
||||||
|
|
||||||
super().__init__(**kwargs)
|
super().__init__(exp_time=exp_time, relative=relative, **kwargs)
|
||||||
self.motor = motor
|
self.motor = motor
|
||||||
self.start = start
|
self.start = start
|
||||||
self.stop = stop
|
self.stop = stop
|
||||||
self.exp_time = exp_time
|
|
||||||
self.relative = relative
|
|
||||||
self.device_move_request_id = str(uuid.uuid4())
|
self.device_move_request_id = str(uuid.uuid4())
|
||||||
|
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user