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 484499801,MDExOlB1bGxSZXF1ZXN0MzEwMzYxOTMz,3250,__slots__,6213168,closed,0,,,10,2019-08-23T12:16:44Z,2019-08-30T12:13:28Z,2019-08-29T17:14:20Z,MEMBER,,0,pydata/xarray/pulls/3250,"What changes: - Most classes now define ``__slots__`` - removed ``_initialized`` property - Enforced checks that all subclasses must also define ``__slots__``. For third-party subclasses, this is for now a DeprecationWarning and should be changed into a hard crash later on. - 22% reduction in RAM usage - 5% performance speedup for a DataArray method that performs a ``_to_temp_dataset`` roundtrip **DISCUSS:** support for third party subclasses is very poor at the moment (#1097). Should we skip the deprecation altogether? Performance benchmark: ```python import timeit import psutil import xarray a = xarray.DataArray([1, 2], dims=['x'], coords={'x': [10, 20]}) RUNS = 10000 t = timeit.timeit(""a.roll(x=1, roll_coords=True)"", globals=globals(), number=RUNS) print(""{:.0f} us"".format(t / RUNS * 1e6)) p = psutil.Process() N = 100000 rss0 = p.memory_info().rss x = [ xarray.DataArray([1, 2], dims=['x'], coords={'x': [10, 20]}) for _ in range(N) ] rss1 = p.memory_info().rss print(""{:.0f} bytes"".format((rss1 - rss0) / N)) ``` Output: | test | env | master | slots | |:-------------:|:---:|:----------:| ----------:| | DataArray.roll | py35-min | 332 us | 360 us | | DataArray.roll | py37 | 354 us | 337 us | | RAM usage of a DataArray | py35-min | 2755 bytes | 2074 bytes | | RAM usage of a DataArray | py37 | 1970 bytes | 1532 bytes | The performance degradation on Python 3.5 is caused by the deprecation mechanism - see changes to common.py. I honestly never realised that xarray objects are measured in kilobytes (vs. 32 bytes of underlying buffers!) ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3250/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull 467756080,MDExOlB1bGxSZXF1ZXN0Mjk3MzQwNTEy,3112,More annotations in Dataset,6213168,closed,0,,,10,2019-07-13T19:06:49Z,2019-08-01T10:41:51Z,2019-07-31T17:48:00Z,MEMBER,,0,pydata/xarray/pulls/3112,,"{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3112/reactions"", ""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull