Skip to content

Commit

Permalink
fix ?
Browse files Browse the repository at this point in the history
  • Loading branch information
VanyaBelyaev committed Oct 8, 2024
1 parent b9e96e3 commit fc95230
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ostap/stats/gof_np.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
import numpy as np
import scipy as sp
from numpy.lib.recfunctions import structured_to_unstructured as s2u
from scipy.spatial.distance import cdist as cdist
from scipy.spatial.distance import cdist as cdist
sp_version = tuple ( int ( i ) for i in sp.__version__.split('.') )
if (1,6,0) <= sp_version : qconf = { 'k' : [ 2 ] , 'workers' : -1 }
else : qconf = { 'k' : 2 }
# =========================================================================
except ImportError :
# =========================================================================
Expand Down Expand Up @@ -392,9 +395,7 @@ def t_value ( self , ds1 , vpdf ) :
"Invalid arrays: %s , %s" % ( sh1 , sh2 )

tree = sp.spatial.KDTree ( ds1 )
conf = { 'k' : [2] }
if '1.6.0' <= sp.__version__ : conf [ 'workers'] = -1
uvalues , _ = tree.query ( ds1 , **conf )
uvalues , _ = tree.query ( ds1 , **qconf )

uvalues = uvalues.flatten ()

Expand Down Expand Up @@ -465,7 +466,8 @@ def histo ( self ) :
if not sp : logger.warning ( 'Scipy is not available' )
if not s2u : logger.warning ( 's2u is not available' )
if not cdist : logger.warning ( 'cdist is not available' )

if sp and sp_version < (1,6,0) :
logger.warning ( 'very ancient version of scipy: %s' % str ( sp_version ) )

# =============================================================================
## The END
Expand Down

0 comments on commit fc95230

Please sign in to comment.