Skip to content

Commit b997a06

Browse files
committed
ran linter
1 parent e35f420 commit b997a06

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

bayesflow/adapters/transforms/as_set.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55

66
class AsSet(ElementwiseTransform):
77
"""
8-
The `.as_set(["x", "y"])` transform indicates that both `x` and `y` are treated as sets.
9-
That is, their values will be treated as *exchangable* such that they will imply
10-
the same inference regardless of the values' order.
11-
This is useful, for example, in a linear regression context where we can index
12-
the observations in arbitrary order and always get the same regression line.
13-
14-
Useage:
15-
16-
adapter = (
17-
bf.Adapter()
18-
.as_set(["x", "y"])
19-
)
8+
The `.as_set(["x", "y"])` transform indicates that both `x` and `y` are treated as sets.
9+
That is, their values will be treated as *exchangable* such that they will imply
10+
the same inference regardless of the values' order.
11+
This is useful, for example, in a linear regression context where we can index
12+
the observations in arbitrary order and always get the same regression line.
13+
14+
Useage:
15+
16+
adapter = (
17+
bf.Adapter()
18+
.as_set(["x", "y"])
19+
)
2020
"""
2121

2222
def forward(self, data: np.ndarray, **kwargs) -> np.ndarray:

bayesflow/adapters/transforms/constrain.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Constrain(ElementwiseTransform):
4141
.constrain("sigma", lower=0)
4242
)
4343
44-
2 ) Suppose p is the parameter for a binomial distribution where p must be in
44+
2 ) Suppose p is the parameter for a binomial distribution where p must be in
4545
[0,1] then we would constrain the neural network to estimate p in the following way.
4646
4747
Usage:

bayesflow/adapters/transforms/keep.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,33 @@
1212
@serializable(package="bayesflow.adapters")
1313
class Keep(Transform):
1414
"""
15-
Name the data parameters that should be kept for futher calculation.
15+
Name the data parameters that should be kept for futher calculation.
1616
17-
Parameters:
17+
Parameters:
1818
19-
cls: tuple containing the names of kept data variables as strings.
19+
cls: tuple containing the names of kept data variables as strings.
2020
21-
Useage:
21+
Useage:
2222
23-
Two moons simulator generates data for priors alpha, r and theta as well as observation data x.
24-
We are interested only in theta and x, to keep only theta and x we should use the following;
23+
Two moons simulator generates data for priors alpha, r and theta as well as observation data x.
24+
We are interested only in theta and x, to keep only theta and x we should use the following;
2525
26-
adapter = (
27-
bf.adapters.Adapter()
28-
# drop data from unneeded priors alpha, and r
29-
# only keep theta and x
30-
.keep(("theta", "x"))
31-
)
26+
adapter = (
27+
bf.adapters.Adapter()
28+
# drop data from unneeded priors alpha, and r
29+
# only keep theta and x
30+
.keep(("theta", "x"))
31+
)
3232
33-
Example:
34-
>>> a = [1, 2, 3, 4]
35-
>>> b = [[1, 2], [3, 4]]
36-
>>> c = [[5, 6, 7, 8]]
37-
>>> dat = dict(a=a, b=b, c=c)
38-
# Here we want to only keep elements b and c
39-
>>> keeper = bf.adapters.transforms.Keep(("b", "c"))
40-
>>> keeper.forward(dat)
41-
{'b': [[1, 2], [3, 4]], 'c': [[5, 6, 7, 8]]}
33+
Example:
34+
>>> a = [1, 2, 3, 4]
35+
>>> b = [[1, 2], [3, 4]]
36+
>>> c = [[5, 6, 7, 8]]
37+
>>> dat = dict(a=a, b=b, c=c)
38+
# Here we want to only keep elements b and c
39+
>>> keeper = bf.adapters.transforms.Keep(("b", "c"))
40+
>>> keeper.forward(dat)
41+
{'b': [[1, 2], [3, 4]], 'c': [[5, 6, 7, 8]]}
4242
4343
"""
4444

0 commit comments

Comments
 (0)