Skip to content

Commit

Permalink
src: format code with newer version of Black
Browse files Browse the repository at this point in the history
  • Loading branch information
zbjornson committed Jul 19, 2024
1 parent 8935b26 commit ef51925
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 67 deletions.
12 changes: 4 additions & 8 deletions cellengine/resources/compensation.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,7 @@ def create(
channels: List[str],
spill_matrix: List[float],
dataframe: Optional[None],
) -> Compensation:
...
) -> Compensation: ...

@overload
@classmethod
Expand All @@ -148,8 +147,7 @@ def create(
name: str,
*,
dataframe: DataFrame,
) -> Compensation:
...
) -> Compensation: ...

@classmethod
def create(
Expand Down Expand Up @@ -230,14 +228,12 @@ def dataframe_as_html(self):
return self.dataframe._repr_html_()

@overload
def apply(self, file: FcsFile, inplace: Literal[True] = ..., **kwargs) -> None:
...
def apply(self, file: FcsFile, inplace: Literal[True] = ..., **kwargs) -> None: ...

@overload
def apply(
self, file: FcsFile, inplace: Literal[False] = ..., **kwargs
) -> DataFrame:
...
) -> DataFrame: ...

def apply(
self, file: FcsFile, inplace: Optional[bool] = True, **kwargs
Expand Down
36 changes: 12 additions & 24 deletions cellengine/resources/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,17 +420,15 @@ def get_compensation(
@overload
def create_compensation(
self, name: str, channels: List[str], spill_matrix: List[float]
) -> Compensation:
...
) -> Compensation: ...

@overload
def create_compensation(
self,
name: str,
*,
dataframe: DataFrame,
) -> Compensation:
...
) -> Compensation: ...

def create_compensation(
self,
Expand Down Expand Up @@ -523,14 +521,12 @@ def delete_gates(self, ids: List[str]) -> None:
@overload
def create_rectangle_gate(
self, *args, create_population: Literal[True], **kwargs
) -> Tuple[RectangleGate, Population]:
...
) -> Tuple[RectangleGate, Population]: ...

@overload
def create_rectangle_gate(
self, *args, create_population: Literal[False], **kwargs
) -> RectangleGate:
...
) -> RectangleGate: ...

def create_rectangle_gate(
self, *args, create_population: bool = True, **kwargs
Expand All @@ -550,14 +546,12 @@ def create_rectangle_gate(
@overload
def create_polygon_gate(
self, *args, create_population: Literal[True], **kwargs
) -> Tuple[PolygonGate, Population]:
...
) -> Tuple[PolygonGate, Population]: ...

@overload
def create_polygon_gate(
self, *args, create_population: Literal[False], **kwargs
) -> PolygonGate:
...
) -> PolygonGate: ...

def create_polygon_gate(
self, *args, create_population: bool = True, **kwargs
Expand All @@ -577,14 +571,12 @@ def create_polygon_gate(
@overload
def create_ellipse_gate(
self, *args, create_population: Literal[True], **kwargs
) -> Tuple[EllipseGate, Population]:
...
) -> Tuple[EllipseGate, Population]: ...

@overload
def create_ellipse_gate(
self, *args, create_population: Literal[False], **kwargs
) -> EllipseGate:
...
) -> EllipseGate: ...

def create_ellipse_gate(
self, *args, create_population: bool = True, **kwargs
Expand All @@ -604,14 +596,12 @@ def create_ellipse_gate(
@overload
def create_range_gate(
self, *args, create_population: Literal[True], **kwargs
) -> Tuple[RangeGate, Population]:
...
) -> Tuple[RangeGate, Population]: ...

@overload
def create_range_gate(
self, *args, create_population: Literal[False], **kwargs
) -> RangeGate:
...
) -> RangeGate: ...

def create_range_gate(
self, *args, create_population: bool = True, **kwargs
Expand Down Expand Up @@ -646,14 +636,12 @@ def create_split_gate(
@overload
def create_quadrant_gate(
self, *args, create_population: Literal[True], **kwargs
) -> Tuple[QuadrantGate, List[Population]]:
...
) -> Tuple[QuadrantGate, List[Population]]: ...

@overload
def create_quadrant_gate(
self, *args, create_population: Literal[False], **kwargs
) -> QuadrantGate:
...
) -> QuadrantGate: ...

def create_quadrant_gate(
self, *args, create_population: bool = True, **kwargs
Expand Down
12 changes: 5 additions & 7 deletions cellengine/resources/fcs_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,9 +353,9 @@ def create_from_dataframe(
"""

if "$COM" not in headers:
headers[
"$COM"
] = f"Created by the CellEngine Python Toolkit v{ce.__version__}"
headers["$COM"] = (
f"Created by the CellEngine Python Toolkit v{ce.__version__}"
)

if df.columns.nlevels > 1:
channels = df.columns.get_level_values(0).tolist()
Expand Down Expand Up @@ -565,17 +565,15 @@ def get_events(
inplace: Optional[bool] = ...,
destination: None = ...,
**kwargs: Any,
) -> DataFrame:
...
) -> DataFrame: ...

@overload
def get_events(
self,
inplace: Optional[bool] = ...,
destination: str = ...,
**kwargs: Any,
) -> None:
...
) -> None: ...

def get_events(
self,
Expand Down
36 changes: 12 additions & 24 deletions cellengine/resources/gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,7 @@ def create(
fcs_file: Optional[str] = None,
create_population: Literal[True] = True,
parent_population_id: Optional[str] = None,
) -> Tuple[RectangleGate, Population]:
...
) -> Tuple[RectangleGate, Population]: ...

@overload
@classmethod
Expand All @@ -272,8 +271,7 @@ def create(
fcs_file_id: Optional[str] = None,
fcs_file: Optional[str] = None,
create_population: Literal[False] = False,
) -> RectangleGate:
...
) -> RectangleGate: ...

@classmethod
def create(
Expand Down Expand Up @@ -418,8 +416,7 @@ def create(
fcs_file: Optional[str] = None,
create_population: Literal[True] = True,
parent_population_id: Optional[str] = None, # TODO Ungated
) -> Tuple[PolygonGate, Population]:
...
) -> Tuple[PolygonGate, Population]: ...

@overload
@classmethod
Expand All @@ -437,8 +434,7 @@ def create(
fcs_file_id: Optional[str] = None,
fcs_file: Optional[str] = None,
create_population: Literal[False] = False,
) -> PolygonGate:
...
) -> PolygonGate: ...

@classmethod
def create(
Expand Down Expand Up @@ -571,8 +567,7 @@ def create(
fcs_file: Optional[str] = None,
create_population: Literal[True] = True,
parent_population_id: Optional[str] = None, # TODO Ungated
) -> Tuple[EllipseGate, Population]:
...
) -> Tuple[EllipseGate, Population]: ...

@overload
@classmethod
Expand All @@ -593,8 +588,7 @@ def create(
fcs_file_id: Optional[str] = None,
fcs_file: Optional[str] = None,
create_population: Literal[False] = False,
) -> EllipseGate:
...
) -> EllipseGate: ...

@classmethod
def create(
Expand Down Expand Up @@ -751,8 +745,7 @@ def create(
fcs_file: Optional[str] = None,
create_population: Literal[True] = True,
parent_population_id: Optional[str] = None,
) -> Tuple[RangeGate, Population]:
...
) -> Tuple[RangeGate, Population]: ...

@overload
@classmethod
Expand All @@ -771,8 +764,7 @@ def create(
fcs_file_id: Optional[str] = None,
fcs_file: Optional[str] = None,
create_population: Literal[False] = False,
) -> RangeGate:
...
) -> RangeGate: ...

@classmethod
def create(
Expand Down Expand Up @@ -915,8 +907,7 @@ def create(
fcs_file: Optional[str] = None,
create_population: Literal[True] = True,
parent_population_id: Optional[str] = None, # TODO Ungated
) -> Tuple[QuadrantGate, List[Population]]:
...
) -> Tuple[QuadrantGate, List[Population]]: ...

@overload
@classmethod
Expand All @@ -938,8 +929,7 @@ def create(
fcs_file_id: Optional[str] = None,
fcs_file: Optional[str] = None,
create_population: Literal[False] = False,
) -> QuadrantGate:
...
) -> QuadrantGate: ...

@classmethod
def create(
Expand Down Expand Up @@ -1134,8 +1124,7 @@ def create(
fcs_file: Optional[str] = None,
create_population: Literal[True] = True,
parent_population_id: Optional[str] = None, # TODO Ungated
) -> Tuple[SplitGate, List[Population]]:
...
) -> Tuple[SplitGate, List[Population]]: ...

@overload
@classmethod
Expand All @@ -1154,8 +1143,7 @@ def create(
fcs_file_id: Optional[str] = None,
fcs_file: Optional[str] = None,
create_population: Literal[False] = False,
) -> SplitGate:
...
) -> SplitGate: ...

@classmethod
def create(
Expand Down
6 changes: 2 additions & 4 deletions cellengine/resources/scaleset.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,12 @@ def scale_fn_for_channel(self, channel: str) -> Callable[[float], float]:
@overload
def apply(
self, file: FcsFile, clamp_q: bool = False, in_place: Literal[True] = ...
) -> None:
...
) -> None: ...

@overload
def apply(
self, file: FcsFile, clamp_q: bool = False, in_place: Literal[False] = ...
) -> DataFrame:
...
) -> DataFrame: ...

def apply(self, file: FcsFile, clamp_q: bool = False, in_place: bool = True):
"""Apply the scaleset to a file.
Expand Down

0 comments on commit ef51925

Please sign in to comment.