Skip to content

Commit

Permalink
fix silly bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yoelcortes committed May 24, 2024
1 parent 302b420 commit dcc6b0b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion flexsolve/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@
from .problem import *
from .profiler import *

__version__ = '0.5.6'
__version__ = '0.5.7'
11 changes: 7 additions & 4 deletions flexsolve/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ def jit_mean(x): # pragma: no cover

# Fixed point

def fixedpoint_converged(dx, xtol):
def fixedpoint_converged(dx, xtol, subset=0):
if isinstance(dx, Iterable) and dx.ndim:
return array_fixedpoint_converged(dx, xtol)
return array_fixedpoint_converged(dx, xtol, subset)
else:
return scalar_fixedpoint_converged(dx, xtol)

Expand All @@ -70,8 +70,11 @@ def scalar_fixedpoint_converged(dx, xtol):
return dx < xtol

@njit(cache=True)
def array_fixedpoint_converged(dx, xtol):
return (dx < xtol).all()
def array_fixedpoint_converged(dx, xtol, subset):
if subset:
return (dx[:subset] < xtol).all()
else:
return (dx < xtol).all()

# Wegstein

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
name='flexsolve',
packages=['flexsolve'],
license='MIT',
version='0.5.6',
version='0.5.7',
description='Flexible function solvers',
long_description=open('README.rst').read(),
author='Yoel Cortes-Pena',
Expand Down

0 comments on commit dcc6b0b

Please sign in to comment.