Skip to content

Commit cb6dc79

Browse files
committed
Make all JacobianHandler arguments keyword-args for now
1 parent 2ea0728 commit cb6dc79

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

probdiffeq/probdiffeq.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,23 +172,23 @@ def init_jacobian_handler(self):
172172
"""
173173
raise NotImplementedError
174174

175-
def materialize_dense(self, fun, x, state):
175+
def materialize_dense(self, fun, x, state, /):
176176
"""Materialize a dense Jacobian.
177177
178178
This is typically used for first-order linearization in dense
179179
state-space models.
180180
"""
181181
raise NotImplementedError
182182

183-
def calculate_trace(self, fun, x, state):
183+
def calculate_trace(self, fun, x, state, /):
184184
"""Calculate the trace of a Jacobian.
185185
186186
This is typically used for first-order linearization in isotropic
187187
state-space models.
188188
"""
189189
raise NotImplementedError
190190

191-
def calculate_diagonal(self, fun, x, state):
191+
def calculate_diagonal(self, fun, x, state, /):
192192
"""Calculate the diagonal of a Jacobian.
193193
194194
This is typically used for first-order linearization in block-diagonal
@@ -209,20 +209,20 @@ def __init__(self, *, jacfun=func.jacfwd):
209209
def init_jacobian_handler(self):
210210
return ()
211211

212-
def materialize_dense(self, fun, x, state):
212+
def materialize_dense(self, fun, x, state, /):
213213
del state
214214
fx = fun(x)
215215
dfx = func.jacfwd(fun)(x)
216216
return fx, dfx, ()
217217

218-
def calculate_trace(self, fun, x, state):
218+
def calculate_trace(self, fun, x, state, /):
219219
del state
220220
fx = fun(x)
221221
dfx = func.jacfwd(fun)(x)
222222
dfx_trace = linalg.trace(dfx)
223223
return fx, dfx_trace, ()
224224

225-
def calculate_diagonal(self, fun, x, state):
225+
def calculate_diagonal(self, fun, x, state, /):
226226
del state
227227
fx = fun(x)
228228
dfx = func.jacfwd(fun)(x)
@@ -245,7 +245,7 @@ def __init__(self, *, seed=1, num_probes=10):
245245
def init_jacobian_handler(self):
246246
return random.prng_key(seed=self.seed)
247247

248-
def materialize_dense(self, fun, x, state):
248+
def materialize_dense(self, fun, x, state, /):
249249
# TODO: approximate Jacobian with outer products instead of forming?
250250
# What is the "correct" thing to do?
251251
fx = fun(x)
@@ -288,7 +288,7 @@ def __init__(self, *, seed=1, num_probes=10):
288288
def init_jacobian_handler(self):
289289
return random.prng_key(seed=self.seed)
290290

291-
def materialize_dense(self, fun, x, state):
291+
def materialize_dense(self, fun, x, state, /):
292292
# TODO: approximate Jacobian with outer products instead of forming?
293293
# What is the "correct" thing to do?
294294
fx = fun(x)

0 commit comments

Comments
 (0)