repo stringclasses 1
value | instance_id stringclasses 3
values | base_commit stringclasses 3
values | patch stringclasses 3
values | test_patch stringclasses 3
values | problem_statement stringclasses 3
values | hints_text stringclasses 3
values | created_at stringdate 2018-06-29 16:27:46 2019-06-19 20:34:56 | version stringclasses 2
values | FAIL_TO_PASS stringclasses 3
values | PASS_TO_PASS stringclasses 3
values | environment_setup_commit stringclasses 2
values | difficulty stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
astropy/astropy | astropy__astropy-7606 | 3cedd79e6c121910220f8e6df77c54a0b344ea94 | diff --git a/astropy/units/core.py b/astropy/units/core.py
--- a/astropy/units/core.py
+++ b/astropy/units/core.py
@@ -728,7 +728,7 @@ def __eq__(self, other):
try:
other = Unit(other, parse_strict='silent')
except (ValueError, UnitsError, TypeError):
- return False
+ ... | diff --git a/astropy/units/tests/test_units.py b/astropy/units/tests/test_units.py
--- a/astropy/units/tests/test_units.py
+++ b/astropy/units/tests/test_units.py
@@ -185,6 +185,13 @@ def test_unknown_unit3():
assert unit != unit3
assert not unit.is_equivalent(unit3)
+ # Also test basic (in)equalities.
+... | Unit equality comparison with None raises TypeError for UnrecognizedUnit
```
In [12]: x = u.Unit('asdf', parse_strict='silent')
In [13]: x == None # Should be False
---------------------------------------------------------------------------
TypeError Traceback (most recent call la... | `x is None` works fine. Is there a reason why `==` is needed here?
`x is None` would indeed be preferred, but `==` should never fail, so this is still a bug. | 2018-06-29T16:27:46Z | 1.3 | ["astropy/units/tests/test_units.py::test_unknown_unit3"] | ["astropy/units/tests/test_units.py::test_getting_started", "astropy/units/tests/test_units.py::test_initialisation", "astropy/units/tests/test_units.py::test_invalid_power", "astropy/units/tests/test_units.py::test_invalid_compare", "astropy/units/tests/test_units.py::test_convert", "astropy/units/tests/test_units.py:... | 848c8fa21332abd66b44efe3cb48b72377fb32cc | 15 min - 1 hour |
astropy/astropy | astropy__astropy-8872 | b750a0e6ee76fb6b8a099a4d16ec51977be46bf6 | diff --git a/astropy/units/quantity.py b/astropy/units/quantity.py
--- a/astropy/units/quantity.py
+++ b/astropy/units/quantity.py
@@ -215,8 +215,8 @@ class Quantity(np.ndarray, metaclass=InheritDocstrings):
dtype : ~numpy.dtype, optional
The dtype of the resulting Numpy array or scalar that will
... | diff --git a/astropy/utils/introspection.py b/astropy/utils/introspection.py
index e437b40c87..70c5e2b39b 100644
--- a/astropy/utils/introspection.py
+++ b/astropy/utils/introspection.py
@@ -7,7 +7,7 @@ import inspect
import re
import types
import importlib
-from distutils.version import LooseVersion
+from packaging... | float16 quantities get upgraded to float64 automatically
When trying to create a `Quantity` from a `np.float16` (not something I actually intended to do, I was experimenting while investigating other issue) it gets upgraded automatically to `np.float64`, which is something that does not happen with other float types:
... | Hmm, it was added in gh-1776 (code in [l299](https://github.com/astropy/astropy/blob/master/astropy/units/quantity.py#L299) and [l379](https://github.com/astropy/astropy/blob/master/astropy/units/quantity.py#L379) by checking `np.can_cast(np.float32, value.dtype)`. From the discussion, it seems half floats were never c... | 2019-06-19T20:34:56Z | 3.1 | ["astropy/units/tests/test_quantity.py::TestQuantityCreation::test_preserve_dtype"] | ["astropy/units/tests/test_quantity.py::TestQuantityCreation::test_1", "astropy/units/tests/test_quantity.py::TestQuantityCreation::test_2", "astropy/units/tests/test_quantity.py::TestQuantityCreation::test_3", "astropy/units/tests/test_quantity.py::TestQuantityCreation::test_nan_inf", "astropy/units/tests/test_quantit... | 2e89d074b3b2abc2da80e437c93b1d5516a0ca57 | 15 min - 1 hour |
astropy/astropy | astropy__astropy-8707 | a85a0747c54bac75e9c3b2fe436b105ea029d6cf | diff --git a/astropy/io/fits/card.py b/astropy/io/fits/card.py
--- a/astropy/io/fits/card.py
+++ b/astropy/io/fits/card.py
@@ -554,6 +554,13 @@ def fromstring(cls, image):
"""
card = cls()
+ if isinstance(image, bytes):
+ # FITS supports only ASCII, but decode as latin1 and just ta... | diff --git a/astropy/io/fits/tests/test_header.py b/astropy/io/fits/tests/test_header.py
index 7c1725aedb..a87bc19dab 100644
--- a/astropy/io/fits/tests/test_header.py
+++ b/astropy/io/fits/tests/test_header.py
@@ -9,7 +9,15 @@ from io import StringIO, BytesIO
import pytest
import numpy as np
-
+# Compatibility fix... | Header.fromstring does not accept Python 3 bytes
According to [the docs](http://docs.astropy.org/en/stable/_modules/astropy/io/fits/header.html#Header.fromstring), the method `Header.fromstring` "...creates an HDU header from a byte string containing the entire header data."
By "byte string" here it really means the... | 2019-05-15T13:21:19Z | 3.1 | ["astropy/io/fits/tests/test_header.py::TestHeaderFunctions::test_card_from_bytes"] | ["astropy/io/fits/tests/test_header.py::test_shallow_copy", "astropy/io/fits/tests/test_header.py::test_init_with_header", "astropy/io/fits/tests/test_header.py::test_init_with_dict", "astropy/io/fits/tests/test_header.py::test_init_with_ordereddict", "astropy/io/fits/tests/test_header.py::TestHeaderFunctions::test_ren... | 2e89d074b3b2abc2da80e437c93b1d5516a0ca57 | 15 min - 1 hour |
README.md exists but content is empty.
- Downloads last month
- 46