Commit fed6ea08 authored by Michiel Cottaar's avatar Michiel Cottaar
Browse files

ENH: add warning if out of range

parent eb0e7369
Pipeline #5317 passed with stage
in 2 minutes and 25 seconds
......@@ -21,6 +21,7 @@ import numpy as np
import itertools
from .. import request, cuda
import h5py
from warnings import warn
def hcp_packing(bounding_box, distance=1):
......@@ -168,6 +169,8 @@ class RadialBasis(BasisFunc):
max_size = size1.max() + req.radius().max()
list_of_lists = tree2.query_ball_tree(self.tree, r=max_size)
idx_centroid = sp.fromiter(itertools.chain(*list_of_lists), dtype='i4')
if len(idx_centroid) == 0:
warn("Only evaluating positions out of range of the dipole basis functions")
idx_req_compressed = sp.append(0, sp.cumsum([len(l) for l in list_of_lists]))
if return_compressed:
return idx_req_compressed, idx_centroid
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment