Skip to content

Commit

Permalink
Further improve bin1d_vec (3): .asarray() instead of .array()
Browse files Browse the repository at this point in the history
i.e., don't create array copies if the input is already an array.
  • Loading branch information
mherrmann3 committed Feb 6, 2025
1 parent ec74058 commit 22aac12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions csep/utils/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def bin1d_vec(p, bins, tol=None, right_continuous=False):
Raises:
ValueError:
"""
bins = numpy.array(bins)
p = numpy.array(p)
bins = numpy.asarray(bins)
p = numpy.asarray(p)

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

0 comments on commit 22aac12

Please sign in to comment.