Skip to content

Commit d0316b5

Browse files
committed
Update docstrings with valid value types
1 parent b91d1c1 commit d0316b5

File tree

3 files changed

+32
-32
lines changed

3 files changed

+32
-32
lines changed

Diff for: pymc3/distributions/continuous.py

+23-25
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def logcdf(self, value):
278278
279279
Parameters
280280
----------
281-
value: numeric
281+
value: numeric or np.ndarray or theano.tensor
282282
Value(s) for which log CDF is calculated. If the log CDF for multiple
283283
values are desired the values must be provided in a numpy array or theano tensor.
284284
@@ -347,7 +347,7 @@ def logcdf(self, value):
347347
348348
Parameters
349349
----------
350-
value: numeric
350+
value: numeric or np.ndarray or theano.tensor
351351
Value(s) for which log CDF is calculated. If the log CDF for multiple
352352
values are desired the values must be provided in a numpy array or theano tensor.
353353
@@ -404,7 +404,7 @@ def logcdf(self, value):
404404
405405
Parameters
406406
----------
407-
value: numeric
407+
value: numeric or np.ndarray or theano.tensor
408408
Value(s) for which log CDF is calculated. If the log CDF for multiple
409409
values are desired the values must be provided in a numpy array or theano tensor.
410410
@@ -545,7 +545,7 @@ def logcdf(self, value):
545545
546546
Parameters
547547
----------
548-
value: numeric
548+
value: numeric or np.ndarray or theano.tensor
549549
Value(s) for which log CDF is calculated. If the log CDF for multiple
550550
values are desired the values must be provided in a numpy array or theano tensor.
551551
@@ -903,7 +903,7 @@ def logcdf(self, value):
903903
904904
Parameters
905905
----------
906-
value: numeric
906+
value: numeric or np.ndarray or theano.tensor
907907
Value(s) for which log CDF is calculated. If the log CDF for multiple
908908
values are desired the values must be provided in a numpy array or theano tensor.
909909
@@ -1109,7 +1109,7 @@ def logcdf(self, value):
11091109
11101110
Parameters
11111111
----------
1112-
value: numeric
1112+
value: numeric or np.ndarray or theano.tensor
11131113
Value(s) for which log CDF is calculated. If the log CDF for multiple
11141114
values are desired the values must be provided in a numpy array or theano tensor.
11151115
@@ -1300,8 +1300,7 @@ def logcdf(self, value):
13001300
Parameters
13011301
----------
13021302
value: numeric
1303-
Value(s) for which log CDF is calculated. If the log CDF for multiple
1304-
values are desired the values must be provided in a numpy array or theano tensor.
1303+
Value(s) for which log CDF is calculated.
13051304
13061305
Returns
13071306
-------
@@ -1322,7 +1321,7 @@ def logcdf(self, value):
13221321
tt.switch(
13231322
tt.lt(value, 1),
13241323
tt.log(incomplete_beta(a, b, value)),
1325-
0
1324+
0,
13261325
),
13271326
0 <= value,
13281327
0 < a,
@@ -1537,7 +1536,7 @@ def logcdf(self, value):
15371536
15381537
Parameters
15391538
----------
1540-
value: numeric
1539+
value: numeric or np.ndarray or theano.tensor
15411540
Value(s) for which log CDF is calculated. If the log CDF for multiple
15421541
values are desired the values must be provided in a numpy array or theano tensor.
15431542
@@ -1652,7 +1651,7 @@ def logcdf(self, value):
16521651
16531652
Parameters
16541653
----------
1655-
value: numeric
1654+
value: numeric or np.ndarray or theano.tensor
16561655
Value(s) for which log CDF is calculated. If the log CDF for multiple
16571656
values are desired the values must be provided in a numpy array or theano tensor.
16581657
@@ -1808,7 +1807,7 @@ def logcdf(self, value):
18081807
18091808
Parameters
18101809
----------
1811-
value: numeric
1810+
value: numeric or np.ndarray or theano.tensor
18121811
Value(s) for which log CDF is calculated. If the log CDF for multiple
18131812
values are desired the values must be provided in a numpy array or theano tensor.
18141813
@@ -1971,8 +1970,7 @@ def logcdf(self, value):
19711970
Parameters
19721971
----------
19731972
value: numeric
1974-
Value(s) for which log CDF is calculated. If the log CDF for multiple
1975-
values are desired the values must be provided in a numpy array or theano tensor.
1973+
Value(s) for which log CDF is calculated.
19761974
19771975
Returns
19781976
-------
@@ -2121,7 +2119,7 @@ def logcdf(self, value):
21212119
21222120
Parameters
21232121
----------
2124-
value: numeric
2122+
value: numeric or np.ndarray or theano.tensor
21252123
Value(s) for which log CDF is calculated. If the log CDF for multiple
21262124
values are desired the values must be provided in a numpy array or theano tensor.
21272125
@@ -2240,7 +2238,7 @@ def logcdf(self, value):
22402238
22412239
Parameters
22422240
----------
2243-
value: numeric
2241+
value: numeric or np.ndarray or theano.tensor
22442242
Value(s) for which log CDF is calculated. If the log CDF for multiple
22452243
values are desired the values must be provided in a numpy array or theano tensor.
22462244
@@ -2348,7 +2346,7 @@ def logcdf(self, value):
23482346
23492347
Parameters
23502348
----------
2351-
value: numeric
2349+
value: numeric or np.ndarray or theano.tensor
23522350
Value(s) for which log CDF is calculated. If the log CDF for multiple
23532351
values are desired the values must be provided in a numpy array or theano tensor.
23542352
@@ -2499,7 +2497,7 @@ def logcdf(self, value):
24992497
25002498
Parameters
25012499
----------
2502-
value: numeric
2500+
value: numeric or np.ndarray or theano.tensor
25032501
Value(s) for which log CDF is calculated. If the log CDF for multiple
25042502
values are desired the values must be provided in a numpy array or theano tensor.
25052503
@@ -2673,7 +2671,7 @@ def logcdf(self, value):
26732671
26742672
Parameters
26752673
----------
2676-
value: numeric
2674+
value: numeric or np.ndarray or theano.tensor
26772675
Value(s) for which log CDF is calculated. If the log CDF for multiple
26782676
values are desired the values must be provided in a numpy array or theano tensor.
26792677
@@ -2860,7 +2858,7 @@ def logcdf(self, value):
28602858
28612859
Parameters
28622860
----------
2863-
value: numeric
2861+
value: numeric or np.ndarray or theano.tensor
28642862
Value(s) for which log CDF is calculated. If the log CDF for multiple
28652863
values are desired the values must be provided in a numpy array or theano tensor.
28662864
@@ -3160,7 +3158,7 @@ def logcdf(self, value):
31603158
31613159
Parameters
31623160
----------
3163-
value: numeric
3161+
value: numeric or np.ndarray or theano.tensor
31643162
Value(s) for which log CDF is calculated. If the log CDF for multiple
31653163
values are desired the values must be provided in a numpy array or theano tensor.
31663164
@@ -3549,7 +3547,7 @@ def logcdf(self, value):
35493547
35503548
Parameters
35513549
----------
3552-
value: numeric
3550+
value: numeric or np.ndarray or theano.tensor
35533551
Value(s) for which log CDF is calculated. If the log CDF for multiple
35543552
values are desired the values must be provided in a numpy array or theano tensor.
35553553
@@ -3678,7 +3676,7 @@ def logcdf(self, value):
36783676
36793677
Parameters
36803678
----------
3681-
value: numeric
3679+
value: numeric or np.ndarray or theano.tensor
36823680
Value(s) for which log CDF is calculated. If the log CDF for multiple
36833681
values are desired the values must be provided in a numpy array or theano tensor.
36843682
@@ -3960,7 +3958,7 @@ def logcdf(self, value):
39603958
39613959
Parameters
39623960
----------
3963-
value: numeric
3961+
value: numeric or np.ndarray or theano.tensor
39643962
Value(s) for which log CDF is calculated. If the log CDF for multiple
39653963
values are desired the values must be provided in a numpy array or theano tensor.
39663964
@@ -4302,7 +4300,7 @@ def logcdf(self, value):
43024300
43034301
Parameters
43044302
----------
4305-
value: numeric
4303+
value: numeric or np.ndarray or theano.tensor
43064304
Value(s) for which log CDF is calculated. If the log CDF for multiple
43074305
values are desired the values must be provided in a numpy array or theano tensor.
43084306

Diff for: pymc3/distributions/discrete.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ def logcdf(self, value):
463463
464464
Parameters
465465
----------
466-
value: numeric
466+
value: numeric or np.ndarray or theano.tensor
467467
Value(s) for which log CDF is calculated. If the log CDF for multiple
468468
values are desired the values must be provided in a numpy array or theano tensor.
469469
@@ -602,7 +602,7 @@ def logcdf(self, value):
602602
603603
Parameters
604604
----------
605-
value: numeric
605+
value: numeric or np.ndarray or theano.tensor
606606
Value(s) for which log CDF is calculated. If the log CDF for multiple
607607
values are desired the values must be provided in a numpy array or theano tensor.
608608
@@ -717,7 +717,7 @@ def logcdf(self, value):
717717
718718
Parameters
719719
----------
720-
value: numeric
720+
value: numeric or np.ndarray or theano.tensor
721721
Value(s) for which log CDF is calculated. If the log CDF for multiple
722722
values are desired the values must be provided in a numpy array or theano tensor.
723723
@@ -1017,7 +1017,7 @@ def logcdf(self, value):
10171017
10181018
Parameters
10191019
----------
1020-
value: numeric
1020+
value: numeric or np.ndarray or theano.tensor
10211021
Value(s) for which log CDF is calculated. If the log CDF for multiple
10221022
values are desired the values must be provided in a numpy array or theano tensor.
10231023
@@ -1288,7 +1288,7 @@ def logcdf(self, value):
12881288
12891289
Parameters
12901290
----------
1291-
value: numeric
1291+
value: numeric or np.ndarray or theano.tensor
12921292
Value(s) for which log CDF is calculated. If the log CDF for multiple
12931293
values are desired the values must be provided in a numpy array or theano tensor.
12941294
@@ -1601,7 +1601,7 @@ def logcdf(self, value):
16011601
16021602
Parameters
16031603
----------
1604-
value: numeric
1604+
value: numeric or np.ndarray or theano.tensor
16051605
Value(s) for which log CDF is calculated. If the log CDF for multiple
16061606
values are desired the values must be provided in a numpy array or theano tensor.
16071607

Diff for: pymc3/tests/test_distributions.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,9 @@ def check_selfconsistency_discrete_logcdf(
621621
try:
622622
dist.logcdf(np.array([value, value])).tag.test_value
623623
except TypeError as err:
624-
if not str(err).endswith(".logcdf expects a scalar value but received a 1-dimensional object."):
624+
if not str(err).endswith(
625+
".logcdf expects a scalar value but received a 1-dimensional object."
626+
):
625627
raise
626628

627629
def check_int_to_1(self, model, value, domain, paramdomains):

0 commit comments

Comments
 (0)