Language string | Code string | Query string | URI string | Relevance int64 | Notes string |
|---|---|---|---|---|---|
Python | """
Return an array which, when multiplied by an image, returns that image
mapped to the range of a uint8, [0, 255] (but not converted to uint8).
The intensity is assumed to have had minimum subtracted (as that can be
done per-band).
Parameters
----------
I : nd... | IndexError: tuple index out of range in identify_format (io.registry)
<!-- This comments are hidden when you submit the issue,
so you do not need to remove them! -->
<!-- Please be sure to check out our contributing guidelines,
https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md .
Please be sure to check... | astropy_cdb66059a2feb44ee49021874605ba90801f9986#map_intensity_to_uint8 | 0 | |
Python | wcs = WCS(self.msx_header)
fig = plt.figure(figsize=(5, 3))
fig.add_axes([0.2, 0.2, 0.6, 0.6], projection=wcs, frame_class=EllipticalFrame)
return fig | IndexError: tuple index out of range in identify_format (io.registry)
<!-- This comments are hidden when you submit the issue,
so you do not need to remove them! -->
<!-- Please be sure to check out our contributing guidelines,
https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md .
Please be sure to check... | astropy_cdb66059a2feb44ee49021874605ba90801f9986#test_elliptical_frame | 0 | |
Python | if not HAS_SCIPY and method in ["baluev", "davies"]:
pytest.skip("SciPy required")
t, y, dy, fmax = make_data(N, rseed=543, units=units)
if not use_errs:
dy = None
method_kwds = METHOD_KWDS.get(method, None)
fap = np.logspace(-10, 0, 11)
ls = LombScargle(t, y, dy, normalization=no... | IndexError: tuple index out of range in identify_format (io.registry)
<!-- This comments are hidden when you submit the issue,
so you do not need to remove them! -->
<!-- Please be sure to check out our contributing guidelines,
https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md .
Please be sure to check... | astropy_cdb66059a2feb44ee49021874605ba90801f9986#test_inverses | 0 | |
Python | ndd = NDData(np.ones((5, 5)))
with pytest.raises(TypeError):
ndd + ndd | IndexError: tuple index out of range in identify_format (io.registry)
<!-- This comments are hidden when you submit the issue,
so you do not need to remove them! -->
<!-- Please be sure to check out our contributing guidelines,
https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md .
Please be sure to check... | astropy_cdb66059a2feb44ee49021874605ba90801f9986#test_arithmetic_not_supported | 0 | |
Python | return os.path.join(self.get_dirpath(), "vo.xml") | IndexError: tuple index out of range in identify_format (io.registry)
<!-- This comments are hidden when you submit the issue,
so you do not need to remove them! -->
<!-- Please be sure to check out our contributing guidelines,
https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md .
Please be sure to check... | astropy_cdb66059a2feb44ee49021874605ba90801f9986#get_vo_xml_path | 0 | |
Python | path = self.get_vo_xml_path()
if "network_error" not in self._attributes:
self["network_error"] = None
if os.path.exists(path):
return
def fail(reason):
reason = str(reason)
with open(path, "wb") as fd:
fd.write(f"FAILED: {reason... | IndexError: tuple index out of range in identify_format (io.registry)
<!-- This comments are hidden when you submit the issue,
so you do not need to remove them! -->
<!-- Please be sure to check out our contributing guidelines,
https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md .
Please be sure to check... | astropy_cdb66059a2feb44ee49021874605ba90801f9986#download_xml_content | 0 | |
Python | """Like :meth:`dict.values`."""
for card in self._cards:
yield None if card.value == UNDEFINED else card.value | IndexError: tuple index out of range in identify_format (io.registry)
<!-- This comments are hidden when you submit the issue,
so you do not need to remove them! -->
<!-- Please be sure to check out our contributing guidelines,
https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md .
Please be sure to check... | astropy_cdb66059a2feb44ee49021874605ba90801f9986#values | 0 | |
Python | """
Determine whether `origin` is a FITS file.
Parameters
----------
origin : str or readable file-like
Path or file object containing a potential FITS file.
Returns
-------
is_fits : bool
Returns `True` if the given file is a FITS file.
"""
if fileobj is not None:
... | IndexError: tuple index out of range in identify_format (io.registry)
<!-- This comments are hidden when you submit the issue,
so you do not need to remove them! -->
<!-- Please be sure to check out our contributing guidelines,
https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md .
Please be sure to check... | astropy_cdb66059a2feb44ee49021874605ba90801f9986#is_fits | 1 | |
Python | c1 = fits.Column(
name="var",
format="PJ()",
array=np.array([[45.0, 56], np.array([11, 12, 13])], "O"),
)
c2 = fits.Column(name="xyz", format="2I", array=[[11, 3], [12, 4]])
tbhdu = fits.BinTableHDU.from_columns([c1, c2])
tbhdu.writeto(self.temp("tmp.f... | IndexError: tuple index out of range in identify_format (io.registry)
<!-- This comments are hidden when you submit the issue,
so you do not need to remove them! -->
<!-- Please be sure to check out our contributing guidelines,
https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md .
Please be sure to check... | astropy_cdb66059a2feb44ee49021874605ba90801f9986#test_variable_length_table_data | 0 | |
Python | """Test that long Card keywords are allowed, but with a warning"""
pytest.warns(UserWarning, fits.Card, "abcdefghi", "long") | IndexError: tuple index out of range in identify_format (io.registry)
<!-- This comments are hidden when you submit the issue,
so you do not need to remove them! -->
<!-- Please be sure to check out our contributing guidelines,
https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md .
Please be sure to check... | astropy_cdb66059a2feb44ee49021874605ba90801f9986#test_keyword_too_long | 0 | |
Python | """
Regression test for https://aeon.stsci.edu/ssb/trac/pyfits/ticket/184
Ensures that looking up a RVKC by keyword only (without the
field-specifier) in a header returns the full string value of that card
without parsing it as a RVKC. Also ensures that a full field-specifier
i... | IndexError: tuple index out of range in identify_format (io.registry)
<!-- This comments are hidden when you submit the issue,
so you do not need to remove them! -->
<!-- Please be sure to check out our contributing guidelines,
https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md .
Please be sure to check... | astropy_cdb66059a2feb44ee49021874605ba90801f9986#test_overly_aggressive_rvkc_lookup | 0 | |
Python | hdu = fits.CompImageHDU(np.ones((10, 10)))
hdu._header[kw] = MAX_INT + 1
with pytest.raises(OverflowError):
compress_hdu(hdu) | IndexError: tuple index out of range in identify_format (io.registry)
<!-- This comments are hidden when you submit the issue,
so you do not need to remove them! -->
<!-- Please be sure to check out our contributing guidelines,
https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md .
Please be sure to check... | astropy_cdb66059a2feb44ee49021874605ba90801f9986#test_header_value_int_overflow | 0 | |
Python | """
Check that lists of strings where some strings consist of just a newline
("\n") are parsed correctly.
"""
t = ascii.read(["abc", "123\n", "456\n", "\n", "\n"])
assert t.colnames == ["abc"]
assert len(t) == 2
assert t[0][0] == 123
assert t[1][0] == 456 | IndexError: tuple index out of range in identify_format (io.registry)
<!-- This comments are hidden when you submit the issue,
so you do not need to remove them! -->
<!-- Please be sure to check out our contributing guidelines,
https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md .
Please be sure to check... | astropy_cdb66059a2feb44ee49021874605ba90801f9986#test_list_with_newlines | 0 | |
Python | """Test initialisation with lists, tuples, dicts of arrays
rather than Columns [regression test for #2647]"""
x1 = np.arange(10.0)
x2 = np.arange(5.0)
x3 = np.arange(7.0)
col_list = [("x1", x1), ("x2", x2), ("x3", x3)]
tc_list = TableColumns(col_list)
for col in c... | IndexError: tuple index out of range in identify_format (io.registry)
<!-- This comments are hidden when you submit the issue,
so you do not need to remove them! -->
<!-- Please be sure to check out our contributing guidelines,
https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md .
Please be sure to check... | astropy_cdb66059a2feb44ee49021874605ba90801f9986#test_init | 0 | |
Python | """Requested accuracy."""
return self._acc | IndexError: tuple index out of range in identify_format (io.registry)
<!-- This comments are hidden when you submit the issue,
so you do not need to remove them! -->
<!-- Please be sure to check out our contributing guidelines,
https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md .
Please be sure to check... | astropy_cdb66059a2feb44ee49021874605ba90801f9986#acc | 0 | |
Python | """smoke test for #7020 - fails without fitting.py patch because
weights does not propagate"""
base_fitter = base_fitter()
model = models.Polynomial2D(0)
fitter = FittingWithOutlierRemoval(base_fitter, sigma_clip, niter=3, sigma=3.0)
with pytest.warns(AstropyUserWarning, match=r... | IndexError: tuple index out of range in identify_format (io.registry)
<!-- This comments are hidden when you submit the issue,
so you do not need to remove them! -->
<!-- Please be sure to check out our contributing guidelines,
https://github.com/astropy/astropy/blob/main/CONTRIBUTING.md .
Please be sure to check... | astropy_cdb66059a2feb44ee49021874605ba90801f9986#test_2d_with_weights_with_sigma_clip | 0 | |
Python | self.check(np.tril_indices_from) | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | astropy_7269fa3e33e8d02485a647da91a5a2a60a06af61#test_tril_indices_from | 0 | |
Python | from astropy.units.si import degree, radian
try:
return [get_converter(unit, radian)], degree
except UnitsError:
raise UnitTypeError(
f"Can only apply '{f.__name__}' function to quantities with angle units"
) | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | astropy_7269fa3e33e8d02485a647da91a5a2a60a06af61#helper_radian_to_degree | 0 | |
Python | """
Check precision when jd1 is negative. This used to fail because ERFA
routines use a test like jd1 > jd2 to decide which component to update.
It was updated to abs(jd1) > abs(jd2) in erfa 1.6 (sofa 20190722).
"""
t1 = Time(-100000.123456, format="jd", scale="tt")
assert np.round(t1.jd1) == t... | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | astropy_7269fa3e33e8d02485a647da91a5a2a60a06af61#test_precision_neg | 0 | |
Python | sq1 = SpectralQuantity(1 * u.GHz)
sq2 = _apply_relativistic_doppler_shift(sq1, 0.5 * c)
assert_quantity_allclose(sq2, np.sqrt(1.0 / 3.0) * u.GHz)
# Wavelength
sq3 = SpectralQuantity(500 * u.nm)
sq4 = _apply_relativistic_doppler_shift(sq3, 0.5 * c)
assert_quantity_allclose(sq4, np.sqrt(3) * 500 ... | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | astropy_7269fa3e33e8d02485a647da91a5a2a60a06af61#test_apply_relativistic_doppler_shift | 0 | |
Python | unit = self.get_format_unit() or self.coord_unit
if not unit or unit is u.one or self.coord_type in ("longitude", "latitude"):
return f"{self.default_label}"
else:
return f"{self.default_label} [{unit:latex}]" | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | astropy_7269fa3e33e8d02485a647da91a5a2a60a06af61#_get_default_axislabel | 0 | |
Python | if null is not None and isinstance(null, str):
try:
null_val = self._field.converter.parse_scalar(
null, self._config, self._pos
)[0]
except Exception:
warn_or_raise(W36, W36, null, self._config, self._pos)
null_... | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | astropy_7269fa3e33e8d02485a647da91a5a2a60a06af61#null | 0 | |
Python | """
Whether or not the header has been modified; this is a property so that
it can also check each card for modifications--cards may have been
modified directly without the header containing it otherwise knowing.
"""
modified_cards = any(c._modified for c in self._cards)
... | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | astropy_7269fa3e33e8d02485a647da91a5a2a60a06af61#_modified | 0 | |
Python | """
Similar to :meth:`dict.fromkeys`--creates a new `Header` from an
iterable of keywords and an optional default value.
This method is not likely to be particularly useful for creating real
world FITS headers, but it is useful for testing.
Parameters
----------
... | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | astropy_7269fa3e33e8d02485a647da91a5a2a60a06af61#fromkeys | 0 | |
Python | return [fmt.recformat for fmt in self.formats] | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | astropy_7269fa3e33e8d02485a647da91a5a2a60a06af61#_recformats | 0 | |
Python | if self._scale_back:
self.scale(BITPIX2DTYPE[self._orig_bitpix])
if self._has_data:
self._update_compressed_data()
# Use methods in the superclass to update the header with
# scale/checksum keywords based on the data type of the image data
self._upda... | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | astropy_7269fa3e33e8d02485a647da91a5a2a60a06af61#_prewriteto | 0 | |
Python | """Interpret a QDP file line.
Parameters
----------
line : str
a single line of the file
Returns
-------
type : str
Line type: "comment", "command", or "data"
Examples
--------
>>> _line_type("READ SERR 3")
'command'
>>> _line_type(" \\n !some gibberish"... | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | astropy_7269fa3e33e8d02485a647da91a5a2a60a06af61#_line_type | 1 | |
Python | """Get all tables from a QDP file.
Parameters
----------
qdp_file : str
Input QDP file name
Other Parameters
----------------
input_colnames : list of str
Name of data columns (defaults to ['col1', 'col2', ...]), _not_
including error columns.
delimiter : str
... | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | astropy_7269fa3e33e8d02485a647da91a5a2a60a06af61#_get_tables_from_qdp_file | 1 | |
Python | """
This should return an OptionalTableImportError if BeautifulSoup
is not installed.
"""
inputter = html.HTMLInputter()
with pytest.raises(core.OptionalTableImportError):
inputter.process_lines([]) | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | astropy_7269fa3e33e8d02485a647da91a5a2a60a06af61#test_htmlinputter_no_bs4 | 0 | |
Python | fn, c = a_binary_file
with get_readable_fileobj(fn, encoding="binary") as rf:
assert rf.read() == c | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | astropy_7269fa3e33e8d02485a647da91a5a2a60a06af61#test_get_fileobj_binary | 0 | |
Python | header = fits.header.Header()
header.set("observer", "Edwin Hubble")
header.set("exptime", "3600")
d = self.test_class(*self.args, meta=header)
assert d.meta["OBSERVER"] == "Edwin Hubble" | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | astropy_7269fa3e33e8d02485a647da91a5a2a60a06af61#test_meta_fits_header | 0 | |
Python | """
Configuration parameters for `astropy.table`.
"""
use_fast_parser = _config.ConfigItem(
["True", "False", "force"],
"Use fast C parser for supported time strings formats, including ISO, "
"ISOT, and YearDayTime. Allowed values are the 'False' (use Python parser),"
"'True... | ascii.qdp Table format assumes QDP commands are upper case
### Description
ascii.qdp assumes that commands in a QDP file are upper case, for example, for errors they must be "READ SERR 1 2" whereas QDP itself is not case sensitive and case use "read serr 1 2".
As many QDP files are created by hand, the expectation... | astropy_7269fa3e33e8d02485a647da91a5a2a60a06af61#Conf | 0 | |
Python | if value is None:
self._pixel_bounds = value
else:
if len(value) != self.naxis:
raise ValueError(
"The number of data axes, "
f"{self.naxis}, does not equal the number of "
f"pixel bounds {len(value)}."
... | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#pixel_bounds | 0 | |
Python | if _error_check:
for base in bases:
if not isinstance(base, UnitBase):
raise TypeError("bases must be sequence of UnitBase instances")
powers = [validate_power(p) for p in powers]
if not decompose and len(bases) == 1 and powers[0] >= 0:
# ... | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#__init__ | 0 | |
Python | self.q = np.arange(9.0).reshape(3, 3) / 4.0 * u.m | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#setup_method | 0 | |
Python | inv = np.linalg.inv(self.q)
expected = np.linalg.inv(self.q.value) / self.q.unit
assert_array_equal(inv, expected) | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#test_inv | 0 | |
Python | """
The grammar here is based on the description in the `Standards
for Astronomical Catalogues 2.0
<http://vizier.u-strasbg.fr/vizier/doc/catstd-3.2.htx>`_, which is not
terribly precise. The exact grammar is here is based on the
YACC grammar in the `unity library
<https... | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#_make_parser | 1 | |
Python | """
The grammar here is based on the description in the `FITS
standard
<http://fits.gsfc.nasa.gov/standard30/fits_standard30aa.pdf>`_,
Section 4.3, which is not terribly precise. The exact grammar
is here is based on the YACC grammar in the `unity library
<https://bitbuc... | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#_make_parser | 1 | |
Python | """
The grammar here is based on the description in the
`Specification of Physical Units within OGIP FITS files
<https://heasarc.gsfc.nasa.gov/docs/heasarc/ofwg/docs/general/ogip_93_001/>`__,
which is not terribly precise. The exact grammar is here is
based on the YACC grammar i... | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#_make_parser | 1 | |
Python | if value is None or isinstance(value, (float, int)):
self._x_min = value
else:
raise ValueError(f"x_min is expected to be a real number. Got {value}.") | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#x_min | 0 | |
Python | """
The elevation of the point(s).
"""
return self._theta | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#theta | 0 | |
Python | tokens = (
"SIGN",
"UINT",
"UFLOAT",
"COLON",
"DEGREE",
"HOUR",
"MINUTE",
"SECOND",
"SIMPLE_UNIT",
"EASTWEST",
"NORTHSOUTH",
)
# NOTE THE ORDERING OF THESE RULES IS IMPORT... | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#_make_parser | 1 | |
Python | try:
# https://github.com/matplotlib/matplotlib/pull/13005
from matplotlib.units import ConversionError
except ImportError:
err_type = u.UnitConversionError
else:
err_type = ConversionError
plt.figure()
with quantity_support():
plt.plot([1, 2, 3] * u.m)
... | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#test_incompatible_units | 0 | |
Python | """
Check that the supplied value is a string.
You can optionally specify the minimum and maximum number of members.
>>> vtor.check('string', '0')
'0'
>>> vtor.check('string', 0)
Traceback (most recent call last):
VdtTypeError: the value "0" is of the wrong type.
>>> vtor.check('string... | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#is_string | 0 | |
Python | if np.any(mask):
vo_warn(W39)
return bool_to_bitarray(value) | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#binoutput | 0 | |
Python | compression_type, param, dtype = comp_param_dtype
original_data = base_original_data.astype(dtype)
tmp_path = tmp_path_factory.mktemp("astropy")
filename = tmp_path / f"{compression_type}_{dtype}.fits"
param = fitsio_param_to_astropy_param(param)
hdu = fits.CompImageHDU(
data=original_data... | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#astropy_compressed_file_path | 0 | |
Python | init_model = Polynomial2D(
degree=2,
c1_0=[1, 2],
c0_1=[-0.5, 1],
n_models=2,
fixed={"c1_0": True, "c0_1": True},
)
x, y = np.mgrid[0:5, 0:5]
zz = np.array([1 + x - 0.5 * y + 0.1 * x * x, 2 * x + y - 0.2 * y * y])
fitter = LinearLSQFitter()
weights = [np.one... | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#test_linear_fit_2d_model_set_weights | 0 | |
Python | r"""
Polyconic projection - sky to pixel.
Corresponds to the ``PCO`` projection in FITS WCS.
""" | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#Sky2Pix_Polyconic | 0 | |
Python | f = Parameter(default=3, fixed=True)
x = Parameter(default=10)
y = Parameter(default=12)
h = Parameter(default=5)
def __init__(self, f=f.default, x=x.default, y=y.default, h=h.default):
super().__init__(f, x, y)
def evaluate(self):
pass | Incorrect units read from MRT (CDS format) files with astropy.table
### Description
When reading MRT files (formatted according to the CDS standard which is also the format recommended by AAS/ApJ) with `format='ascii.cds'`, astropy.table incorrectly parses composite units. According to CDS standard the units should be... | astropy_fa4e8d1cd279acf9b24560813c8652494ccd5922#subclassmodel | 0 | |
Python | """Get an allowed subfmt for this class, either the input ``subfmt``
if this is valid or '*' as a default. This method gets used in situations
where the format of an existing Time object is changing and so the
out_ or in_subfmt may need to be coerced to the default '*' if that
``subfmt`... | `io.fits.Card` may use a string representation of floats that is larger than necessary
### Description
In some scenarios, `io.fits.Card` may use a string representation of floats that is larger than necessary, which can force comments to be truncated. Due to this, there are some keyword/value/comment combinations that... | astropy_a3f4ae6cd24d5ecdf49f213d77b3513dd509a06c#_get_allowed_subfmt | 0 | |
Python | """Upper limit on a poisson count rate.
The implementation is based on Kraft, Burrows and Nousek
`ApJ 374, 344 (1991) <https://ui.adsabs.harvard.edu/abs/1991ApJ...374..344K>`_.
The XMM-Newton upper limit server uses the same formalism.
Parameters
----------
N : int or np.int32/np.int64
... | `io.fits.Card` may use a string representation of floats that is larger than necessary
### Description
In some scenarios, `io.fits.Card` may use a string representation of floats that is larger than necessary, which can force comments to be truncated. Due to this, there are some keyword/value/comment combinations that... | astropy_a3f4ae6cd24d5ecdf49f213d77b3513dd509a06c#_scipy_kraft_burrows_nousek | 0 | |
Python | with NumpyRNGContext(12345):
# test that it runs
randvar = np.random.randn(10000)
mad = funcs.median_absolute_deviation(randvar)
# test whether an array is returned if an axis is used
randvar = randvar.reshape((10, 1000))
mad = funcs.median_absolute_deviation(randvar, ax... | `io.fits.Card` may use a string representation of floats that is larger than necessary
### Description
In some scenarios, `io.fits.Card` may use a string representation of floats that is larger than necessary, which can force comments to be truncated. Due to this, there are some keyword/value/comment combinations that... | astropy_a3f4ae6cd24d5ecdf49f213d77b3513dd509a06c#test_median_absolute_deviation | 0 | |
Python | out = {}
repr_or_diff_cls = self.get_representation_cls(which)
if repr_or_diff_cls is None:
return out
data_names = repr_or_diff_cls.attr_classes.keys()
repr_names = self.representation_info[repr_or_diff_cls]["names"]
for repr_name, data_name in zip(repr_names, data_n... | `io.fits.Card` may use a string representation of floats that is larger than necessary
### Description
In some scenarios, `io.fits.Card` may use a string representation of floats that is larger than necessary, which can force comments to be truncated. Due to this, there are some keyword/value/comment combinations that... | astropy_a3f4ae6cd24d5ecdf49f213d77b3513dd509a06c#get_representation_component_names | 0 | |
Python | """
Apply transformations to arguments to ``plot_coord`` and
``scatter_coord``.
"""
if isinstance(args[0], (SkyCoord, BaseCoordinateFrame)):
# Extract the frame from the first argument.
frame0 = args[0]
if isinstance(frame0, SkyCoord):
... | `io.fits.Card` may use a string representation of floats that is larger than necessary
### Description
In some scenarios, `io.fits.Card` may use a string representation of floats that is larger than necessary, which can force comments to be truncated. Due to this, there are some keyword/value/comment combinations that... | astropy_a3f4ae6cd24d5ecdf49f213d77b3513dd509a06c#_transform_plot_args | 0 | |
Python | for p in self.Productions:
lastlri = p
i = 0
lr_items = []
while True:
if i > len(p):
lri = None
else:
lri = LRItem(p, i)
# Precompute the list of productions immediately following... | `io.fits.Card` may use a string representation of floats that is larger than necessary
### Description
In some scenarios, `io.fits.Card` may use a string representation of floats that is larger than necessary, which can force comments to be truncated. Due to this, there are some keyword/value/comment combinations that... | astropy_a3f4ae6cd24d5ecdf49f213d77b3513dd509a06c#build_lritems | 0 | |
Python | tree = {"angle": Latitude(10, u.deg)}
assert_roundtrip_tree(tree, tmpdir) | `io.fits.Card` may use a string representation of floats that is larger than necessary
### Description
In some scenarios, `io.fits.Card` may use a string representation of floats that is larger than necessary, which can force comments to be truncated. Due to this, there are some keyword/value/comment combinations that... | astropy_a3f4ae6cd24d5ecdf49f213d77b3513dd509a06c#test_latitude | 0 | |
Python | float_types = (float, np.floating, complex, np.complexfloating)
# Force the value to be parsed out first
value = self.value
# But work with the underlying raw value instead (to preserve
# whitespace, for now...)
value = self._value
if self.keyword in self._commentary_ke... | `io.fits.Card` may use a string representation of floats that is larger than necessary
### Description
In some scenarios, `io.fits.Card` may use a string representation of floats that is larger than necessary, which can force comments to be truncated. Due to this, there are some keyword/value/comment combinations that... | astropy_a3f4ae6cd24d5ecdf49f213d77b3513dd509a06c#_format_value | 1 | |
Python | """
Converts a card value to its appropriate string representation as
defined by the FITS format.
"""
# string value should occupies at least 8 columns, unless it is
# a null string
if isinstance(value, str):
if value == "":
return "''"
else:
exp_val_str =... | `io.fits.Card` may use a string representation of floats that is larger than necessary
### Description
In some scenarios, `io.fits.Card` may use a string representation of floats that is larger than necessary, which can force comments to be truncated. Due to this, there are some keyword/value/comment combinations that... | astropy_a3f4ae6cd24d5ecdf49f213d77b3513dd509a06c#_format_value | 1 | |
Python | """Format a floating number to make sure it gets the decimal point."""
value_str = f"{value:.16G}"
if "." not in value_str and "E" not in value_str:
value_str += ".0"
elif "E" in value_str:
# On some Windows builds of Python (and possibly other platforms?) the
# exponent is zero-padd... | `io.fits.Card` may use a string representation of floats that is larger than necessary
### Description
In some scenarios, `io.fits.Card` may use a string representation of floats that is larger than necessary, which can force comments to be truncated. Due to this, there are some keyword/value/comment combinations that... | astropy_a3f4ae6cd24d5ecdf49f213d77b3513dd509a06c#_format_float | 1 | |
Python | from astropy.io.fits.scripts import fitsheader
hf = fitsheader.HeaderFormatter(self.data("zerowidth.fits"))
hf.close()
thf = fitsheader.TableHeaderFormatter(self.data("zerowidth.fits"))
thf.close() | `io.fits.Card` may use a string representation of floats that is larger than necessary
### Description
In some scenarios, `io.fits.Card` may use a string representation of floats that is larger than necessary, which can force comments to be truncated. Due to this, there are some keyword/value/comment combinations that... | astropy_a3f4ae6cd24d5ecdf49f213d77b3513dd509a06c#test_header_formatter | 0 | |
Python | axes = tuple(self.data.shape)
return (self.name, self.ver, "NonstandardExtHDU", len(self._header), axes) | `io.fits.Card` may use a string representation of floats that is larger than necessary
### Description
In some scenarios, `io.fits.Card` may use a string representation of floats that is larger than necessary, which can force comments to be truncated. Due to this, there are some keyword/value/comment combinations that... | astropy_a3f4ae6cd24d5ecdf49f213d77b3513dd509a06c#_summary | 0 | |
Python | return f"Interval(lower={self.lower}, upper={self.upper})" | `io.fits.Card` may use a string representation of floats that is larger than necessary
### Description
In some scenarios, `io.fits.Card` may use a string representation of floats that is larger than necessary, which can force comments to be truncated. Due to this, there are some keyword/value/comment combinations that... | astropy_a3f4ae6cd24d5ecdf49f213d77b3513dd509a06c#__repr__ | 0 | |
Python | pass | `io.fits.Card` may use a string representation of floats that is larger than necessary
### Description
In some scenarios, `io.fits.Card` may use a string representation of floats that is larger than necessary, which can force comments to be truncated. Due to this, there are some keyword/value/comment combinations that... | astropy_a3f4ae6cd24d5ecdf49f213d77b3513dd509a06c#TableMergeError | 0 | |
Python | r"""
Bivariate Hermite series.
It is defined as
.. math:: P_{nm}(x,y) = \sum_{n,m=0}^{n=d,m=d}C_{nm} H_n(x) H_m(y)
where ``H_n(x)`` and ``H_m(y)`` are Hermite polynomials.
For explanation of ``x_domain``, ``y_domain``, ``x_window`` and ``y_window``
see :ref:`Notes regarding usage of domain a... | `io.fits.Card` may use a string representation of floats that is larger than necessary
### Description
In some scenarios, `io.fits.Card` may use a string representation of floats that is larger than necessary, which can force comments to be truncated. Due to this, there are some keyword/value/comment combinations that... | astropy_a3f4ae6cd24d5ecdf49f213d77b3513dd509a06c#Hermite2D | 0 | |
Python | """
Write out `distortion paper`_ keywords to the given
`~astropy.io.fits.HDUList`.
"""
if self.cpdis1 is None and self.cpdis2 is None:
return
if dist == "CPDIS":
d_kw = "DP"
else:
d_kw = "DQ"
def write_dist(num, cpdis):
... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#_write_distortion_kw | 0 | |
Python | """Lookback time to redshift ``z``. Value in units of Hubble time.
The lookback time is the difference between the age of the Universe now
and the age at redshift ``z``.
Parameters
----------
z : Quantity-like ['redshift'], array-like, or `~numbers.Number`
Input red... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#_integral_lookback_time | 0 | |
Python | """Return the |Cosmology| unchanged.
Parameters
----------
cosmo : `~astropy.cosmology.Cosmology`
The cosmology to return.
*args
Not used.
Returns
-------
`~astropy.cosmology.Cosmology` subclass instance
Just ``cosmo`` passed through.
"""
return cosmo | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#to_cosmology | 0 | |
Python | if _error_check:
for base in bases:
if not isinstance(base, UnitBase):
raise TypeError("bases must be sequence of UnitBase instances")
powers = [validate_power(p) for p in powers]
if not decompose and len(bases) == 1 and powers[0] >= 0:
# ... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#__init__ | 0 | |
Python | return len(self._dataiter) | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#__len__ | 0 | |
Python | with pytest.raises(TypeError, match="raise something to a dimensionless"):
np.power(3.0, 4.0 * u.m) | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#test_power_invalid | 0 | |
Python | """Calculate a local sidereal time or Earth rotation angle.
Parameters
----------
longitude : `~astropy.units.Quantity`, `~astropy.coordinates.EarthLocation`, str, or None; optional
The longitude on the Earth at which to compute the Earth rotation
angle (taken from a loc... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#_sid_time_or_earth_rot_ang | 0 | |
Python | """Original dir() behavior, plus frame attributes and transforms.
This dir includes:
- All attributes of the SkyCoord class
- Coordinate transforms available by aliases
- Attribute / methods of the underlying self.frame objects
"""
dir_values = set(super().__dir__())
... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#__dir__ | 0 | |
Python | self._setup(omit_coslat)
if omit_coslat:
assert self.USD_cls is UnitSphericalCosLatDifferential
assert self.USD_cls.get_name() == "unitsphericalcoslat"
else:
assert self.USD_cls is UnitSphericalDifferential
assert self.USD_cls.get_name() == "unitspherical"... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#test_name_coslat | 0 | |
Python | """
Check that we still get a proper motion even for SkyCoords without distance
"""
c = SkyCoord(
l=10 * u.degree,
b=45 * u.degree,
pm_l_cosb=34 * u.mas / u.yr,
pm_b=-117 * u.mas / u.yr,
frame="galactic",
obstime=Time("1988-12-18 05:11:23.5"),
)
with ... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#test_regression_10092 | 0 | |
Python | """
The bounding box ``((ymin, ymax), (xmin, xmax))`` of the minimal
rectangular region of the cutout array with respect to the
cutout array. For ``mode='partial'``, the bounding box indices
are for the valid (non-filled) cutout values.
"""
return self._calc_bbox(self.sl... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#bbox_cutout | 0 | |
Python | tbl = Table(np.ones(10).reshape(5, 2))
img = np.ones((5, 5))
hdul = fits.HDUList(
hdus=[fits.PrimaryHDU(), fits.TableHDU(tbl.as_array()), fits.ImageHDU(img)]
)
filename = str(tmp_path / "table_image.fits")
hdul.writeto(filename)
ccd = CCDData.read(filename, unit="adu")
# Expecting to... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#test_read_returns_image | 0 | |
Python | if isinstance(node, Quantity):
return node
unit = node["unit"]
value = node["value"]
if isinstance(value, NDArrayType):
value = value._make_array()
return Quantity(value, unit=unit) | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#from_tree | 0 | |
Python | return powerlaws.LogParabola1D(
amplitude=node["amplitude"],
x_0=node["x_0"],
alpha=node["alpha"],
beta=node["beta"],
) | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#from_tree_transform | 0 | |
Python | """Returns the equivalent Numpy record format string."""
return _convert_ascii_format(self) | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#recformat | 0 | |
Python | raise NotImplementedError | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#_diff | 1 | |
Python | if len(self.a) != len(self.b):
self.diff_hdu_count = (len(self.a), len(self.b))
# Record filenames for use later in _report
self.filenamea = self.a.filename()
if not self.filenamea:
self.filenamea = f"<{self.a.__class__.__name__} object at {id(self.a):#x}>"
self... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#_diff | 1 | |
Python | if self.a.name != self.b.name:
self.diff_extnames = (self.a.name, self.b.name)
if self.a.ver != self.b.ver:
self.diff_extvers = (self.a.ver, self.b.ver)
if self.a.level != self.b.level:
self.diff_extlevels = (self.a.level, self.b.level)
if self.a.header.get... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#_diff | 1 | |
Python | if self.ignore_blank_cards:
cardsa = [c for c in self.a.cards if str(c) != BLANK_CARD]
cardsb = [c for c in self.b.cards if str(c) != BLANK_CARD]
else:
cardsa = list(self.a.cards)
cardsb = list(self.b.cards)
# build dictionaries of keyword values and comm... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#_diff | 1 | |
Python | if self.a.shape != self.b.shape:
self.diff_dimensions = (self.a.shape, self.b.shape)
# Don't do any further comparison if the dimensions differ
# TODO: Perhaps we could, however, diff just the intersection
# between the two images
return
# Find the in... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#_diff | 1 | |
Python | super()._diff()
if self.diff_dimensions:
self.diff_dimensions = (
self.diff_dimensions[0][0],
self.diff_dimensions[1][0],
)
self.diff_bytes = [(x[0], y) for x, y in self.diff_pixels]
del self.diff_pixels | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#_diff | 1 | |
Python | colsa = self.a.columns
colsb = self.b.columns
if len(colsa) != len(colsb):
self.diff_column_count = (len(colsa), len(colsb))
# Even if the number of columns are unequal, we still do comparison of
# any common columns
colsa = {c.name.lower(): c for c in colsa}
... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#_diff | 1 | |
Python | if self.data.start_line == "guess":
# Replicate the first part of BaseReader.read up to the point where
# the table lines are initially read in.
with suppress(TypeError):
# For strings only
if os.linesep not in table + "":
self.data... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#read | 0 | |
Python | """
Use a fast Cython method to write table data to output,
where output is a filename or file-like object.
"""
self._write(table, output, {}) | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#write | 0 | |
Python | """compare array column by column with expectation"""
assert not hasattr(data["a"], "mask")
assert_true((data["a"] == ["1", "a"]).all())
assert_true((data["b"].mask == [False, True]).all())
# Check that masked value is "do not care" in comparison
assert_true((data["b"] == [2, -999]).all())
data[... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#check_fill_values | 0 | |
Python | """
Test reading a table and renaming cols
"""
table_in = [
"<table>",
"<tr><th>A</th> <th>B</th></tr>",
"<tr><td>1</td><td>2</td></tr>",
"</table>",
]
# Swap column names
dat = Table.read(table_in, format="ascii.html", names=["B", "A"])
assert dat.colnames =... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#test_rename_cols | 0 | |
Python | if isinstance(param, str):
i = self.param_names.index(param)
elif isinstance(param, int):
i = param
else:
raise TypeError(
"Standard deviation can be indexed by parameter name or integer."
)
return self.stds[i] | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#__getitem__ | 0 | |
Python | if self.x_0.unit is None and self.y_0.unit is None:
return None
return {self.inputs[0]: self.x_0.unit, self.inputs[1]: self.y_0.unit} | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#input_units | 0 | |
Python | intervals = {0: _Interval(-1, 1)}
model = Gaussian1D()
bounding_box = ModelBoundingBox.validate(model, intervals)
assert len(bounding_box) == 1 == len(bounding_box._intervals)
intervals = {0: _Interval(-1, 1), 1: _Interval(-4, 4)}
model = Gaussian2D()
bounding_box = Mode... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#test___len__ | 0 | |
Python | descriptors = defaultdict(list)
seen = set()
inherit_descriptors = ()
descr_bases = {}
for mro_cls in cls.__mro__:
for name, obj in mro_cls.__dict__.items():
if name in seen:
# Checks if we've already seen an attribute of the given
... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#__init__ | 0 | |
Python | from astropy.utils.masked import Masked
if not args:
return condition.nonzero(), None, None
condition, c_mask = Masked._get_data_and_mask(condition)
data, masks = _get_data_and_masks(*args)
unmasked = np.where(condition, *data)
mask = np.where(condition, *masks)
if c_mask is not None:... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#where | 0 | |
Python | str(self.ma)
str(self.mb)
str(self.mc)
str(self.msa)
str(self.msb)
str(self.msc) | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#test_array_str | 0 | |
Python | """Create a table from a file like the IERS ``Leap_Second.dat``.
Parameters
----------
file : path-like, optional
Full local or network path to the file holding leap-second data
in a format consistent with that used by IERS. By default, uses
``iers.IERS_LEAP... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#from_iers_leap_seconds | 0 | |
Python | """Test Quantity[Unit] type annotation."""
def test_simple_annotation(self):
@u.quantity_input
def func(x: Quantity[u.m], y: str):
return x, y
i_q, i_str = 2 * u.m, "cool string"
o_q, o_str = func(i_q, i_str)
assert i_q == o_q
assert i_str == o_str
... | `io.fits.FITSDiff` may sometimes report differences between identical files
### Description
In some scenarios, `io.fits.FITSDiff` may report differences between identical files, even when comparing the same file to itself. This may be caused by improper handling of VLAs (variable-length arrays).
### Expected behavior... | astropy_c0a24c1dc957a3b565294213f435fefb2ec99714#TestQuantityUnitAnnotations | 0 | |
Python | q1 = np.arange(9.0).reshape(3, 3) * u.m
o = np.count_nonzero(q1)
assert type(o) is not u.Quantity
assert o == 8
o = np.count_nonzero(q1, axis=1)
# Returns integer Quantity with units of m
assert type(o) is np.ndarray
assert np.all(o == np.array([2, 3, 3])) | 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_count_nonzero | 0 | |
Python | a = u.nm.to(u.J, 500, u.spectral())
assert_allclose(a, 3.972891366538605e-19)
b = u.J.to(u.nm, a, u.spectral())
assert_allclose(b, 500)
a = u.AA.to(u.Hz, 1, u.spectral())
b = u.Hz.to(u.J, a, u.spectral())
c = u.AA.to(u.J, 1, u.spectral())
assert_allclose(b, c)
c = u.J.to(u.Hz, b, u.spe... | 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_spectral2 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.