home / github

Menu
  • GraphQL API
  • Search all tables

issues

Table actions
  • GraphQL API for issues

4 rows where comments = 7, repo = 13221727 and user = 14371165 sorted by updated_at descending

✎ View and edit SQL

This data as json, CSV (advanced)

Suggested facets: created_at (date), updated_at (date), closed_at (date)

type 2

  • pull 3
  • issue 1

state 1

  • closed 4

repo 1

  • xarray · 4 ✖
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
996352280 PR_kwDOAMm_X84rv1Fo 5794 Single matplotlib import Illviljan 14371165 closed 0     7 2021-09-14T19:15:12Z 2022-08-12T09:06:30Z 2021-10-24T09:54:28Z MEMBER   0 pydata/xarray/pulls/5794

Reduce number of imports inside functions. I think it helps making the code easier to read as well, as now you know that plt is always available.

  • [x] Tests added
  • [x] Passes pre-commit run --all-files
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst

Seems to not be a major difference in initial imports from (my small sample of) repeated tests:

This branch: ```python %timeit -n1 -r1 import xarray

3.81 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each) 3.83 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each) 3.87 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each) 3.7 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each) 3.77 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each) 3.91 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each) 3.8 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each)

np.mean([3.81, 3.83, 3.87, 3.7, 3.77, 3.91, 3.8]) Out[3]: 3.812857142857143 ```

Main: ```python %timeit -n1 -r1 import xarray

3.93 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each) 3.69 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each) 3.64 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each) 3.76 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each) 3.79 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each) 3.81 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each) 3.68 s ± 0 ns per loop (mean ± std. dev. of 1 run, 1 loop each)

np.mean([3.93, 3.69, 3.64, 3.76, 3.79, 3.81, 3.68]) Out[4]: 3.7571428571428567 ```

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5794/reactions",
    "total_count": 2,
    "+1": 2,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
972720354 MDExOlB1bGxSZXF1ZXN0NzE0Mjc0ODcw 5710 Fix errors in test_latex_name_isnt_split for min environments Illviljan 14371165 closed 0     7 2021-08-17T13:57:44Z 2021-08-18T03:02:25Z 2021-08-18T02:34:05Z MEMBER   0 pydata/xarray/pulls/5710

There's some error in the minimum environments (for example ubuntu-latest py37-bare-minimum) introduced in #5682 but was hidden in all other errors because of #5654: =========================== short test summary info ============================ ERROR xarray/tests/test_plot.py::test_latex_name_isnt_split - NameError: name... = 7908 passed, 4163 skipped, 202 xfailed, 42 xpassed, 89 warnings, 1 error in 279.31s (0:04:39) =

But when looking further in the details it mentions a completely different function crashing because matplotlib isn't installed, which is true but the function doesn't test any mpl-specific things. ``` ==================================== ERRORS ==================================== ___ ERROR at teardown of test_latex_name_isnt_split ____ [gw0] linux -- Python 3.7.10 /usr/share/miniconda/envs/xarray-tests/bin/python

@pytest.fixture(scope="function", autouse=True)
def test_all_figures_closed():
    """meta-test to ensure all figures are closed at the end of a test

    Notes:  Scope is kept to module (only invoke this function once per test
    module) else tests cannot be run in parallel (locally). Disadvantage: only
    catches one open figure per run. May still give a false positive if tests
    are run in parallel.
    """
    yield None
  open_figs = len(plt.get_fignums())

E NameError: name 'plt' is not defined

/home/runner/work/xarray/xarray/xarray/tests/test_plot.py:72: NameError ``` Might be something that pytest runs on every function. Not sure if there's a clean way of turning it off, but requiring matplotlib to be installed works of course.

  • [x] Passes pre-commit run --all-files
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5710/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
925664972 MDExOlB1bGxSZXF1ZXN0Njc0MDg1Mjk3 5502 Use integer type hints in chunk functions Illviljan 14371165 closed 0     7 2021-06-20T19:18:58Z 2021-07-02T16:07:43Z 2021-06-21T07:10:32Z MEMBER   0 pydata/xarray/pulls/5502

Attempt to fix errors found in #5365. I've changed it to integers because when does it ever make sense to input 1.5 or a complex number? It will always be forced to integers anyway: https://github.com/dask/dask/blob/8aea537d925b794a94f828d35211a5da05ad9dce/dask/array/core.py#L2815

Integers don't work with Numbers: xarray/core/computation.py:1576: error: Dict entry 0 has incompatible type "Hashable": "int"; expected "Hashable": "Union[None, Number, str, Tuple[Number, ...]]" [dict-item] xarray/core/computation.py:1576: error: Dict entry 0 has incompatible type "Hashable": "int"; expected "Hashable": "Union[None, Number, Tuple[Number, ...]]" [dict-item] xarray/core/computation.py:1536: error: Dict entry 0 has incompatible type "Hashable": "int"; expected "Hashable": "Union[None, Number, str, Tuple[Number, ...]]" [dict-item]

Floats don't work with Numbers: xarray/core/computation.py:1536: error: Dict entry 0 has incompatible type "Hashable": "int"; expected "Hashable": "Union[None, Number, str, Tuple[Number, ...]]" [dict-item] xarray/core/computation.py:1578: error: Dict entry 0 has incompatible type "Hashable": "float"; expected "Hashable": "Union[None, Number, str, Tuple[Number, ...]]" [dict-item] xarray/core/computation.py:1578: error: Dict entry 0 has incompatible type "Hashable": "float"; expected "Hashable": "Union[None, Number, Tuple[Number, ...]]" [dict-item] This workaround seems related to: https://github.com/python/mypy/issues/3186

  • [ ] Closes #xxxx
  • [ ] Tests added
  • [ ] Passes pre-commit run --all-files
  • [ ] User visible changes (including notable bug fixes) are documented in whats-new.rst
  • [ ] New functions/methods are listed in api.rst
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/5502/reactions",
    "total_count": 1,
    "+1": 1,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    xarray 13221727 pull
683954433 MDU6SXNzdWU2ODM5NTQ0MzM= 4367 Should __repr__ and __str__ be PEP8 compliant? Illviljan 14371165 closed 0     7 2020-08-22T08:10:15Z 2020-11-25T23:25:44Z 2020-11-25T23:25:44Z MEMBER      

Is your feature request related to a problem? Please describe. When creating docs with examples it would be nice if you could simply use print(ds) without being concerned about line lengths.

Describe the solution you'd like Limit line length so that a method docstring in a class can use print(ds) without breaking PEP8 conventions. So maximum line length for the ds.__repr__/ds.__str__ would be 79 - 4 - 4 = 71.

Example code Example where print(ds) creates lines longer than 79: ```python import numpy as np import pandas as pd import xarray as xr

class foo(): """ Test class.

(...)
"""

def bar():
    """
    Return 1.

    Examples
    --------
    Create data:

    >>> np.random.seed(0)
    >>> temperature = 15 + 8 * np.random.randn(2, 2, 3)
    >>> precipitation = 10 * np.random.rand(2, 2, 3)
    >>> lon = [[-99.83, -99.32], [-99.79, -99.23]]
    >>> lat = [[42.25, 42.21], [42.63, 42.59]]
    >>> time = pd.date_range("2014-09-06", periods=3)
    >>> reference_time = pd.Timestamp("2014-09-05")

    Initialize a dataset with multiple dimensions:

    >>> ds = xr.Dataset(
    ...     {
    ...         "temperature": (["x", "y", "time"], temperature),
    ...         "precipitation": (["x", "y", "time"], precipitation),
    ...     },
    ...     coords={
    ...         "lon": (["x", "y"], lon),
    ...         "lat": (["x", "y"], lat),
    ...         "time": time,
    ...         "reference_time": reference_time,
    ...     },
    ... )

    Print results:

    >>> print(ds.temperature.values[0])
    [[29.11241877 18.20125767 22.82990387]
     [32.92714559 29.94046392  7.18177696]]
    >>> print(ds)
    <xarray.Dataset>
    Dimensions:         (time: 3, x: 2, y: 2)
    Coordinates:
        lon             (x, y) float64 -99.83 -99.32 -99.79 -99.23
        lat             (x, y) float64 42.25 42.21 42.63 42.59
      * time            (time) datetime64[ns] 2014-09-06 2014-09-07 2014-09-08
        reference_time  datetime64[ns] 2014-09-05
    Dimensions without coordinates: x, y
    Data variables:
        temperature     (x, y, time) float64 29.11 18.2 22.83 ... 18.28 16.15 26.63
        precipitation   (x, y, time) float64 5.68 9.256 0.7104 ... 7.992 4.615 7.805
    >>> ds
    <xarray.Dataset>
    Dimensions:         (time: 3, x: 2, y: 2)
    Coordinates:
        lon             (x, y) float64 -99.83 -99.32 -99.79 -99.23
        lat             (x, y) float64 42.25 42.21 42.63 42.59
      * time            (time) datetime64[ns] 2014-09-06 2014-09-07 2014-09-08
        reference_time  datetime64[ns] 2014-09-05
    Dimensions without coordinates: x, y
    Data variables:
        temperature     (x, y, time) float64 29.11 18.2 22.83 ... 18.28 16.15 26.63
        precipitation   (x, y, time) float64 5.68 9.256 0.7104 ... 7.992 4.615 7.805
    """
    return 1

if name == 'main': import doctest doctest.testmod()

```

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

Advanced export

JSON shape: default, array, newline-delimited, object

CSV options:

CREATE TABLE [issues] (
   [id] INTEGER PRIMARY KEY,
   [node_id] TEXT,
   [number] INTEGER,
   [title] TEXT,
   [user] INTEGER REFERENCES [users]([id]),
   [state] TEXT,
   [locked] INTEGER,
   [assignee] INTEGER REFERENCES [users]([id]),
   [milestone] INTEGER REFERENCES [milestones]([id]),
   [comments] INTEGER,
   [created_at] TEXT,
   [updated_at] TEXT,
   [closed_at] TEXT,
   [author_association] TEXT,
   [active_lock_reason] TEXT,
   [draft] INTEGER,
   [pull_request] TEXT,
   [body] TEXT,
   [reactions] TEXT,
   [performed_via_github_app] TEXT,
   [state_reason] TEXT,
   [repo] INTEGER REFERENCES [repos]([id]),
   [type] TEXT
);
CREATE INDEX [idx_issues_repo]
    ON [issues] ([repo]);
CREATE INDEX [idx_issues_milestone]
    ON [issues] ([milestone]);
CREATE INDEX [idx_issues_assignee]
    ON [issues] ([assignee]);
CREATE INDEX [idx_issues_user]
    ON [issues] ([user]);
Powered by Datasette · Queries took 240.822ms · About: xarray-datasette