Skip to content

Commit

Permalink
Fix noqas for docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
callumforrester committed Sep 16, 2024
1 parent efa5204 commit e065997
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/scanspec/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,9 @@ class Product(Spec[Axis]):
def axes(self) -> list[Axis]: # noqa: D102
return self.outer.axes() + self.inner.axes()

def calculate(
def calculate( # noqa: D102
self, bounds: bool = True, nested: bool = False
) -> list[Frames[Axis]]: # noqa: D102
) -> list[Frames[Axis]]:
frames_outer = self.outer.calculate(bounds=False, nested=nested)
frames_inner = self.inner.calculate(bounds, nested=True)
return frames_outer + frames_inner
Expand Down Expand Up @@ -194,9 +194,9 @@ class Repeat(Spec[Axis]):
def axes(self) -> list[Axis]: # noqa: D102
return []

def calculate(
def calculate( # noqa: D102
self, bounds: bool = True, nested: bool = False
) -> list[Frames[Axis]]: # noqa: D102
) -> list[Frames[Axis]]:
return [Frames({}, gap=np.full(self.num, self.gap))]


Expand Down Expand Up @@ -233,9 +233,9 @@ class Zip(Spec[Axis]):
def axes(self) -> list[Axis]: # noqa: D102
return self.left.axes() + self.right.axes()

def calculate(
def calculate( # noqa: D102
self, bounds: bool = True, nested: bool = False
) -> list[Frames[Axis]]: # noqa: D102
) -> list[Frames[Axis]]:
frames_left = self.left.calculate(bounds, nested)
frames_right = self.right.calculate(bounds, nested)
assert len(frames_left) >= len(
Expand Down Expand Up @@ -303,9 +303,9 @@ class Mask(Spec[Axis]):
def axes(self) -> list[Axis]: # noqa: D102
return self.spec.axes()

def calculate(
def calculate( # noqa: D102
self, bounds: bool = True, nested: bool = False
) -> list[Frames[Axis]]: # noqa: D102
) -> list[Frames[Axis]]:
frames = self.spec.calculate(bounds, nested)
for axis_set in self.region.axis_sets():
# Find the start and end index of any dimensions containing these axes
Expand Down Expand Up @@ -363,9 +363,9 @@ class Snake(Spec[Axis]):
def axes(self) -> list[Axis]: # noqa: D102
return self.spec.axes()

def calculate(
def calculate( # noqa: D102
self, bounds: bool = True, nested: bool = False
) -> list[Frames[Axis]]: # noqa: D102
) -> list[Frames[Axis]]:
return [
SnakedFrames.from_frames(segment)
for segment in self.spec.calculate(bounds, nested)
Expand Down Expand Up @@ -408,9 +408,9 @@ def axes(self) -> list[Axis]: # noqa: D102
assert set(left_axes) == set(right_axes), f"axes {left_axes} != {right_axes}"
return left_axes

def calculate(
def calculate( # noqa: D102
self, bounds: bool = True, nested: bool = False
) -> list[Frames[Axis]]: # noqa: D102
) -> list[Frames[Axis]]:
dim_left = squash_frames(
self.left.calculate(bounds, nested), nested and self.check_path_changes
)
Expand Down Expand Up @@ -445,9 +445,9 @@ class Squash(Spec[Axis]):
def axes(self) -> list[Axis]: # noqa: D102
return self.spec.axes()

def calculate(
def calculate( # noqa: D102
self, bounds: bool = True, nested: bool = False
) -> list[Frames[Axis]]: # noqa: D102
) -> list[Frames[Axis]]:
dims = self.spec.calculate(bounds, nested)
dim = squash_frames(dims, nested and self.check_path_changes)
return [dim]
Expand Down Expand Up @@ -513,9 +513,9 @@ def _line_from_indexes(
first = self.start - step / 2
return {self.axis: indexes * step + first}

def calculate(
def calculate( # noqa: D102
self, bounds: bool = True, nested: bool = False
) -> list[Frames[Axis]]: # noqa: D102
) -> list[Frames[Axis]]:
return _dimensions_from_indexes(
self._line_from_indexes, self.axes(), self.num, bounds
)
Expand Down Expand Up @@ -594,9 +594,9 @@ def _repeats_from_indexes(
) -> dict[Axis, npt.NDArray[np.float64]]:
return {self.axis: np.full(len(indexes), self.value)}

def calculate(
def calculate( # noqa: D102
self, bounds: bool = True, nested: bool = False
) -> list[Frames[Axis]]: # noqa: D102
) -> list[Frames[Axis]]:
return _dimensions_from_indexes(
self._repeats_from_indexes, self.axes(), self.num, bounds
)
Expand Down Expand Up @@ -655,9 +655,9 @@ def _spiral_from_indexes(
self.x_axis: self.x_start + x_scale * phi * np.sin(phi + self.rotate),
}

def calculate(
def calculate( # noqa: D102
self, bounds: bool = True, nested: bool = False
) -> list[Frames[Axis]]: # noqa: D102
) -> list[Frames[Axis]]:
return _dimensions_from_indexes(
self._spiral_from_indexes, self.axes(), self.num, bounds
)
Expand Down

0 comments on commit e065997

Please sign in to comment.