Skip to content

Commit 22aac12

Browse files
committed
Further improve bin1d_vec (3): .asarray() instead of .array()
i.e., don't create array copies if the input is already an array.
1 parent ec74058 commit 22aac12

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

csep/utils/calc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ def bin1d_vec(p, bins, tol=None, right_continuous=False):
7979
Raises:
8080
ValueError:
8181
"""
82-
bins = numpy.array(bins)
83-
p = numpy.array(p)
82+
bins = numpy.asarray(bins)
83+
p = numpy.asarray(p)
8484

8585
# if not np.all(bins[:-1] <= bins[1:]): # check for sorted bins, which is a requirement
8686
# raise ValueError("Bin edges are not sorted.") # (pyCSEP always passes sorted bins)

0 commit comments

Comments
 (0)