Skip to content

Commit fd4c71d

Browse files
authored
Make parent class signature match child classes (#3207)
* Make parent class signature match child classes * Write down docs
1 parent 4d79f92 commit fd4c71d

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

pymc3/step_methods/hmc/quadpotential.py

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,23 @@ def update(self, sample, grad, tune):
9494
"""
9595
pass
9696

97-
def raise_ok(self):
98-
pass
97+
def raise_ok(self, vmap=None):
98+
"""Check if the mass matrix is ok, and raise ValueError if not.
99+
100+
Parameters
101+
----------
102+
vmap : blocking.ArrayOrdering.vmap
103+
List of `VarMap`s, which are namedtuples with var, slc, shp, dtyp
104+
105+
Raises
106+
------
107+
ValueError if any standard deviations are 0 or infinite
108+
109+
Returns
110+
-------
111+
None
112+
"""
113+
return None
99114

100115
def reset(self):
101116
pass
@@ -186,6 +201,21 @@ def update(self, sample, grad, tune):
186201
self._n_samples += 1
187202

188203
def raise_ok(self, vmap):
204+
"""Check if the mass matrix is ok, and raise ValueError if not.
205+
206+
Parameters
207+
----------
208+
vmap : blocking.ArrayOrdering.vmap
209+
List of `VarMap`s, which are namedtuples with var, slc, shp, dtyp
210+
211+
Raises
212+
------
213+
ValueError if any standard deviations are 0 or infinite
214+
215+
Returns
216+
-------
217+
None
218+
"""
189219
if np.any(self._stds == 0):
190220
name_slc = []
191221
tmp_hold = list(range(self._stds.size))

0 commit comments

Comments
 (0)