mirror of
https://github.com/fjosw/pyerrors.git
synced 2025-07-01 01:09:27 +02:00
flake8 style changes
This commit is contained in:
parent
43f85efff5
commit
57c6a07801
9 changed files with 87 additions and 128 deletions
|
@ -3,7 +3,8 @@
|
|||
|
||||
import scipy.optimize
|
||||
from autograd import jacobian
|
||||
from .pyerrors import Obs, derived_observable, pseudo_Obs
|
||||
from .pyerrors import derived_observable, pseudo_Obs
|
||||
|
||||
|
||||
def find_root(d, func, guess=1.0, **kwargs):
|
||||
"""Finds the root of the function func(x, d) where d is an Obs.
|
||||
|
@ -18,7 +19,7 @@ def find_root(d, func, guess=1.0, **kwargs):
|
|||
|
||||
# Error propagation as detailed in arXiv:1809.01289
|
||||
dx = jacobian(func)(root[0], d.value)
|
||||
da = jacobian(lambda u, v : func(v, u))(d.value, root[0])
|
||||
da = jacobian(lambda u, v: func(v, u))(d.value, root[0])
|
||||
deriv = - da / dx
|
||||
|
||||
return derived_observable(lambda x, **kwargs: x[0], [pseudo_Obs(root, 0.0, d.names[0], d.shape[d.names[0]]), d], man_grad=[0, deriv])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue