Skip to content

Commit 2bbfbbb

Browse files
authored
[MRG] debug documentation (#453)
1 parent 89f1613 commit 2bbfbbb

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docs/source/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ def __getattr__(cls, name):
7575
'sphinx.ext.viewcode',
7676
'sphinx.ext.napoleon',
7777
'sphinx_gallery.gen_gallery',
78-
'myst_parser'
78+
'myst_parser',
79+
"sphinxcontrib.jquery",
7980
]
8081

8182
autosummary_generate = True

ot/optim.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ def phi(alpha1):
9393
fc[0] += 1
9494
alpha10 = nx.from_numpy(alpha1)
9595
fval = f(xk0 + alpha10 * pk0, *args)
96-
if type(fval) is float:
96+
if isinstance(fval, float):
9797
# prevent bug from nx.to_numpy that can look for .cpu or .gpu
9898
return fval
9999
else:
100100
return nx.to_numpy(fval)
101101

102102
if old_fval is None:
103103
phi0 = phi(0.)
104-
elif type(old_fval) is float:
104+
elif isinstance(old_fval, float):
105105
# prevent bug from nx.to_numpy that can look for .cpu or .gpu
106106
phi0 = old_fval
107107
else:

0 commit comments

Comments
 (0)