home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 568320746

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
568320746 MDU6SXNzdWU1NjgzMjA3NDY= 3783 New TestVariable.test_pad failure with pint 0.11 490531 closed 0     1 2020-02-20T13:59:35Z 2020-02-23T19:13:08Z 2020-02-23T19:13:08Z CONTRIBUTOR      

Since y-day, pint 0.11 was released and it results in a new test failure (in addition to the ones in #3778 and #3779): ``` ____ TestVariable.test_pad _____

self = <xarray.tests.test_units.TestVariable object at 0x7f6bfd8c1b20>

def test_pad(self):
    data = np.arange(4 * 3 * 2).reshape(4, 3, 2)
    v = self.cls(["x", "y", "z"], data)

    xr_args = [{"x": (2, 1)}, {"y": (0, 3)}, {"x": (3, 1), "z": (2, 0)}]
    np_args = [
        ((2, 1), (0, 0), (0, 0)),
        ((0, 0), (0, 3), (0, 0)),
        ((3, 1), (0, 0), (2, 0)),
    ]
    for xr_arg, np_arg in zip(xr_args, np_args):
        actual = v.pad_with_fill_value(**xr_arg)
        expected = np.pad(
            np.array(v.data.astype(float)),
            np_arg,
            mode="constant",
            constant_values=np.nan,
        )
        assert_array_equal(actual, expected)
        assert isinstance(actual._data, type(v._data))

    # for the boolean array, we pad False
    data = np.full_like(data, False, dtype=bool).reshape(4, 3, 2)
    v = self.cls(["x", "y", "z"], data)
    for xr_arg, np_arg in zip(xr_args, np_args):
      actual = v.pad_with_fill_value(fill_value=False, **xr_arg)

xarray/tests/test_variable.py:813:


xarray/core/variable.py:1210: in pad_with_fill_value array = np.pad( <array_function internals>:5: in pad ??? /usr/lib/python3.8/site-packages/pint/quantity.py:1543: in array_function return numpy_wrap("function", func, args, kwargs, types) /usr/lib/python3.8/site-packages/pint/numpy_func.py:894: in numpy_wrap return handledname /usr/lib/python3.8/site-packages/pint/numpy_func.py:671: in _pad kwargs["constant_values"] = _recursive_convert(kwargs["constant_values"], units) /usr/lib/python3.8/site-packages/pint/numpy_func.py:659: in _recursive_convert arg = unit._REGISTRY.Quantity(arg, unit) /usr/lib/python3.8/site-packages/pint/quantity.py:200: in new inst._magnitude = _to_magnitude(


value = False, force_ndarray = True, force_ndarray_like = False

def _to_magnitude(value, force_ndarray=False, force_ndarray_like=False):
    if isinstance(value, (dict, bool)) or value is None:
      raise TypeError("Invalid magnitude for Quantity: {0!r}".format(value))

E TypeError: Invalid magnitude for Quantity: False

/usr/lib/python3.8/site-packages/pint/compat.py:49: TypeError ```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/3783/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.94ms · About: xarray-datasette