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/5640#issuecomment-888418180,https://api.github.com/repos/pydata/xarray/issues/5640,888418180,IC_kwDOAMm_X8409C-E,41898282,2021-07-28T15:46:37Z,2021-09-29T16:34:00Z,CONTRIBUTOR,"## Unit Test Results
6 files ±0 6 suites ±0 57m 49s [:stopwatch:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols ""duration of all tests"") ±0s
16 227 tests ±0 14 492 [:heavy_check_mark:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols ""passed tests"") ±0 1 735 [:zzz:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols ""skipped / disabled tests"") ±0 0 [:x:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols ""failed tests"") ±0
90 558 runs ±0 82 384 [:heavy_check_mark:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols ""passed tests"") ±0 8 174 [:zzz:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols ""skipped / disabled tests"") ±0 0 [:x:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols ""failed tests"") ±0
Results for commit 43409090. ± Comparison against base commit 43409090.
:recycle: This comment has been updated with latest results.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,954574705
https://github.com/pydata/xarray/pull/5640#issuecomment-930318312,https://api.github.com/repos/pydata/xarray/issues/5640,930318312,IC_kwDOAMm_X843c4fo,2448579,2021-09-29T16:05:53Z,2021-09-29T16:05:53Z,MEMBER,"Thanks @lusewell and @spencerkclark
Unfortunately we don't do backports.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,954574705
https://github.com/pydata/xarray/pull/5640#issuecomment-917924524,https://api.github.com/repos/pydata/xarray/issues/5640,917924524,IC_kwDOAMm_X842tmqs,3801015,2021-09-13T07:39:22Z,2021-09-13T07:39:22Z,CONTRIBUTOR,Fixed other usages and added to `whats-new.rst`,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,954574705
https://github.com/pydata/xarray/pull/5640#issuecomment-916860922,https://api.github.com/repos/pydata/xarray/issues/5640,916860922,IC_kwDOAMm_X842pi_6,6628425,2021-09-10T12:16:45Z,2021-09-10T12:16:45Z,MEMBER,"Thanks for catching that additional spot.
> Its only a performance issue to attempt to import cftime repeatedly. Having it fail once in the top level import is not a big problem.
Yes, understood. I just prefer that we are consistent across the code base -- either we use this pattern only where absolutely necessary or we use it everywhere. In light of that do you mind introducing this pattern in `times.py` as well? There are two places where cftime is imported within functions there too:
https://github.com/pydata/xarray/blob/7bfee3eaa8fd731494cf6b406d6abb4bec061001/xarray/coding/times.py#L167
https://github.com/pydata/xarray/blob/7bfee3eaa8fd731494cf6b406d6abb4bec061001/xarray/coding/times.py#L417
I think we don't have to worry about the tests, because they already follow this pattern to an extent; in building the `requires_cftime` decorator, a cftime import is only attempted once.
After that, just fix the linting error and add [a what's new entry](https://github.com/pydata/xarray/blob/main/doc/whats-new.rst), and I think this should be ready to go from my perspective.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,954574705
https://github.com/pydata/xarray/pull/5640#issuecomment-916837170,https://api.github.com/repos/pydata/xarray/issues/5640,916837170,IC_kwDOAMm_X842pdMy,3801015,2021-09-10T11:36:35Z,2021-09-10T11:36:35Z,CONTRIBUTOR,"@spencerkclark
RE perfomance.
Its only a performance issue to attempt to import cftime repeatedly. Having it fail once in the top level import is not a big problem. The issue comes when it does it thousands of times every time you try and `.sel` or `.isel`, which then adds up to a huge performance hit. Given xarray takes a while to import anyway, the marginal cost of search ing the full pythonpath 3 times in import is minimal - only an issue when done repeatedly.
I've fixed this for some other cases I've found that were causing me slowness - would like me to changeanythinng else before this can be merged?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,954574705
https://github.com/pydata/xarray/pull/5640#issuecomment-916834298,https://api.github.com/repos/pydata/xarray/issues/5640,916834298,IC_kwDOAMm_X842pcf6,3801015,2021-09-10T11:30:47Z,2021-09-10T11:30:47Z,CONTRIBUTOR,So i've found another instance of this which causes a performance issue - this one with groupby.,"{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,954574705
https://github.com/pydata/xarray/pull/5640#issuecomment-888434763,https://api.github.com/repos/pydata/xarray/issues/5640,888434763,IC_kwDOAMm_X8409HBL,2448579,2021-07-28T16:08:31Z,2021-07-28T16:08:31Z,MEMBER,"doesn't look like it?

","{""total_count"": 1, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 1}",,954574705
https://github.com/pydata/xarray/pull/5640#issuecomment-888411101,https://api.github.com/repos/pydata/xarray/issues/5640,888411101,IC_kwDOAMm_X8409BPd,35968931,2021-07-28T15:37:06Z,2021-07-28T15:37:55Z,MEMBER,"But in both cases we always check for the existence of cftime via `import cftime`, so *if* python is clever enough to remember that cftime doesn't exist the second time it's asked to import it, then where is the opportunity for speedup?
Hopefully @lusewell can enlighten us :sweat_smile: ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,954574705
https://github.com/pydata/xarray/pull/5640#issuecomment-888403170,https://api.github.com/repos/pydata/xarray/issues/5640,888403170,IC_kwDOAMm_X8408_Ti,2448579,2021-07-28T15:26:20Z,2021-07-28T15:26:20Z,MEMBER,I guess it always tries importing if the module doesn't exist and so that's a slowdown?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,954574705
https://github.com/pydata/xarray/pull/5640#issuecomment-888379766,https://api.github.com/repos/pydata/xarray/issues/5640,888379766,IC_kwDOAMm_X84085l2,35968931,2021-07-28T14:57:11Z,2021-07-28T14:57:11Z,MEMBER,"Thanks for the suggestion @lusewell .
I'm a bit confused as to how exactly this improves performance though - you've moved the location of the `import cftime` statement to the top of the file, but I was under the impression that [python doesn't ever import a module more than once](https://stackoverflow.com/questions/19077381/what-happens-when-a-module-is-imported-twice), because [after the first time it's a fast hash lookup](https://stackoverflow.com/questions/296036/does-python-optimize-modules-when-they-are-imported-multiple-times). So surely in both cases we only look for the existence of `cftime` once? Perhaps I've misunderstood though?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,954574705
https://github.com/pydata/xarray/pull/5640#issuecomment-888122071,https://api.github.com/repos/pydata/xarray/issues/5640,888122071,IC_kwDOAMm_X84076rX,3801015,2021-07-28T08:32:44Z,2021-07-28T08:32:44Z,CONTRIBUTOR,I'd also like to append this to tag 14.1 and make tag 14.2 if possible - would this be ok?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,954574705