Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
29231: fix pyflakes warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mwageringel committed Feb 25, 2020
1 parent ad16967 commit d19232d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/sage/docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import sys, os, sphinx
import sys
import os
import sphinx
from sage.env import SAGE_DOC_SRC, SAGE_DOC, SAGE_SRC, THEBE_DIR, PPLPY_DOCS, MATHJAX_DIR
import sage.version
from sage.misc.sagedoc import extlinks
from sage.misc.sagedoc import extlinks # this is used despite pyflakes warning
import dateutil.parser
from six import iteritems
from docutils import nodes
Expand Down Expand Up @@ -660,7 +662,8 @@ def process_inherited(app, what, name, obj, options, docstringlines):
dangling_debug = False

def debug_inf(app, message):
if dangling_debug: app.info(message)
if dangling_debug:
app.info(message)

def call_intersphinx(app, env, node, contnode):
"""
Expand Down
5 changes: 3 additions & 2 deletions src/sage/numerical/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ def find_root(f, a, b, xtol=10e-13, rtol=2.0**-50, maxiter=100, full_output=Fals
return f.find_root(a=a,b=b,xtol=xtol,rtol=rtol,maxiter=maxiter,full_output=full_output)
except AttributeError:
pass
a = float(a); b = float(b)
a = float(a)
b = float(b)
if a > b:
a, b = b, a
left = f(a)
Expand Down Expand Up @@ -415,7 +416,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
hess=func.hessian()
hess_fast= [ [fast_callable(a, vars=var_names, domain=float) for a in row] for row in hess]
hessian=lambda p: [[a(*p) for a in row] for row in hess_fast]
hessian_p=lambda p,v: scipy.dot(numpy.array(hessian(p)),v)
hessian_p=lambda p,v: numpy.dot(numpy.array(hessian(p)),v)
min = optimize.fmin_ncg(f, [float(_) for _ in x0], fprime=gradient, \
fhess=hessian, fhess_p=hessian_p, disp=verbose, **args)
return vector(RDF, min)
Expand Down

0 comments on commit d19232d

Please sign in to comment.