Skip to content

Commit

Permalink
Merge pull request #141 from pllim/np-1.20-compat
Browse files Browse the repository at this point in the history
MNT: Replace np.float with float
  • Loading branch information
pllim committed Feb 3, 2021
2 parents 2960341 + 0607a10 commit 17b7ea3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pysynphot/binning.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ def calculate_bin_centers(edges):
Array of bin centers. Will be 1D and have one less value than ``edges``.
"""
edges = np.asanyarray(edges, dtype=np.float)
edges = np.asanyarray(edges, dtype=float)

if edges.ndim != 1:
raise ValueError('edges input array must be 1D.')

if edges.size < 2:
raise ValueError('edges input must have at least two values.')

centers = np.empty(edges.size - 1, dtype=np.float)
centers = np.empty(edges.size - 1, dtype=float)

centers[0] = edges[:2].mean()

Expand Down
4 changes: 2 additions & 2 deletions pysynphot/spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -2739,9 +2739,9 @@ def __call__(self, wavelength):
wavelength array as argument.
"""
if wavelength is None:
thru = N.array([self.value], dtype=N.float)
thru = N.array([self.value], dtype=float)
else:
thru = N.zeros_like(wavelength, dtype=N.float) + self.value
thru = N.zeros_like(wavelength, dtype=float) + self.value

return thru

Expand Down
2 changes: 1 addition & 1 deletion pysynphot/test/test_binning.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

@pytest.mark.parametrize(
('centers', 'ref'),
[(np.arange(10, 20, dtype=np.float), np.arange(9.5, 20)),
[(np.arange(10, 20, dtype=float), np.arange(9.5, 20)),
(2.0 ** np.arange(1, 10), [1, 3, 6, 12, 24, 48, 96, 192, 384, 640])])
def test_calculate_bin_edges(centers, ref):
"""Test bin edges calculated for an evenly and an unevenly spaced
Expand Down

0 comments on commit 17b7ea3

Please sign in to comment.