Skip to content

Commit

Permalink
added ability to change step size on the fly
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Sanchez committed Oct 30, 2024
1 parent 79187fe commit 1579057
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions augur/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def f(self, x, labels, pars_fid, sys_fid):
f_out.append(self.lk.compute_theory_vector(self.tools))
return np.array(f_out)

def get_derivatives(self, force=False, method='5pt_stencil'):
def get_derivatives(self, force=False, method='5pt_stencil', step=None):
"""
Auxiliary function to compute numerical derivatives of the helper function `f`
Expand All @@ -223,9 +223,12 @@ def get_derivatives(self, force=False, method='5pt_stencil'):
method : str
Method to compute derivatives, currently only `5pt_stencil` or `numdifftools`
are allowed.
step : float
Step size for numerical differentiation
"""

step = float(self.config['step'])
if step is None:
step = float(self.config['step'])
# Compute the derivatives with respect to the parameters in var_pars at x
if (self.derivatives is None) or (force):
if '5pt_stencil' in method:
Expand Down

0 comments on commit 1579057

Please sign in to comment.