id
stringlengths
32
49
content
stringlengths
777
333k
swe-bench_data_pydicom__pydicom-863
Wrong encoding occurs if the value 1 of SpecificCharacterSets is ISO 2022 IR 13. <!-- Instructions For Filing a Bug: https://github.com/pydicom/pydicom/blob/master/CONTRIBUTING.md#filing-bugs --> #### Description All Japanese characters are encoded into shift_jis if the value 1 of SpecificCharacterSets (0x0008, 0x0...
swe-bench_data_pydicom__pydicom-1694
Dataset.to_json_dict can still generate exceptions when suppress_invalid_tags=True **Describe the bug** I'm using `Dataset.to_json_dict(suppress_invalid_tags=True)` and can live with losing invalid tags. Unfortunately, I can still trigger an exception with something like `2.0` in an `IS` field. **Expected behavio...
swe-bench_data_pydicom__pydicom-1562
Revise the type annotation for pydicom.datadict.dictionary_has_tag() **Describe the bug** The documentation of [`pydicom.datadict.dictionary_has_tag()`](https://pydicom.github.io/pydicom/dev/reference/generated/pydicom.datadict.dictionary_has_tag.html#pydicom.datadict.dictionary_has_tag) suggests that a query using ...
swe-bench_data_pydicom__pydicom-1413
Error : a bytes-like object is required, not 'MultiValue' Hello, I am getting following error while updating the tag LongTrianglePointIndexList (0066,0040), **TypeError: a bytes-like object is required, not 'MultiValue'** I noticed that the error gets produced only when the VR is given as "OL" , works fine with...
swe-bench_data_pydicom__pydicom-1090
Write deflated content when called Transfer Syntax is Deflated Explicit VR Little Endian **Describe the bug** After using `dcmread` to read a deflated .dcm file created from pydicom's [CT_small.dcm sample](https://github.com/pydicom/pydicom/blob/v1.4.2/pydicom/data/test_files/CT_small.dcm), with the following file met...
swe-bench_data_pydicom__pydicom-800
The function generate_uid() generates non-conforming “2.25 .” DICOM UIDs <!-- Instructions For Filing a Bug: https://github.com/pydicom/pydicom/blob/master/CONTRIBUTING.md#filing-bugs --> #### Description It seems there was already a discussion about this function in the past (#125), but the current implementation ...
swe-bench_data_pydicom__pydicom-938
[python 3.8] failing tests: various issues but "max recursion depth reached" seems to be one #### Description Fedora is beginning to test python packages against python 3.8. Pydicom builds but tests fail with errors. #### Steps/Code to Reproduce ``` python setup.py build python setup.py install pytest ``` ...
swe-bench_data_pydicom__pydicom-1194
Error decoding dataset with ambiguous VR element when the value is None Hi all, I used the storescu in pynetdicom 1.5.3 to send the dicom ct files(both on mac and ubuntu): **python storescu.py 192.168.1.120 9002 ~/Downloads/test/** (I also tried https://pydicom.github.io/pynetdicom/stable/examples/storage.html#...
swe-bench_data_pydicom__pydicom-997
Generators in encaps don't handle single fragment per frame correctly with no BOT value #### Description Generators in `encaps.py` handling of encapsulated pixel data incorrect when the Basic Offset Table has no value and each frame is a single fragment. #### Steps/Code to Reproduce ```python from pydicom import ...
swe-bench_data_pydicom__pydicom-811
0 byte file causes traceback on dcmreader <!-- Instructions For Filing a Bug: https://github.com/pydicom/pydicom/blob/master/CONTRIBUTING.md#filing-bugs --> #### Description Trying to open a 0 byte file with dcmreader causes a traceback originating in the read_partial method. The problem is line 692 in filereader.p...
swe-bench_data_pydicom__pydicom-1539
pydicom produces invalid DICOM files if ds.EncapsulatedDocument contains byte array of odd length **Bug Description** When inserting a byte array of odd length into the ds.EncapsulatedDocument field, and saving this as a DICOM file, the DICOM file produced is not valid. This happens because the resulting file produced...
swe-bench_data_pydicom__pydicom-901
pydicom should not define handler, formatter and log level. The `config` module (imported when pydicom is imported) defines a handler and set the log level for the pydicom logger. This should not be the case IMO. It should be the responsibility of the client code of pydicom to configure the logging module to its conven...
swe-bench_data_pydicom__pydicom-1598
KeyError when saving a FileSet **Describe the bug** Saving a fileset that was loaded using DICOMDIR returns a Key Error. **Expected behavior** Fileset is saved without error **Steps To Reproduce** Code: ```python from pydicom.fileset import FileSet fpath="DICOMDIR" data=FileSet(fpath) print(data) d...
swe-bench_data_pydicom__pydicom-1139
Make PersonName3 iterable ```python from pydicom import Dataset ds = Dataset() ds.PatientName = 'SomeName' 'S' in ds.PatientName ``` ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: argument of type 'PersonName3' is not iterable ``` I'm not really sure if this is ...
swe-bench_data_pydicom__pydicom-793
Print byte values for unknown VR during read #### Description If the dataset read fails due to an unknown VR then the exception message prints the VR bytes in a format that isn't useful for debugging. #### Steps/Code to Reproduce ```python from io import BytesIO from pydicom.filereader import read_dataset ds = ...
swe-bench_data_pydicom__pydicom-1192
"TypeError: 'NoneType' object is not subscriptable" when reading dcm file with empty string as Chartset and "use_none_as_empty_text_VR_value=True" **Describe the bug** Once thing I noticed is that `convert_encodings` in `charset.py` expects a list of encodings (according to the docstrings) from tag `0008,0005` but it ...
swe-bench_data_pydicom__pydicom-1236
apply_voi_lut - unclear what it does if both WL/VOILUTFunction _and_ VOILUTSequence are present https://pydicom.github.io/pydicom/dev/reference/generated/pydicom.pixel_data_handlers.util.html#pydicom.pixel_data_handlers.util.apply_voi_lut Hi all, I'm working with some mammo image (digital) that have both - wind...
swe-bench_data_pydicom__pydicom-955
LUT Descriptor values don't follow standard **Describe the bug** (0028,3002) [LUT Descriptor](http://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.11.html#sect_C.11.1.1) has VM = 3, with value as `[number of entries in LUT, first stored pixel value mapped, LUT entry bit depth]`. The VR for the elemen...
swe-bench_data_pydicom__pydicom-1031
Crash writing DICOM with 1.4.0 pydicom 1.4.0 Windows-10-10.0.18362-SP0 Python 3.7.4 (tags/v3.7.4:e09359112e, Jul 8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] GDCM 3.0.2 Pillow 7.0.0 Type error raises when writing file with pydicom 1.4.0, works in 1.3.0. ``` ds = pydicom.read_file('fail2404.anon.dcm') #pr...
swe-bench_data_pydicom__pydicom-1555
Converting Dicom image to Png **Describe the issue** hi, i am trying to convert Dicom image to png but in case of some particular file i am getting this "list out of range error". **Expected behavior** dicom image converted to png pne **Steps To Reproduce** How to reproduce the issue. Please include: 1. A min...
swe-bench_data_pydicom__pydicom-809
"Printing" of certain dicom files fails once, but works the second time <!-- Instructions For Filing a Bug: https://github.com/pydicom/pydicom/blob/master/CONTRIBUTING.md#filing-bugs --> #### Description "Printing" of certain dicom files (see [example](https://github.com/pydicom/pydicom/files/2865551/dicom_exceptio...
swe-bench_data_pydicom__pydicom-933
Deferred Read Fails For File-Like Objects #### Description Deferred reads are failing when dcmread is passed a file-like object (instead of a filepath). There are two old issues from 2014 which describe the same issue which were apparently fixed, but I'm still seeing it on v1.3: https://github.com/pydicom/pydicom/is...
swe-bench_data_pydicom__pydicom-1633
OverflowError "VR of 'DS' must be <= 16 characters long" triggered when element is 16 characters long **Describe the bug** `OverflowError` triggered while accessing `PixelData`, which the values compliant with the standard. In the sample referenced in the example below, we have this, which satisfies DS VR: ``` (...
swe-bench_data_pydicom__pydicom-1428
Allow to search a list of elements in a `FileSet` while only loading instances once, to drastically improve execution time **Is your feature request related to a problem? Please describe.** Currently, `fileset.FileSet.find_values` only allows for elements to be searched for one at a time. When executing this action wh...
swe-bench_data_pydicom__pydicom-1256
from_json does not correctly convert BulkDataURI's in SQ data elements **Describe the bug** When a DICOM object contains large data elements in SQ elements and is converted to JSON, those elements are correctly turned into BulkDataURI's. However, when the JSON is converted back to DICOM using from_json, the BulkDataUR...
swe-bench_data_astropy__astropy-11693
'WCS.all_world2pix' failed to converge when plotting WCS with non linear distortions <!-- 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/master/CONTRIBUTING.md . Please...
swe-bench_data_astropy__astropy-12057
Add helpers to convert between different types of uncertainties Currently there no easy way to convert from an arbitrary uncertainty class to a different uncertainty class. This would be useful to be able to pass NDData objects to external libraries/tools which assume, for example, that uncertainties will always stored...
swe-bench_data_astropy__astropy-12318
BlackBody bolometric flux is wrong if scale has units of dimensionless_unscaled The `astropy.modeling.models.BlackBody` class has the wrong bolometric flux if `scale` argument is passed as a Quantity with `dimensionless_unscaled` units, but the correct bolometric flux if `scale` is simply a float. ### Description <...
swe-bench_data_astropy__astropy-12544
Can Table masking be turned off? <!-- 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 out our code of conduct, https://gi...
swe-bench_data_astropy__astropy-12825
SkyCoord in Table breaks aggregate on group_by ### Description, actual behaviour, reproduction When putting a column of `SkyCoord`s in a `Table`, `aggregate` does not work on `group_by().groups`: ```python from astropy.table import Table import astropy.units as u from astropy.coordinates import SkyCoord import ...
swe-bench_data_astropy__astropy-12842
No longer able to read BinnedTimeSeries with datetime column saved as ECSV after upgrading from 4.2.1 -> 5.0+ <!-- 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/CO...
swe-bench_data_astropy__astropy-12880
No longer able to read BinnedTimeSeries with datetime column saved as ECSV after upgrading from 4.2.1 -> 5.0+ <!-- 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/CO...
swe-bench_data_astropy__astropy-12891
The `where` keyword argument of `np.mean` is not supported for `astropy.units.Quantity` instances. <!-- 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....
swe-bench_data_astropy__astropy-12907
Modeling's `separability_matrix` does not compute separability correctly for nested CompoundModels Consider the following model: ```python from astropy.modeling import models as m from astropy.modeling.separable import separability_matrix cm = m.Linear1D(10) & m.Linear1D(5) ``` It's separability matrix as y...
swe-bench_data_astropy__astropy-12962
Convert CCDData to ImageHDU ### Description As far as I can tell, currently there's no way to directly convert a `CCDData` object to an `ImageHDU` object. If we write it to a file using `CCDData.write()` it will always create a file where the first HDU is a `PrimaryHDU` that contains the `CCDData.data`, followed by op...
swe-bench_data_astropy__astropy-13032
Incorrect ignored usage in `ModelBoundingBox` <!-- 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 out our code of conduct...
swe-bench_data_astropy__astropy-13033
TimeSeries: misleading exception when required column check fails. <!-- 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 ou...
swe-bench_data_astropy__astropy-13068
Time from astropy.time not precise Hello, I encounter difficulties with Time. I'm working on a package to perform photometry and occultation. For this last case, data need times values accurately estimated. Of course, data coming from different camera will will have different time format in the header. to man...
swe-bench_data_astropy__astropy-13073
Document reading True/False in ASCII table as bool not str <!-- 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 out our co...
swe-bench_data_astropy__astropy-13075
Register format ``html`` to ``Cosmology.write`` with nice mathjax Cosmology can now read and write to files. It would be nice to register with ``Cosmology.write`` a method for exporting a Cosmology to a HTML table. There are good examples of IO with Cosmology at https://github.com/astropy/astropy/tree/main/astropy/c...
swe-bench_data_astropy__astropy-13132
Add __array_func__ for astropy.time.Time <!-- This comments are hidden when you submit the pull request, 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 out our code of condu...
swe-bench_data_astropy__astropy-13158
Model evaluation fails if any model parameter is a `MagUnit` type value <!-- 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 che...
swe-bench_data_astropy__astropy-13162
Angle bug for (d, m, s) tuple input (deprecate dms_to_degrees) `Angle` does not handle the sign correctly for a `(d, m, s)` tuple input if `d=0`: ```python >>> from astropy.coordinates import Angle >>> ang = Angle((-0, -42, -17), unit='deg') >>> print(ang) 0d42m17s >>> print(ang.dms) dms_tuple(d=0.0, m=42.0, s...
swe-bench_data_astropy__astropy-13234
Structured column serialization round-trip fails with field name of "name" <!-- 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 ...
swe-bench_data_astropy__astropy-13236
Consider removing auto-transform of structured column into NdarrayMixin <!-- 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 che...
swe-bench_data_astropy__astropy-13306
vstack'ing structured array tables fails with casting error <!-- 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 out our c...
swe-bench_data_astropy__astropy-13390
BUG: Table test failures with np 1.23.0rc3 ``` ====================================================================== FAILURES ======================================================================= __________________________________________________________ test_col_unicode_sandwich_unicode __________________________...
swe-bench_data_astropy__astropy-13398
A direct approach to ITRS to Observed transformations that stays within the ITRS. <!-- 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 s...
swe-bench_data_astropy__astropy-13404
Masked ``_array2string`` doesn't work on some structured arrays ### Description The dispatch function ``_array2string `` in ``masked.function_helpers`` doesn't work on arrays with strutcured dtypes. ### Expected behavior Masked arrays with structured dtypes can be printed no prob, like their non-masked counter...
swe-bench_data_astropy__astropy-13417
FITS problem reading binary table with variable length columns I want to read a certain FITS file ([P190mm-PAFBE-FEBEPAR.fits.zip](https://github.com/astropy/astropy/files/2370673/P190mm-PAFBE-FEBEPAR.fits.zip)), which is part of a Multi-Beam-FITS measurement set ([MBFITS](http://www.mpifr-bonn.mpg.de/staff/dmuders/APE...
swe-bench_data_astropy__astropy-13438
[Security] Jquery 3.1.1 is vulnerable to untrusted code execution <!-- 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 out...
swe-bench_data_astropy__astropy-13453
ASCII table output to HTML does not support supplied "formats" <!-- 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 out ou...
swe-bench_data_astropy__astropy-13462
TST: time/tests/test_precision.py failed in pyinstaller (computed error is different depending on the order of the arguments) First failing log (2022-03-13): https://github.com/astropy/astropy/runs/5525474634 Last successful log (2022-03-12): https://github.com/astropy/astropy/runs/5519547613 Looks like this test...
swe-bench_data_astropy__astropy-13465
rtol for FITSDiff not working as expected. I have question about the rtol parameter for FITSDiff, when I create a report it appears that the numbers cited as being different are within the given relative tolerance. I couldn't figure out why so I thought this may be a bug, apologies if I'm missing something super obvi...
swe-bench_data_astropy__astropy-13469
Can't convert a list of Astropy tables to a NumPy array of tables I recently stumbled upon [a StackOverflow question](https://stackoverflow.com/questions/69414829/convert-a-list-of-astropy-table-in-a-numpy-array-of-astropy-table) where someone likes to convert a list of Tables to a NumPy array. By default, NumPy will ...
swe-bench_data_astropy__astropy-13477
Comparing Frame with data and SkyCoord with same data raises exception <!-- 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 chec...
swe-bench_data_astropy__astropy-13572
Problem in function nutation_matrix in earth_orientation.py Recently, when I try to call function nutation_matrix in astropy.coordinates.earth_orientation, error occurs with following info: astropy.units.core.UnitTypeError: Angle instances require units equivalent to 'rad', so cannot set it to '0'. Then, I checke...
swe-bench_data_astropy__astropy-13579
Inconsistent behavior of `world_to_pixel` in `SlicedLowLevelWCS` <!-- 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 out...
swe-bench_data_astropy__astropy-13638
`Quantity.__ilshift__` throws exception with `dtype=int` <!-- 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 out our code...
swe-bench_data_astropy__astropy-13668
wcslint crashes on valid WCS `wcslint` calls an underlying function here: https://github.com/astropy/astropy/blob/8c0581fc68ca1f970d7f4e6c9ca9f2b9567d7b4c/astropy/wcs/wcs.py#L3430 Looks like all it does is tries to create a `WCS` object with the header and report warnings, so the bug is either inside `WCS` or it ...
swe-bench_data_astropy__astropy-13731
`Time` parses fractional days in year-month-day format incorrectly `Time('2017-08-24.25')` results in `2017-08-24 00:00:00.250`: the fractional days are interpreted as fractional seconds (`2017-08-24 06:00:00` is what I hoped for). The format `2017-08-24.25` is perhaps not the best format, but it is used, and since ...
swe-bench_data_astropy__astropy-13734
Add option to input/output column units for fixed width tables Extend the `io.ascii.FixedWidth` reader to include a keyword arg that will specify that there is a row of unit specifiers after the column name specifiers (or at the top of the header if there are no column names). This will apply for both reading and writ...
swe-bench_data_astropy__astropy-13745
float32 representation of pi/2 is rejected by `Latitude` <!-- 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 out our code...
swe-bench_data_astropy__astropy-13803
float32 representation of pi/2 is rejected by `Latitude` <!-- 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 out our code...
swe-bench_data_astropy__astropy-13838
Printing tables doesn't work correctly with 0-length array cells <!-- 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 out ...
swe-bench_data_astropy__astropy-13842
Creating a mixin column in a new table from columns of another table renames columns in original table. ### Description Consider the following code, where a subset of columns from another table should be included in a new table with new names, prerably without copying the actual payload data: ```python from astr...
swe-bench_data_astropy__astropy-13933
Unpickled Angle.to_string fails <!-- 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 out our code of conduct, https://git...
swe-bench_data_astropy__astropy-13977
Should `Quantity.__array_ufunc__()` return `NotImplemented` instead of raising `ValueError` if the inputs are incompatible? ### Description I'm trying to implement a duck type of `astropy.units.Quantity`. If you are interested, the project is available [here](https://github.com/Kankelborg-Group/named_arrays). I'm runn...
swe-bench_data_astropy__astropy-14042
Degrees Celsius should be supported by FITS units <!-- 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 out our code of con...
swe-bench_data_astropy__astropy-14096
Subclassed SkyCoord gives misleading attribute access message I'm trying to subclass `SkyCoord`, and add some custom properties. This all seems to be working fine, but when I have a custom property (`prop` below) that tries to access a non-existent attribute (`random_attr`) below, the error message is misleading becaus...
swe-bench_data_astropy__astropy-14163
Should calling `np.array_equal()` on `astropy.units.Quantity` instances with incompatible units return `False`? <!-- 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/...
swe-bench_data_astropy__astropy-14182
Please support header rows in RestructuredText output ### Description It would be great if the following would work: ```Python >>> from astropy.table import QTable >>> import astropy.units as u >>> import sys >>> tbl = QTable({'wave': [350,950]*u.nm, 'response': [0.7, 1.2]*u.count}) >>> tbl.write(sys.stdout,...
swe-bench_data_astropy__astropy-14213
The `range` argument to `numpy.histogram`-like functions does not accept instances of `astropy.units.Quantity` <!-- 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/C...
swe-bench_data_astropy__astropy-14253
When should `info` be linked to a new object? Mostly for @taldcroft - I noticed that in `Quantity` the way we have set up `__array_finalize__`, `info` is passed on not just for views (where it should be), but also for copies (implicitly in arithmetic operations, etc.). Which ones are reasonable? Just thinking about wh...
swe-bench_data_astropy__astropy-14295
Presence of SIP keywords leads to ignored PV keywords. <!-- 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 out our code o...
swe-bench_data_astropy__astropy-14309
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...
swe-bench_data_astropy__astropy-14365
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...
swe-bench_data_astropy__astropy-14369
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...
swe-bench_data_astropy__astropy-14371
Add ``atol`` argument to function ``is_O3`` Or at least use the maximum precision of the matrix dtype instead of the arbitrarily chosen 1e-15. https://github.com/astropy/astropy/blob/3912916dad56920514ba648be400a5f82add041a/astropy/coordinates/matrix_utilities.py#L137-L163 diff --git a/astropy/coordinates/matrix_u...
swe-bench_data_astropy__astropy-14379
Space between value and unit Currently, ``Angle.to_string`` doesn't include a space between the value and unit: ```python In [30]: from astropy.coordinates import Angle In [31]: a = Angle(3, 'deg') In [32]: a.to_string(unit='mas') Out[32]: '1.08e+07mas' ``` I think there are cases where it would make sen...
swe-bench_data_astropy__astropy-14413
Unicode and console unit representations sometimes include an extraneous space ### Description As noted in #14407, for units typset in `unicode` or `console` format, a space is included in front, unlike for regular units, yet it is sometimes omitted if a unit scale factor is present. ### Expected behavior `unit.to_s...
swe-bench_data_astropy__astropy-14439
Regarding FITS standard definition for 'Jy/beam' Astropy unit definition for Jy/beam currently exports it as 'beam-1 Jy' `from astropy import units as u` `(u.Jy/u.beam).to_string('FITS')` 'beam-1 Jy' This is contrary to how most radio astronomy packages define the unit. 'Jy/beam' seems to be the accepted conventi...
swe-bench_data_astropy__astropy-14484
New Quantity warning starting with yesterday's numpy-dev ### Description Starting today, `photutils` CI tests with `astropy-dev` and `numpy-dev` started failing due a new warning. I've extracted a MWE showing the warning: ```python import astropy.units as u import pytest from numpy.testing import assert_equal...
swe-bench_data_astropy__astropy-14508
`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...
swe-bench_data_astropy__astropy-14528
`io.fits` creates a corrupt FITS files if a `ImageHDU` contains zero-dimensional data ### Description `ImageHDU` accepts a ndarray with shape `()` (zero-dimensional) as a data array. This later causes issues when writing to a file because `io.fits` assumes that the data has at least 1 dimension, resulting in a corrupt...
swe-bench_data_astropy__astropy-14539
`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...
swe-bench_data_astropy__astropy-14566
Problem with "decimalyear" applied to MaskedColumn type ### Description The "decimalyear" type produces odd errors when applied to the MaskedColumn type. The "jyear" type does not, and appears to behave properly. ### Expected behavior I would expect "decimalyear" and "jyear" to work similarly, although the di...
swe-bench_data_astropy__astropy-14578
Writing a Table to FITS fails if the table contains objects The following works fine: ``` Python from astropy.table import Table Table([{'col1': None}]).write('/tmp/tmp.txt', format='ascii') ``` whereas the following fails: ``` Python Table([{'col1': None}]).write('/tmp/tmp.fits', format='fits') ``` with ``` /home...
swe-bench_data_astropy__astropy-14590
TST: np.fix check fails with numpy-dev (TypeError: cannot write to unmasked output) Started popping up in numpy-dev jobs. @mhvk is investigating. ``` ____________________________ TestUfuncLike.test_fix ____________________________ self = <astropy.utils.masked.tests.test_function_helpers.TestUfuncLike object at 0...
swe-bench_data_astropy__astropy-14598
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 [...
swe-bench_data_astropy__astropy-14628
Make getting a topocentric ITRS position easier ### What is the problem this feature will solve? Right now, it is not easy to create ITRS coordinates for sources relative to a given location (rather than geocentric), to the level that we have specific instructions on how to calculate relative `CartesianCoordinates` an...
swe-bench_data_astropy__astropy-14701
Register ``latex`` to ``Cosmology.write`` Cosmology can now read and write to files. It would be nice to register with ``Cosmology.write`` a method for exporting a Cosmology to a Latex table. There are good examples of IO with Cosmology at https://github.com/astropy/astropy/tree/main/astropy/cosmology/io and docume...
swe-bench_data_astropy__astropy-14702
BUG: change representation of votable.tree.Table vs table.Table More often than not it's rather confusing (and annoying) that a VOTable and a Table look exactly the same, but obviously, they don't behave the same way and don't have the same methods available, etc. I would suggest to change the votable case of `<Ta...
swe-bench_data_astropy__astropy-14907
TST: test_table_group_by[True] and test_group_by_masked[True] failed with numpy 1.25rc1 I see this in the predeps job that pulls in numpy 1.25rc1. Example log: https://github.com/astropy/astropy/actions/runs/5117103756/jobs/9199883166 Hard to discern between the other 100+ failures from https://github.com/astropy/as...
swe-bench_data_astropy__astropy-14938
Add registration label ‘ascii.latex’ to Cosmology IO ### What is the problem this feature will solve? The Cosmology write methods that leverage Table should have the same `format=` keys. Table has both “latex” and “ascii.latex”, so too should Cosmology. ### Describe the desired outcome Register the method a s...
swe-bench_data_astropy__astropy-14966
QTable: Group keys don't have a unit ### Description When grouping a QTable with a column that contains a quantity, the keys only contain a float with a value, but not the full quantity: ```Python >>> from astropy.table import QTable >>> import astropy.units as u >>> tbl = QTable({"length": [1., 1., 2., 3., 1., ...
swe-bench_data_astropy__astropy-14991
Error in distance calculations for w0wz Cosmologies ### Description I believe that the equation used to calculate the de_density_scale in `w0wzcdm.py `is incorrect. Line 205 has `return zp1 ** (3.0 * (1.0 + self._w0 - self._wz)) * exp(-3.0 * self._wz * z)` ### Expected behavior After manually calculating the...
swe-bench_data_astropy__astropy-14995
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. ...
swe-bench_data_astropy__astropy-6938
Possible bug in io.fits related to D exponents I came across the following code in ``fitsrec.py``: ```python # Replace exponent separator in floating point numbers if 'D' in format: output_field.replace(encode_ascii('E'), encode_ascii('D')) ``` I think this may be incorrect because...
swe-bench_data_astropy__astropy-7008
Context manager for constant versions For some use cases it would be helpful to have a context manager to set the version set of the constants. E.g., something like ``` with constants_set(astropyconst13): ... code goes here ... ```` diff --git a/astropy/constants/__init__.py b/astropy/constants/__init__.py -...