Skip to content

Commit d878ecd

Browse files
author
Tim Joseph
committed
style(tensor_distribution): format __init__ method signatures for readability
Break long __init__ method signatures across multiple lines to improve code readability and maintain consistent formatting standards across the tensor distribution classes.
1 parent b83ece2 commit d878ecd

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

src/tensorcontainer/tensor_distribution/dirichlet.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ class TensorDirichlet(TensorDistribution):
1414
# Annotated tensor parameters
1515
_concentration: Tensor
1616

17-
def __init__(self, concentration: Tensor, validate_args: bool | None = None) -> None:
17+
def __init__(
18+
self, concentration: Tensor, validate_args: bool | None = None
19+
) -> None:
1820
self._concentration = concentration
1921
super().__init__(concentration.shape, concentration.device, validate_args)
2022

src/tensorcontainer/tensor_distribution/fisher_snedecor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111

1212
class TensorFisherSnedecor(TensorDistribution):
13-
def __init__(self, df1: Tensor, df2: Tensor, *, validate_args: bool | None = None) -> None:
13+
def __init__(
14+
self, df1: Tensor, df2: Tensor, *, validate_args: bool | None = None
15+
) -> None:
1416
self._df1: Tensor
1517
self._df2: Tensor
1618
self._df1, self._df2 = broadcast_all(df1, df2)

src/tensorcontainer/tensor_distribution/half_cauchy.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ class TensorHalfCauchy(TensorDistribution):
1515
# Annotated tensor parameters
1616
_scale: Tensor
1717

18-
def __init__(self, scale: float | Tensor, validate_args: bool | None = None) -> None:
18+
def __init__(
19+
self, scale: float | Tensor, validate_args: bool | None = None
20+
) -> None:
1921
(self._scale,) = broadcast_all(scale)
2022

2123
shape = self._scale.shape

src/tensorcontainer/tensor_distribution/half_normal.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ class TensorHalfNormal(TensorDistribution):
1414

1515
_scale: Tensor
1616

17-
def __init__(self, scale: Tensor | float, validate_args: bool | None = None) -> None:
17+
def __init__(
18+
self, scale: Tensor | float, validate_args: bool | None = None
19+
) -> None:
1820
(self._scale,) = broadcast_all(scale)
1921

2022
shape = self._scale.shape

src/tensorcontainer/tensor_distribution/logistic_normal.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ class TensorLogisticNormal(TensorDistribution):
1414
_loc: Tensor
1515
_scale: Tensor
1616

17-
def __init__(self, loc: Tensor, scale: Tensor, validate_args: bool | None = None) -> None:
17+
def __init__(
18+
self, loc: Tensor, scale: Tensor, validate_args: bool | None = None
19+
) -> None:
1820
loc, scale = broadcast_all(loc, scale)
1921

2022
if loc.ndim == 0:

src/tensorcontainer/tensor_distribution/poisson.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
class TensorPoisson(TensorDistribution):
1414
_rate: Tensor
1515

16-
def __init__(self, rate: Number | Tensor, validate_args: bool | None = None) -> None:
16+
def __init__(
17+
self, rate: Number | Tensor, validate_args: bool | None = None
18+
) -> None:
1719
(self._rate,) = broadcast_all(rate)
1820

1921
shape = self._rate.shape

0 commit comments

Comments
 (0)