Skip to content

Commit ec5df13

Browse files
committed
ran linter
1 parent 0859d25 commit ec5df13

File tree

3 files changed

+43
-43
lines changed

3 files changed

+43
-43
lines changed

bayesflow/adapters/transforms/as_set.py

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

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

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

bayesflow/adapters/transforms/concatenate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Concatenate(Transform):
2121
axis: integer specifing along which axis to concatonate the keys. The last axis is used by default.
2222
2323
Example:
24-
Suppose you have a simulator that generates variables beta, sigma from priors and then observation
24+
Suppose you have a simulator that generates variables beta, sigma from priors and then observation
2525
variables "x" and "y". We can then use concatonate in the following way
2626
2727
adapter = (

bayesflow/adapters/transforms/keep.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,37 +12,37 @@
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-
<<<<<<< HEAD
26+
adapter = (
27+
bf.adapters.Adapter()
28+
<<<<<<< HEAD
2929
30-
# drop data from unneeded priors alpha, and r
31-
=======
32-
# only keep theta and x
33-
>>>>>>> b8b68757b0ae1a5f34bf656a837abbeb77e2ec62
34-
.keep(("theta", "x"))
35-
)
30+
# drop data from unneeded priors alpha, and r
31+
=======
32+
# only keep theta and x
33+
>>>>>>> b8b68757b0ae1a5f34bf656a837abbeb77e2ec62
34+
.keep(("theta", "x"))
35+
)
3636
37-
Example:
38-
>>> a = [1, 2, 3, 4]
39-
>>> b = [[1, 2], [3, 4]]
40-
>>> c = [[5, 6, 7, 8]]
41-
>>> dat = dict(a=a, b=b, c=c)
42-
# Here we want to only keep elements b and c
43-
>>> keeper = bf.adapters.transforms.Keep(("b", "c"))
44-
>>> keeper.forward(dat)
45-
{'b': [[1, 2], [3, 4]], 'c': [[5, 6, 7, 8]]}
37+
Example:
38+
>>> a = [1, 2, 3, 4]
39+
>>> b = [[1, 2], [3, 4]]
40+
>>> c = [[5, 6, 7, 8]]
41+
>>> dat = dict(a=a, b=b, c=c)
42+
# Here we want to only keep elements b and c
43+
>>> keeper = bf.adapters.transforms.Keep(("b", "c"))
44+
>>> keeper.forward(dat)
45+
{'b': [[1, 2], [3, 4]], 'c': [[5, 6, 7, 8]]}
4646
4747
"""
4848

0 commit comments

Comments
 (0)