Skip to content

Commit

Permalink
RFC: Replace np.array with np.asarray in gridtools.py
Browse files Browse the repository at this point in the history
  • Loading branch information
oyamad committed Nov 29, 2022
1 parent 9017fd8 commit 1494995
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions quantecon/gridtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def cartesian(nodes, order='C'):
each line corresponds to one point of the product space
'''

nodes = [np.array(e) for e in nodes]
nodes = [np.asarray(e) for e in nodes]
shapes = [e.shape[0] for e in nodes]

dtype = np.result_type(*nodes)
Expand Down Expand Up @@ -75,9 +75,9 @@ def mlinspace(a, b, nums, order='C'):
each line corresponds to one point of the product space
'''

a = np.array(a, dtype='float64')
b = np.array(b, dtype='float64')
nums = np.array(nums, dtype='int64')
a = np.asarray(a, dtype='float64')
b = np.asarray(b, dtype='float64')
nums = np.asarray(nums, dtype='int64')
nodes = [np.linspace(a[i], b[i], nums[i]) for i in range(len(nums))]

return cartesian(nodes, order=order)
Expand Down

0 comments on commit 1494995

Please sign in to comment.