home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 699548837

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/issues/4465#issuecomment-699548837 https://api.github.com/repos/pydata/xarray/issues/4465 699548837 MDEyOklzc3VlQ29tbWVudDY5OTU0ODgzNw== 10563614 2020-09-26T21:15:44Z 2020-09-26T21:15:44Z CONTRIBUTOR

Interesting discussion #2217. As far as I understand, it solves a wider problem than using a tolerance on and a member by member comparison... but more complex to implement.

Here is the simple solution that works for me (combine.py:70):

        if not (all(index.equals(indexes[0]) for index in indexes[1:])
                or (tolerance > 0 and \
                    all(index.is_numeric() for index in indexes) and \
                    all(np.allclose(index, indexes[0], atol=tolerance, rtol=0) for index in indexes[1:]))):

I've not tested in depth, I can make a PR, tests, doc if you agree with this solution.

Regarding the name of the arg. "tolerance" is nice, but allclose has atol and rtol. My solution above only set atol, but both may be useful. Should we use: 2args: atol, rtol 2 args: atolerance, rtolerance 1 args: tolerance could be a number (->atol) or a tuple interpreted as atol, rtol = tolerance or a dict .... ?

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