Dataset Viewer
Auto-converted to Parquet Duplicate
source
stringclasses
4 values
task_type
stringclasses
5 values
instruction
stringclasses
5 values
input
stringlengths
108
11.9k
output
stringlengths
28
12k
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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, fo...
diff --git a/astropy/nddata/nduncertainty.py b/astropy/nddata/nduncertainty.py --- a/astropy/nddata/nduncertainty.py +++ b/astropy/nddata/nduncertainty.py @@ -395,6 +395,40 @@ def _propagate_multiply(self, other_uncert, result_data, correlation): def _propagate_divide(self, other_uncert, result_data, correlation):...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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...
diff --git a/astropy/io/fits/connect.py b/astropy/io/fits/connect.py --- a/astropy/io/fits/connect.py +++ b/astropy/io/fits/connect.py @@ -112,7 +112,8 @@ def _decode_mixins(tbl): def read_table_fits(input, hdu=None, astropy_native=False, memmap=False, - character_as_bytes=True, unit_parse_stric...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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 as...
diff --git a/astropy/table/column.py b/astropy/table/column.py --- a/astropy/table/column.py +++ b/astropy/table/column.py @@ -340,7 +340,9 @@ class ColumnInfo(BaseColumnInfo): This is required when the object is used as a mixin column within a table, but can be used as a general way to store meta information...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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...
diff --git a/astropy/units/quantity.py b/astropy/units/quantity.py --- a/astropy/units/quantity.py +++ b/astropy/units/quantity.py @@ -18,6 +18,7 @@ # LOCAL from astropy import config as _config +from astropy.utils.compat import NUMPY_LT_1_20, NUMPY_LT_1_22 from astropy.utils.compat.misc import override__dir__ fr...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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.Linear1...
diff --git a/astropy/modeling/separable.py b/astropy/modeling/separable.py --- a/astropy/modeling/separable.py +++ b/astropy/modeling/separable.py @@ -242,7 +242,7 @@ def _cstack(left, right): cright = _coord_matrix(right, 'right', noutp) else: cright = np.zeros((noutp, right.shape[1])) - ...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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` t...
diff --git a/astropy/nddata/ccddata.py b/astropy/nddata/ccddata.py --- a/astropy/nddata/ccddata.py +++ b/astropy/nddata/ccddata.py @@ -270,7 +270,8 @@ def uncertainty(self, value): self._uncertainty = value def to_hdu(self, hdu_mask='MASK', hdu_uncertainty='UNCERT', - hdu_flags=None, w...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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 . Plea...
diff --git a/astropy/modeling/bounding_box.py b/astropy/modeling/bounding_box.py --- a/astropy/modeling/bounding_box.py +++ b/astropy/modeling/bounding_box.py @@ -694,6 +694,12 @@ def _validate_dict(self, bounding_box: dict): for key, value in bounding_box.items(): self[key] = value + @proper...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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/C...
diff --git a/astropy/timeseries/core.py b/astropy/timeseries/core.py --- a/astropy/timeseries/core.py +++ b/astropy/timeseries/core.py @@ -55,6 +55,13 @@ class BaseTimeSeries(QTable): _required_columns_relax = False def _check_required_columns(self): + def as_scalar_or_list_str(obj): + if ...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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 di...
diff --git a/astropy/time/core.py b/astropy/time/core.py --- a/astropy/time/core.py +++ b/astropy/time/core.py @@ -655,9 +655,6 @@ def precision(self): @precision.setter def precision(self, val): del self.cache - if not isinstance(val, int) or val < 0 or val > 9: - raise ValueError(...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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/CONTRIBUT...
diff --git a/astropy/io/ascii/core.py b/astropy/io/ascii/core.py --- a/astropy/io/ascii/core.py +++ b/astropy/io/ascii/core.py @@ -1016,7 +1016,10 @@ class BaseOutputter: """Output table as a dict of column objects keyed on column name. The table data are stored as plain python lists within the column object...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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://...
diff --git a/astropy/cosmology/io/__init__.py b/astropy/cosmology/io/__init__.py --- a/astropy/cosmology/io/__init__.py +++ b/astropy/cosmology/io/__init__.py @@ -5,4 +5,4 @@ """ # Import to register with the I/O machinery -from . import cosmology, ecsv, mapping, model, row, table, yaml +from . import cosmology, ec...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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 . Pl...
diff --git a/astropy/time/core.py b/astropy/time/core.py --- a/astropy/time/core.py +++ b/astropy/time/core.py @@ -31,6 +31,7 @@ # Import TimeFromEpoch to avoid breaking code that followed the old example of # making a custom timescale in the documentation. from .formats import TimeFromEpoch # noqa +from .time_help...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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 >>> p...
diff --git a/astropy/coordinates/angle_formats.py b/astropy/coordinates/angle_formats.py --- a/astropy/coordinates/angle_formats.py +++ b/astropy/coordinates/angle_formats.py @@ -27,6 +27,7 @@ IllegalMinuteWarning, IllegalMinuteError, IllegalSecondWarning, IllegalSecondError)...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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/blo...
diff --git a/astropy/table/serialize.py b/astropy/table/serialize.py --- a/astropy/table/serialize.py +++ b/astropy/table/serialize.py @@ -293,14 +293,18 @@ def _construct_mixin_from_obj_attrs_and_info(obj_attrs, info): # untrusted code by only importing known astropy classes. cls_full_name = obj_attrs.pop('_...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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/m...
diff --git a/astropy/table/table.py b/astropy/table/table.py --- a/astropy/table/table.py +++ b/astropy/table/table.py @@ -1239,13 +1239,6 @@ def _convert_data_to_col(self, data, copy=True, default_name=None, dtype=None, n f'{fully_qualified_name} ' 'did...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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/CONTRIBU...
diff --git a/astropy/utils/metadata.py b/astropy/utils/metadata.py --- a/astropy/utils/metadata.py +++ b/astropy/utils/metadata.py @@ -73,7 +73,7 @@ def dtype(arr): dtype_bytes_or_chars(arr.dtype)] arr_common = np.array([arr[0] for arr in arrs]) - return arr_common.dtype.str + retur...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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 prin...
diff --git a/astropy/utils/masked/function_helpers.py b/astropy/utils/masked/function_helpers.py --- a/astropy/utils/masked/function_helpers.py +++ b/astropy/utils/masked/function_helpers.py @@ -877,13 +877,19 @@ class MaskedFormat: """ def __init__(self, format_function): self.format_function = form...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: [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/CO...
diff --git a/astropy/table/jsviewer.py b/astropy/table/jsviewer.py --- a/astropy/table/jsviewer.py +++ b/astropy/table/jsviewer.py @@ -15,7 +15,7 @@ class Conf(_config.ConfigNamespace): """ jquery_url = _config.ConfigItem( - 'https://code.jquery.com/jquery-3.1.1.min.js', + 'https://code.jquery...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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/a...
diff --git a/astropy/time/utils.py b/astropy/time/utils.py --- a/astropy/time/utils.py +++ b/astropy/time/utils.py @@ -60,14 +60,16 @@ def day_frac(val1, val2, factor=None, divisor=None): # get integer fraction day = np.round(sum12) - extra, frac = two_sum(sum12, -day) - frac += extra + err12 - # O...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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 bu...
diff --git a/astropy/io/fits/diff.py b/astropy/io/fits/diff.py --- a/astropy/io/fits/diff.py +++ b/astropy/io/fits/diff.py @@ -1051,7 +1051,8 @@ def _report(self): index = [x + 1 for x in reversed(index)] self._writeln(f' Data differs at {index}:') report_diff_values(values[0], va...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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 T...
diff --git a/astropy/table/table.py b/astropy/table/table.py --- a/astropy/table/table.py +++ b/astropy/table/table.py @@ -1070,7 +1070,12 @@ def __array__(self, dtype=None): supported and will raise a ValueError. """ if dtype is not None: - raise ValueError('Datatype coercion is n...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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/ma...
diff --git a/astropy/coordinates/baseframe.py b/astropy/coordinates/baseframe.py --- a/astropy/coordinates/baseframe.py +++ b/astropy/coordinates/baseframe.py @@ -1650,6 +1650,9 @@ def __eq__(self, value): This implements strict equality and requires that the frames are equivalent and that the represe...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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/CO...
diff --git a/astropy/wcs/wcsapi/wrappers/sliced_wcs.py b/astropy/wcs/wcsapi/wrappers/sliced_wcs.py --- a/astropy/wcs/wcsapi/wrappers/sliced_wcs.py +++ b/astropy/wcs/wcsapi/wrappers/sliced_wcs.py @@ -243,6 +243,8 @@ def pixel_to_world_values(self, *pixel_arrays): return world_arrays def world_to_pixel_va...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: `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/CONTRIBUTIN...
diff --git a/astropy/units/quantity.py b/astropy/units/quantity.py --- a/astropy/units/quantity.py +++ b/astropy/units/quantity.py @@ -1088,21 +1088,23 @@ def __ilshift__(self, other): try: other = Unit(other, parse_strict='silent') except UnitTypeError: - return NotImplemented...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: 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 warnin...
diff --git a/astropy/wcs/wcs.py b/astropy/wcs/wcs.py --- a/astropy/wcs/wcs.py +++ b/astropy/wcs/wcs.py @@ -3528,7 +3528,7 @@ def __repr__(self): "always", FITSFixedWarning, append=True) try: - WCS(hdu.header, + WCS(hdu.header, hdulist, ...
swebench
bug_fixing
Fix the bug described in the repository issue.
Repository: astropy/astropy Problem Statement: `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 n...
diff --git a/astropy/time/formats.py b/astropy/time/formats.py --- a/astropy/time/formats.py +++ b/astropy/time/formats.py @@ -1294,13 +1294,15 @@ def parse_string(self, timestr, subfmts): try: idot = timestr.rindex('.') except Exception: - fracsec = 0.0 + timestr_ha...
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
27