home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 996352280

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
996352280 PR_kwDOAMm_X84rv1Fo 5794 Single matplotlib import 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
}
    13221727 pull

Links from other tables

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