- changed milestone to 0.6.0
lib5c.util.optimization.array_newton() is redundant with latest scipy versions
we could drop the function from lib5c and bump the scipy dependency
Comments (9)
-
reporter -
reporter an important question for clients (who might need to update client code) is whether or not the signatures of
lib5c.util.optimization.array_newton()
andscipy.optimize.newton()
are the samelib5c
has:def array_newton(func, x0, fprime=None, args=(), tol=1.48e-8, maxiter=50, fprime2=None, failure_idx_flag=None):
and returns
root
iffailure_idx_flag
is False or(root, failures, zero_der)
if it is Truewhile
scipy
has:def newton(func, x0, fprime=None, args=(), tol=1.48e-8, maxiter=50, fprime2=None, x1=None, rtol=0.0, full_output=False, disp=True):
and returns
root
iffull_output
is False or(root, converged, zero_der)
if it is Truebased on this it sounds like an “upgrade guide“ is to
- replace
from lib5c.util.optimization import array_newton
withfrom scipy.optimize import newton
- rename the function calls from
array_newton()
tonewton()
- rename the kwarg from
failure_idx_flag
tofull_output
- if full output was expected, capture it as
(root, converged, zero_der)
and then writefailures = ~converged
- replace
-
reporter the next step is to identify the expected surface area of
array_newton()
it has one caller in
lib5c
itself: https://bitbucket.org/creminslab/lib5c/src/44ec96f/lib5c/algorithms/variance/cross_rep.py#lines-53it has no callers in
hic3defdr
: instead we use the newscipy.optimize.newton()
thereit has no callers in
hiclite
it is not expected to have any callers in client code
-
reporter the converse of this issue is to say that
array_newton()
provides a backport that allows us to support older scipy versions -
reporter - marked as trivial
-
reporter 6c07758 modifies the docstring to suggest a soft deprecation
-
reporter if we go through with either solution of #52 this could be addressed then
-
reporter - changed status to on hold
-
reporter [docs] modified docstring of array_newton() to indicate soft deprecation
see #53
→ <<cset 6c077581c6da>>
- Log in to comment