Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the deprecated numpy dtypes "int" and "float" #217

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions python/bifrost/header_standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
# Format:
# 'parameter name':(type, minimum)
STANDARD_HEADER = {
'nchans': ((int, np.int64), 1),
'nifs': ((int, np.int64), 1),
'nbits': ((int, np.int64), 1),
'fch1': ((float, np.float64), 0),
'foff': ((float, np.float64), None),
'tstart': ((float, np.float64), 0),
'tsamp': ((float, np.float64), 0)}
'nchans': ((int, np.integer), 1),
'nifs': ((int, np.integer), 1),
'nbits': ((int, np.integer), 1),
'fch1': ((float, np.floating), 0),
'foff': ((float, np.floating), None),
'tstart': ((float, np.floating), 0),
'tsamp': ((float, np.floating), 0)}

def enforce_header_standard(header_dict):
"""Raise an error if the header dictionary passed
Expand Down
6 changes: 3 additions & 3 deletions test/test_header_standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ def test_simple_header(self):
def test_numpy_types(self):
"""Same values, but some are numpy types"""
self.header_dict = {
'nchans': np.int64(1), 'nifs': 1, 'nbits': 8,
'fch1': np.float64(100.0), 'foff': np.float64(1e-5),
'tstart': 1e5, 'tsamp': np.float64(1e-5)}
'nchans': np.int32(1), 'nifs': 1, 'nbits': 8,
'fch1': np.float32(100.0), 'foff': np.float64(1e-5),
'tstart': 1e5, 'tsamp': np.float32(1e-5)}
def test_extra_parameters(self):
"""Add some extra parameters"""
self.header_dict = {
Expand Down
Loading