Skip to content

Commit

Permalink
Merge pull request #759 from Yash-10/Reduce-test-warnings
Browse files Browse the repository at this point in the history
Reduce test warnings
  • Loading branch information
mwcraig committed Mar 8, 2021
2 parents a32afff + aa3af93 commit 1a5934c
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 92 deletions.
2 changes: 1 addition & 1 deletion ccdproc/extern/bitfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def interpret_bit_flags(bit_flags, flip_bits=None):

def bitfield_to_boolean_mask(bitfield, ignore_flags=0, flip_bits=None,
good_mask_value=True, dtype=np.bool_):
"""
r"""
bitfield_to_boolean_mask(bitfield, ignore_flags=None, flip_bits=None, \
good_mask_value=True, dtype=numpy.bool\_)
Converts an array of bit fields to a boolean (or integer) mask array
Expand Down
17 changes: 11 additions & 6 deletions ccdproc/log_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from astropy import units as u
from astropy.io import fits

import ccdproc # really only need Keyword from ccdproc
import ccdproc # Really only need Keyword from ccdproc

__all__ = []

Expand Down Expand Up @@ -63,9 +63,15 @@ def log_to_metadata(func):
"""
func.__doc__ = func.__doc__.format(log=_LOG_ARG_HELP)

(original_args, varargs, keywords, defaults) = inspect.getargspec(func)
argspec = inspect.getfullargspec(func)
original_args, varargs, keywords, defaults = (argspec.args, argspec.varargs,
argspec.varkw, argspec.defaults)
# original_args = argspec.args
# varargs = argspec.varargs
# keywords = argspec.varkw
# defaults = argspec.defaults

# grab the names of positional arguments for use in automatic logging
# Grab the names of positional arguments for use in automatic logging
try:
original_positional_args = original_args[:-len(defaults)]
except TypeError:
Expand All @@ -79,8 +85,7 @@ def log_to_metadata(func):
defaults = []
defaults.append(True)

signature_with_arg_added = inspect.formatargspec(original_args, varargs,
keywords, defaults)
signature_with_arg_added = inspect.signature(func)
signature_with_arg_added = "{0}{1}".format(func.__name__,
signature_with_arg_added)
func.__doc__ = "\n".join([signature_with_arg_added, func.__doc__])
Expand Down Expand Up @@ -136,7 +141,7 @@ def _replace_array_with_placeholder(value):
try:
length = len(value)
except TypeError:
# value has no length...
# Value has no length...
try:
# ...but if it is NDData its .data will have a length
length = len(value.data)
Expand Down
2 changes: 1 addition & 1 deletion ccdproc/tests/test_ccdmask.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def test_ccdmask_pixels():
19971, 20063, 19936, 19941, 19928, 19937, 19970, 19931, 20036,
19965, 19855, 19949, 19965, 19821]]), unit='adu')

target_mask = np.zeros(flat1.shape, dtype=np.bool)
target_mask = np.zeros(flat1.shape, dtype=bool)

# No bad pixels in this scenario
ratio = flat1.divide(flat2)
Expand Down

0 comments on commit 1a5934c

Please sign in to comment.