Language string | Code string | Query string | URI string | Relevance int64 | Notes string |
|---|---|---|---|---|---|
Python | return self.__mul__(other) | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#__rmul__ | 0 | |
Python | from astropy.units.si import radian
if unit_type is not None:
raise UnitTypeError("argument 'type' should not have a unit")
return [
None,
get_converter(unit_ri, radian),
get_converter(unit_di, radian),
get_converter(unit_astrom, astrom_unit()),
], (radian, radian) | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#helper_atoiq | 0 | |
Python | self._lowercase_names_to_locations = {}
# these can be whatever case is appropriate
self._names = [] | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#__init__ | 0 | |
Python | nd1 = NDDataArithmetic(1, mask=mask1)
nd2 = NDDataArithmetic(1, mask=mask2)
if mask1 is None and mask2 is None:
ref_mask = None
elif mask1 is None:
ref_mask = mask2
elif mask2 is None:
ref_mask = mask1
else:
ref_mask = mask1 | mask2
# Addition
nd3 = nd1.add(... | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#test_arithmetics_data_masks | 0 | |
Python | config = {"verify": "exception"}
with pytest.raises(W08):
tree.check_string(42, "foo", config) | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#test_string_fail | 0 | |
Python | node = {}
if isinstance(quantity, Quantity):
node["value"] = quantity.value
node["unit"] = quantity.unit
return node
raise TypeError(f"'{quantity}' is not a valid Quantity") | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#to_tree | 0 | |
Python | if not hasattr(self._file, "read"):
raise EOFError
try:
return self._file.read(size)
except OSError:
# On some versions of Python, it appears, GzipFile will raise an
# OSError if you try to read past its end (as opposed to just
# returning '')
... | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#read | 0 | |
Python | """Creates a column format object from another column format object
regardless of their type.
That is, this can convert a _ColumnFormat to an _AsciiColumnFormat
or vice versa at least in cases where a direct translation is possible.
"""
return cls.from_recformat(format.recformat... | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#from_column_format | 0 | |
Python | """
Split the card image between the keyword and the rest of the card.
"""
if self._image is not None:
# If we already have a card image, don't try to rebuild a new card
# image, which self.image would do
image = self._image
else:
image = s... | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#_split | 1 | |
Python | """
Make a copy of this `Parameter`, overriding any of its core attributes
in the process (or an exact copy).
The arguments to this method are the same as those for the `Parameter`
initializer. This simply returns a new `Parameter` instance with any
or all of the attributes ove... | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#copy | 0 | |
Python | @deprecated_renamed_argument("clobber", "overwrite", "1.3", relax=True)
def test(overwrite):
return overwrite
# As positional argument only
assert test(1) == 1
# As new keyword argument
assert test(overwrite=1) == 1
# Using the deprecated name
with pytest.warns(AstropyDeprecationW... | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#test_deprecated_argument_relaxed | 0 | |
Python | def no_rmtree(*args, **kwargs):
warnings.warn(CacheMissingWarning("in use"))
raise PermissionError
if CAN_RENAME_DIRECTORY_IN_USE:
# This platform is able to remove files while in use.
monkeypatch.setattr(astropy.utils.data, "_rmtree", no_rmtree)
u, c = next(valid_urls)
wit... | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#test_update_of_open_files_windows | 0 | |
Python | super().setup_class()
self.ma = Masked(self.a, mask=self.mask_a)
self.mb = Masked(self.b, mask=self.mask_b)
self.mc = Masked(self.c, mask=self.mask_c)
self.msa = Masked(self.sa, mask=self.mask_sa)
self.msb = Masked(self.sb, mask=self.mask_sb)
self.msc = Masked(self.sc, ma... | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#setup_class | 0 | |
Python | """
Generator to return a Constant object.
Parameters
----------
codata, iaudata : obj
Modules containing CODATA and IAU constants of interest.
module : obj
Namespace module of interest.
not_in_module_only : bool
If ``True``, ignore constants that are already in the
... | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#_get_c | 0 | |
Python | """
An equatorial coordinate or frame using the True Equator and True Equinox (TETE).
Equatorial coordinate frames measure RA with respect to the equinox and declination
with with respect to the equator. The location of the equinox and equator vary due
the gravitational torques on the oblate Earth. Thi... | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#TETE | 0 | |
Python | def build(self, o):
if m is None:
raise UnknownType(o.__class__.__name__)
return m(o)
def build_List(self, o):
return list(map(self.build, o.getChildren()))
def build_Const(self, o):
return o.value
def build_Dict(self, o):
d = {}
i = iter(map(se... | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#Builder | 0 | |
Python | length = CARD_LENGTH
"""The length of a Card image; should always be 80 for valid FITS files."""
# String for a FITS standard compliant (FSC) keyword.
_keywd_FSC_RE = re.compile(r"^[A-Z0-9_-]{0,%d}$" % KEYWORD_LENGTH)
# This will match any printable ASCII character excluding '='
_keywd_hierarch_RE ... | Inconsistency in double single-quote ('') management in FITS Card
### Description
The management of single-quotes in FITS cards seem correct, except *sometimes* when dealing with null strings, i.e. double single quotes (`''`), which sometimes are transformed into single single quotes (`'`).
E.g.:
```python
In [... | astropy_80c3854a5f4f4a6ab86c03d9db7854767fcd83c1#Card | 1 | |
Python | """Test :attr:`astropy.cosmology.Parameter.__set__`."""
# test it's already set
assert hasattr(cosmo, all_parameter._attr_name_private)
# and raises an error if set again
with pytest.raises(AttributeError, match="can't set attribute"):
setattr(cosmo, all_parameter._attr_name... | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#test_Parameter_descriptor_set | 0 | |
Python | """Test surface brightness conversions."""
slam = u.erg / (u.cm**2 * u.s * u.AA * u.sr)
snu = u.erg / (u.cm**2 * u.s * u.Hz * u.sr)
wave = u.Quantity([4956.8, 4959.55, 4962.3], u.AA)
sb_flam = [3.9135e-14, 4.0209e-14, 3.9169e-14]
sb_fnu = [3.20735792e-25, 3.29903646e-25, 3.21727226e-25]
# S(nu... | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#test_spectraldensity6 | 0 | |
Python | unit = self.unit._copy(dimensionless_unscaled)
return self._wrap_function(np.ediff1d, to_end, to_begin, unit=unit) | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#ediff1d | 0 | |
Python | check_structured_unit(unit_pv, dt_pv)
return [get_converter(unit_t, unit_pv[0] / unit_pv[1]), None], unit_pv[0] | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#helper_pvup | 0 | |
Python | class Spam:
def _astropy_repr_in_frame(self):
return "TEST REPR"
class TestFrame(BaseCoordinateFrame):
attrtest = Attribute(default=Spam())
assert "TEST REPR" in repr(TestFrame()) | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#test_attribute_repr | 0 | |
Python | ts = BinnedTimeSeries(
time_bin_start="2016-03-22T12:30:31", time_bin_size=3 * u.s, data=[[1, 4, 3]]
)
assert_equal(
ts.time_bin_start.isot,
[
"2016-03-22T12:30:31.000",
"2016-03-22T12:30:34.000",
"2016-03-22T12:30:37.000",
],
)
asser... | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#test_even_contiguous | 0 | |
Python | return list(self.keys()) | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#__dir__ | 0 | |
Python | """
Calculate the resulting mask.
This is implemented as the piecewise ``or`` operation if both have a
mask.
Parameters
----------
operation : callable
see :meth:`NDArithmeticMixin._arithmetic` parameter description.
By default, the ``operation``... | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#_arithmetic_mask | 1 | |
Python | """
Calculate the resulting wcs.
There is actually no calculation involved but it is a good place to
compare wcs information of both operands. This is currently not working
properly with `~astropy.wcs.WCS` (which is the suggested class for
storing as wcs property) but it will no... | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#_arithmetic_wcs | 1 | |
Python | if self.mask is None:
return None
try:
return self.mask[item]
except TypeError:
log.info("mask cannot be sliced.")
return self.mask | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#_slice_mask | 0 | |
Python | result = op(self.d, 0.0)
assert_array_equal(result, Distribution(op(self.d.distribution, 0.0))) | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#test_distribution_can_be_compared_to_non_distribution | 0 | |
Python | hdu = fits.CompImageHDU(np.ones((10, 10)))
del hdu._header[kw]
with pytest.raises(KeyError) as exc:
compress_image_data(
hdu.data, hdu.compression_type, hdu._header, hdu.columns
)
assert kw in str(exc.value) | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#test_header_missing_keyword | 0 | |
Python | fields = [self.data.field(idx) for idx in range(len(self.data.columns))]
# Creating Record objects is expensive (as in
# `for row in self.data:` so instead we just iterate over the row
# indices and get one field at a time:
for idx in range(len(self.data)):
for field in fiel... | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#_writedata_by_row | 0 | |
Python | if not HAS_SORTEDCONTAINERS:
raise ImportError("sortedcontainers is needed for using SCEngine")
node_keys = map(tuple, data)
self._nodes = SortedList(starmap(Node, zip(node_keys, row_index)))
self._unique = unique | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#__init__ | 0 | |
Python | self._setup(table_types)
self.t.add_column(self.b)
self.t.remove_rows([0, 2])
assert self.t["a"].meta == {"aa": [0, 1, 2, 3, 4]}
assert self.t.dtype == np.dtype([("a", "int"), ("b", "int")]) | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#test_remove_row_preserves_meta | 0 | |
Python | t = ParamsTable(names=["a", "b", "params"], dtype=["i", "f", "O"])
t.add_row((1, 2.0, {"x": 1.5, "y": 2.5}))
t.add_row((2, 3.0, {"z": "hello", "id": 123123}))
assert t["params"][0] == {"x": 1.5, "y": 2.5}
assert t[0]["params"] == {"x": 1.5, "y": 2.5}
assert t[0]["y"] == 2.5
assert t[1]["id"] == ... | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#test_params_table | 0 | |
Python | lower = mk.MagicMock()
upper = mk.MagicMock()
interval = _Interval(lower, upper)
assert isinstance(interval, _BaseInterval)
assert interval.lower == lower
assert interval.upper == upper
assert interval == (lower, upper)
assert interval.__repr__() == f"Interval(lo... | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#test_create | 0 | |
Python | for idx, name in enumerate(params):
self.check_parameter(spl, base_name, name, idx, value, fixed) | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#check_parameters | 0 | |
Python | import sys # noqa: F401
# import termios now or else you'll get the Unix
# version on the Mac
import termios # noqa: F401
import tty # noqa: F401 | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#__init__ | 0 | |
Python | @deprecated_renamed_argument("clobber", "overwrite", "1.3", pending=True)
def test(overwrite):
return overwrite
# As positional argument only
assert test(1) == 1
# As new keyword argument
assert test(overwrite=1) == 1
# Using the deprecated name
assert test(clobber=1) == 1
# ... | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#test_deprecated_argument_pending | 0 | |
Python | main_url = conf.dataurl
mirror_url = conf.dataurl_mirror
fileloc = "intersphinx/README"
urls = []
sources = {}
for s in ["", fileloc]:
urls.append(main_url + s)
sources[urls[-1]] = [urls[-1], mirror_url + s]
fnout = download_files_in_parallel(urls, sources=sources)
assert all... | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#test_download_parallel_from_internet_works | 0 | |
Python | """
Tests for a Cosmology[To/From]Format with ``format="astropy.row"``.
This class will not be directly called by :mod:`pytest` since its name does
not begin with ``Test``. To activate the contained tests this class must
be inherited in a subclass. Subclasses must define a :func:`pytest.fixture`
``c... | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#ToFromRowTestMixin | 0 | |
Python | """The value supplied was of the correct type, but was too big."""
def __init__(self, value):
"""
>>> raise VdtValueTooBigError('1')
Traceback (most recent call last):
VdtValueTooBigError: the value "1" is too big.
"""
ValidateError.__init__(self, 'the value "%s" is ... | In v5.3, NDDataRef mask propagation fails when one of the operand does not have a mask
### Description
This applies to v5.3.
It looks like when one of the operand does not have a mask, the mask propagation when doing arithmetic, in particular with `handle_mask=np.bitwise_or` fails. This is not a problem in v5.2.
... | astropy_b16c7d12ccbc7b2d20364b89fb44285bcbfede54#VdtValueTooBigError | 0 | |
Python | """
Adds to the equivalencies enabled in the unit registry.
These equivalencies are used if no explicit equivalencies are given,
both in unit conversion and in finding equivalent units.
This is meant in particular for allowing angles to be dimensionless.
Since no equivalencies are enabled by defau... | InheritDocstrings metaclass doesn't work for properties
Inside the InheritDocstrings metaclass it uses `inspect.isfunction` which returns `False` for properties.
| astropy_26d147868f8a891a6009a25cd6a8576d2e1bd747#add_enabled_equivalencies | 0 | |
Python | foo = u.def_unit("foo", u.m ** 3, namespace=locals())
assert 'foo' in locals()
with u.add_enabled_units(foo):
assert 'foo' in u.get_current_unit_registry().registry
assert 'foo' not in u.get_current_unit_registry().registry | InheritDocstrings metaclass doesn't work for properties
Inside the InheritDocstrings metaclass it uses `inspect.isfunction` which returns `False` for properties.
| astropy_26d147868f8a891a6009a25cd6a8576d2e1bd747#test_register | 0 | |
Python | a = Angle([-20, 150, 350] * u.deg)
assert a.is_within_bounds('0d', '360d') is False
assert a.is_within_bounds(None, '360d') is True
assert a.is_within_bounds(-30 * u.deg, None) is True
a = Angle('-20d')
assert a.is_within_bounds('0d', '360d') is False
assert a.is_within_bounds(None, '360d') is ... | InheritDocstrings metaclass doesn't work for properties
Inside the InheritDocstrings metaclass it uses `inspect.isfunction` which returns `False` for properties.
| astropy_26d147868f8a891a6009a25cd6a8576d2e1bd747#test_is_within_bounds | 0 | |
Python | base = array
while True:
if (hasattr(base, '_coldefs') and
isinstance(base._coldefs, ColDefs)):
for col in base._coldefs:
if col is self and self._parent_fits_rec is None:
self._parent_fits_rec = weakref.ref(base)
... | InheritDocstrings metaclass doesn't work for properties
Inside the InheritDocstrings metaclass it uses `inspect.isfunction` which returns `False` for properties.
| astropy_26d147868f8a891a6009a25cd6a8576d2e1bd747#array | 0 | |
Python | """
Regression test for https://github.com/astropy/astropy/pull/4514
Tests that columns with the X (bit array) format can be deep-copied.
"""
c = fits.Column('xcol', format='5X', array=[1, 0, 0, 1, 0])
c2 = copy.deepcopy(c)
assert c2.name == c.name
assert c2.for... | InheritDocstrings metaclass doesn't work for properties
Inside the InheritDocstrings metaclass it uses `inspect.isfunction` which returns `False` for properties.
| astropy_26d147868f8a891a6009a25cd6a8576d2e1bd747#test_x_column_deepcopy | 0 | |
Python | """
Calculate the separability of outputs.
Parameters
----------
transform : `astropy.modeling.Model`
A transform (usually a compound model).
Returns
-------
is_separable : ndarray of dtype np.bool
An array of shape (transform.n_outputs,) of boolean type
Each elemen... | InheritDocstrings metaclass doesn't work for properties
Inside the InheritDocstrings metaclass it uses `inspect.isfunction` which returns `False` for properties.
| astropy_26d147868f8a891a6009a25cd6a8576d2e1bd747#_separable | 0 | |
Python | """
Test that convolve works correctly when inputs are lists
"""
x = [1, 4, 5, 6, 5, 7, 8]
y = [0.2, 0.6, 0.2]
z = convolve(x, y, boundary=None)
assert_array_almost_equal_nulp(z,
np.array([0., 3.6, 5., 5.6, 5.6, 6.8, 0.]), 10) | InheritDocstrings metaclass doesn't work for properties
Inside the InheritDocstrings metaclass it uses `inspect.isfunction` which returns `False` for properties.
| astropy_26d147868f8a891a6009a25cd6a8576d2e1bd747#test_list | 0 | |
Python | """
The abstract base class of all unit formats.
"""
def __new__(cls, *args, **kwargs):
# This __new__ is to make it clear that there is no reason to
# instantiate a Formatter--if you try to you'll just get back the
# class
return cls
@classmethod
def parse(cls, s):... | InheritDocstrings metaclass doesn't work for properties
Inside the InheritDocstrings metaclass it uses `inspect.isfunction` which returns `False` for properties.
| astropy_26d147868f8a891a6009a25cd6a8576d2e1bd747#Base | 0 | |
Python | """
The main axes class that can be used to show world coordinates from a WCS.
Parameters
----------
fig : `~matplotlib.figure.Figure`
The figure to add the axes to
rect : list
The position of the axes in the figure in relative units. Should be
given as ``[left, bottom, widt... | InheritDocstrings metaclass doesn't work for properties
Inside the InheritDocstrings metaclass it uses `inspect.isfunction` which returns `False` for properties.
| astropy_26d147868f8a891a6009a25cd6a8576d2e1bd747#WCSAxes | 0 | |
Python | w = _wcs.Wcsprm()
assert w.lng == -1 | units.quantity_input decorator fails for constructors with type hinted return value -> None
### Summary
I am using the `units.quantity_input` decorator with typing hints for constructors, however when I add the correct return value for the constructor (`None`) then I get an exception, because `None` has no attribute `... | astropy_732d89c2940156bdc0e200bb36dc38b5e424bcba#test_lng | 0 | |
Python | fig = plt.figure()
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8],
projection=WCS(self.cube_header),
slices=(50, 'y', 'x'), aspect='equal')
ax.set_xlim(-0.5, 52.5)
ax.set_ylim(-0.5, 106.5)
ax.coords[2].set_ticks(exclude_overlapping=True)
... | units.quantity_input decorator fails for constructors with type hinted return value -> None
### Summary
I am using the `units.quantity_input` decorator with typing hints for constructors, however when I add the correct return value for the constructor (`None`) then I get an exception, because `None` has no attribute `... | astropy_732d89c2940156bdc0e200bb36dc38b5e424bcba#test_minor_ticks | 0 | |
Python | """
Calculate the center position. The center position will be
fractional for even-sized arrays. For ``mode='partial'``, the
central position is calculated for the valid (non-filled) cutout
values.
"""
return tuple(0.5 * (slices[i].start + slices[i].stop - 1)
... | units.quantity_input decorator fails for constructors with type hinted return value -> None
### Summary
I am using the `units.quantity_input` decorator with typing hints for constructors, however when I add the correct return value for the constructor (`None`) then I get an exception, because `None` has no attribute `... | astropy_732d89c2940156bdc0e200bb36dc38b5e424bcba#_calc_center | 0 | |
Python | """Test 2D array with func=np.mean."""
data = np.arange(4).reshape(2, 2)
block_size = 2.
expected = (block_reduce(data, block_size, func=np.sum) /
block_size**2)
result = block_reduce(data, block_size, func=np.mean)
assert np.all(result == expected) | units.quantity_input decorator fails for constructors with type hinted return value -> None
### Summary
I am using the `units.quantity_input` decorator with typing hints for constructors, however when I add the correct return value for the constructor (`None`) then I get an exception, because `None` has no attribute `... | astropy_732d89c2940156bdc0e200bb36dc38b5e424bcba#test_2d_mean | 0 | |
Python | return self.__iter__() | units.quantity_input decorator fails for constructors with type hinted return value -> None
### Summary
I am using the `units.quantity_input` decorator with typing hints for constructors, however when I add the correct return value for the constructor (`None`) then I get an exception, because `None` has no attribute `... | astropy_732d89c2940156bdc0e200bb36dc38b5e424bcba#_ipython_key_completions_ | 0 | |
Python | """
Regression test for issue where wildcards did not work on keywords
containing hyphens.
"""
header = fits.Header([('DATE', 1), ('DATE-OBS', 2), ('DATE-FOO', 3)])
assert len(header['DATE*']) == 3
assert len(header['DATE?*']) == 2
assert len(header['DATE-*']) ==... | units.quantity_input decorator fails for constructors with type hinted return value -> None
### Summary
I am using the `units.quantity_input` decorator with typing hints for constructors, however when I add the correct return value for the constructor (`None`) then I get an exception, because `None` has no attribute `... | astropy_732d89c2940156bdc0e200bb36dc38b5e424bcba#test_wildcard_with_hyphen | 0 | |
Python | if OPTIONS.verbose:
log.setLevel(logging.INFO)
else:
log.setLevel(logging.WARNING)
handler = logging.StreamHandler()
handler.setFormatter(logging.Formatter('%(message)s'))
log.addHandler(handler) | units.quantity_input decorator fails for constructors with type hinted return value -> None
### Summary
I am using the `units.quantity_input` decorator with typing hints for constructors, however when I add the correct return value for the constructor (`None`) then I get an exception, because `None` has no attribute `... | astropy_732d89c2940156bdc0e200bb36dc38b5e424bcba#setup_logging | 0 | |
Python | """Initialize a table reader allowing for common customizations. See ui.get_reader()
for param docs. This routine is for internal (package) use only and is useful
because it depends only on the "core" module.
"""
from .fastbasic import FastBasic
if issubclass(Reader, FastBasic): # Fast readers h... | units.quantity_input decorator fails for constructors with type hinted return value -> None
### Summary
I am using the `units.quantity_input` decorator with typing hints for constructors, however when I add the correct return value for the constructor (`None`) then I get an exception, because `None` has no attribute `... | astropy_732d89c2940156bdc0e200bb36dc38b5e424bcba#_get_reader | 0 | |
Python | return RotateCelestial2Native(self.lon, self.lat, self.lon_pole) | units.quantity_input decorator fails for constructors with type hinted return value -> None
### Summary
I am using the `units.quantity_input` decorator with typing hints for constructors, however when I add the correct return value for the constructor (`None`) then I get an exception, because `None` has no attribute `... | astropy_732d89c2940156bdc0e200bb36dc38b5e424bcba#inverse | 0 | |
Python | """
Make a ``Tabular`` model where ``n_inputs`` is
based on the dimension of the lookup_table.
This model has to be further initialized and when evaluated
returns the interpolated values.
Parameters
----------
dim : int
Dimensions of the lookup table.
name : str
Name fo... | units.quantity_input decorator fails for constructors with type hinted return value -> None
### Summary
I am using the `units.quantity_input` decorator with typing hints for constructors, however when I add the correct return value for the constructor (`None`) then I get an exception, because `None` has no attribute `... | astropy_732d89c2940156bdc0e200bb36dc38b5e424bcba#tabular_model | 0 | |
Python | """
Tests that the signatures for the __init__ and __call__
methods of custom models are useful.
"""
@custom_model
def model_a(x):
return x
assert model_a.param_names == ()
assert model_a.n_inputs == 1
sig = signature(model_a.__init__)
assert list(sig.parameters.keys()) == ... | units.quantity_input decorator fails for constructors with type hinted return value -> None
### Summary
I am using the `units.quantity_input` decorator with typing hints for constructors, however when I add the correct return value for the constructor (`None`) then I get an exception, because `None` has no attribute `... | astropy_732d89c2940156bdc0e200bb36dc38b5e424bcba#test_custom_model_signature | 0 | |
Python | """
Accepts a URL, downloads and optionally caches the result
returning the filename, with a name determined by the file's MD5
hash. If ``cache=True`` and the file is present in the cache, just
returns the filename.
Parameters
----------
remote_url : str
The URL of the file to downl... | units.quantity_input decorator fails for constructors with type hinted return value -> None
### Summary
I am using the `units.quantity_input` decorator with typing hints for constructors, however when I add the correct return value for the constructor (`None`) then I get an exception, because `None` has no attribute `... | astropy_732d89c2940156bdc0e200bb36dc38b5e424bcba#download_file | 0 | |
Python | """
Container for meta information like name, description, format. This is
required when the object is used as a mixin column within a table, but can
be used as a general way to store meta information.
"""
attrs_from_parent = set(['unit']) # unit is read-only and None
attr_names = MixinInfo.at... | units.quantity_input decorator fails for constructors with type hinted return value -> None
### Summary
I am using the `units.quantity_input` decorator with typing hints for constructors, however when I add the correct return value for the constructor (`None`) then I get an exception, because `None` has no attribute `... | astropy_732d89c2940156bdc0e200bb36dc38b5e424bcba#TimeInfo | 0 | |
Python | def __getattribute__(self, name):
return self
def __call__(self, *args, **kwargs):
return self | units.quantity_input decorator fails for constructors with type hinted return value -> None
### Summary
I am using the `units.quantity_input` decorator with typing hints for constructors, however when I add the correct return value for the constructor (`None`) then I get an exception, because `None` has no attribute `... | astropy_732d89c2940156bdc0e200bb36dc38b5e424bcba#NullLogger | 0 | |
Python | """
The ``type`` attribute of the ``RESOURCE`` element must be one of
"results" or "meta".
**References**: `1.1
<http://www.ivoa.net/Documents/VOTable/20040811/REC-VOTable-1.1-20040811.html#ToC54>`__,
`1.2
<http://www.ivoa.net/Documents/VOTable/20091130/REC-VOTable-1.2.html#ToC58>`__
"""
... | units.quantity_input decorator fails for constructors with type hinted return value -> None
### Summary
I am using the `units.quantity_input` decorator with typing hints for constructors, however when I add the correct return value for the constructor (`None`) then I get an exception, because `None` has no attribute `... | astropy_732d89c2940156bdc0e200bb36dc38b5e424bcba#E18 | 0 | |
Python | with get_pkg_data_fileobj(
os.path.join("data", "sip2.fits"), encoding='binary') as test_file:
hdulist = fits.open(test_file, ignore_missing_end=True)
wcs1 = wcs.WCS(hdulist[0].header)
assert wcs1.sip is not None
s = pickle.dumps(wcs1)
wcs2 = pickle.loads(s)
... | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#test_sip2 | 0 | |
Python | if self is other:
return True
try:
other = Unit(other, parse_strict='silent')
except (ValueError, UnitsError, TypeError):
return False
# Other is Unit-like, but the test below requires it is a UnitBase
# instance; if it is not, give up (so that other... | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 | |
Python | return not (self == other) | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__ne__ | 1 | |
Python | raise ValueError(
"The unit {0!r} is unrecognized, so all arithmetic operations "
"with it are invalid.".format(self.name)) | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#_unrecognized_operator | 1 | |
Python | other = Unit(other, parse_strict='silent')
return isinstance(other, UnrecognizedUnit) and self.name == other.name | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 | |
Python | return not (self == other) | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__ne__ | 1 | |
Python | try:
try:
return super().__eq__(other)
except DeprecationWarning:
# We treat the DeprecationWarning separately, since it may
# mask another Exception. But we do not want to just use
# np.equal, since super's __eq__ treats recarrays... | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 | |
Python | try:
try:
return super().__ne__(other)
except DeprecationWarning:
return np.not_equal(self, other)
except UnitsError:
return True
except TypeError:
return NotImplemented | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__ne__ | 1 | |
Python | return (self.physical_unit == getattr(other, 'physical_unit',
dimensionless_unscaled) and
self.function_unit == getattr(other, 'function_unit', other)) | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 | |
Python | return not self.__eq__(other) | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__ne__ | 1 | |
Python | try:
return self._comparison(other, self.value.__eq__)
except UnitsError:
return False | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 | |
Python | try:
return self._comparison(other, self.value.__ne__)
except UnitsError:
return True | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__ne__ | 1 | |
Python | """
If other is an incompatible object for comparison, return `False`.
Otherwise, return `True` if the time difference between self and
other is zero.
"""
return self._time_comparison(other, operator.eq) | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 | |
Python | """
If other is an incompatible object for comparison, return `True`.
Otherwise, return `False` if the time difference between self and
other is zero.
"""
return self._time_comparison(other, operator.ne) | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__ne__ | 1 | |
Python | dt = self.t2 - self.t1
with pytest.raises(TypeError):
self.t1 > dt
dt_gt_td0 = dt > TimeDelta(0., format='sec')
assert np.all(dt_gt_td0 == np.array([False, False, False, False, False,
False, True, True, True, True])) | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#test_timedelta | 0 | |
Python | """Check models give different answers, yet are close."""
for model1, model2 in itertools.combinations(
SIDEREAL_TIME_MODELS[kind].keys(), 2):
gst1 = self.t.sidereal_time(kind, 'greenwich', model1)
gst2 = self.t.sidereal_time(kind, 'greenwich', model2)
assert ... | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#test_model_uniqueness | 0 | |
Python | """
Checks that the input is a CartesianRepresentation with the correct
unit, or the special value ``[0, 0, 0]``.
Parameters
----------
value : object
Input value to be converted.
Returns
-------
out, converted : correctly-typed object, boole... | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#convert_input | 0 | |
Python | if ('galcen_ra' in kwargs or 'galcen_dec' in kwargs):
warnings.warn("The arguments 'galcen_ra', and 'galcen_dec' are "
"deprecated in favor of specifying the sky coordinate"
" as a CoordinateAttribute using the 'galcen_coord' "
"a... | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__init__ | 0 | |
Python | return (isinstance(other, type(self)) and self.wcs == other.wcs
and self.slice == other.slice) | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 | |
Python | return (isinstance(other, type(self)) and self.wcs == other.wcs
and self.slice == other.slice) | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 | |
Python | if isinstance(other, ToBePickled):
return self.item == other.item
else:
return False | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 | |
Python | """
Two Headers are equal only if they have the exact same string
representation.
"""
return str(self) == str(other) | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 | |
Python | if not isiterable(other) or isinstance(other, str):
if len(self) == 1:
other = [other]
else:
return False
for a, b in itertools.zip_longest(self, other):
if a != b:
return False
else:
return True | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 | |
Python | return not (self == other) | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__ne__ | 1 | |
Python | if not other:
return False
if isinstance(other, str):
if not isinstance(other, self.__class__):
try:
other = self.__class__(other)
except ValueError:
return False
else:
return False
retu... | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 | |
Python | """
Two columns are equal if their name and format are the same. Other
attributes aren't taken into account at this time.
"""
# According to the FITS standard column names must be case-insensitive
a = (self.name.lower(), self.format)
b = (other.name.lower(), other.forma... | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 | |
Python | return super(LatexSplitter, self).__call__(lines) | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__call__ | 0 | |
Python | os.chdir(CWD) | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#teardown_function | 0 | |
Python | """Write a table as a fixed width table with no bookend."""
out = StringIO()
ascii.write(dat, out, Writer=ascii.FixedWidthNoHeader,
bookend=False)
assert_equal_splitlines(out.getvalue(), """\
1.2 | "hello" | 1 | a
2.4 | 's worlds | 2 | 2
""") | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#test_write_noheader_no_bookend | 0 | |
Python | if isinstance(other, Table):
other = other.as_array()
if self.masked:
if isinstance(other, np.ma.MaskedArray):
result = self.as_array() == other
else:
# If mask is True, then by definition the row doesn't match
# because the ot... | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 | |
Python | return ~self.__eq__(other) | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__ne__ | 1 | |
Python | if other.__class__ is Node:
return (self.key, self.value) == (other.key, other.value)
return self.key == other | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 | |
Python | if other.__class__ is Node:
return (self.key, self.value) != (other.key, other.value)
return self.key != other | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__ne__ | 1 | |
Python | return False | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 | |
Python | '''
Call np.searchsorted or use a custom binary
search if necessary.
'''
if hasattr(array, 'searchsorted'):
return array.searchsorted(val, side=side)
# Python binary search
begin = 0
end = len(array)
while begin < end:
mid = (begin + end) // 2
if val > array[mid]:... | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#_searchsorted | 0 | |
Python | """Minimal equality testing, mostly for mixin unit tests"""
if isinstance(other, ArrayWrapper):
return self.data == other.data
else:
return self.data == other | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | astropy_3cedd79e6c121910220f8e6df77c54a0b344ea94#__eq__ | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.