home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 649860850

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/pull/4163#issuecomment-649860850 https://api.github.com/repos/pydata/xarray/issues/4163 649860850 MDEyOklzc3VlQ29tbWVudDY0OTg2MDg1MA== 14808389 2020-06-25T23:06:28Z 2020-06-25T23:16:04Z MEMBER

I tried that by writing some sort of assert_duckarray_equal and assert_duckarray_allclose function. That should work for most duck arrays, but not pint: the tests often compare the data with the variable (or the variable's data), and since the data is mostly a bare numpy array this fails for pint: bare numpy arrays are by definition dimensionless and so the comparison either returns False (the assertion fails) or a DimensionalityError is raised.

So to make this work I think we'd need to rewrite VariableSubtests to have another static method (array_type? data_type?) which is called on all data before it is passed to cls. That, however, has its own set of issues and in the end I concluded that VariableSubtests was just not written with duck arrays in mind, and that pytest doesn't encourage reusing tests by using inheritance (marking or removing tests from base classes is really clunky). With that in mind I simply removed the use of VariableSubtests for now (this shouldn't decrease the coverage too much) and we can add it back if / when we notice that we actually need these tests.

Edit: Right now the only failing tests are due to hgrecco/pint#1123. I guess I'll just remove the xfail condition and add it back once that PR is merged.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  640740029
Powered by Datasette · Queries took 3.054ms · About: xarray-datasette