Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dask: Data.data #376

Merged
merged 3 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cf/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5988,11 +5988,13 @@ def Units(self):
)

@property
@daskified(_DASKIFIED_VERBOSE)
def data(self):
"""The data as an object identity.

**Examples:**
**Examples**

>>> d = cf.Data([1, 2], 'm')
>>> d.data is d
True

Expand Down
3 changes: 1 addition & 2 deletions cf/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from collections.abc import Iterable
from itertools import product
from marshal import dumps
from math import ceil as math_ceil
from numbers import Integral
from os import getpid, listdir, mkdir
from os.path import abspath as _os_path_abspath
Expand All @@ -25,9 +24,9 @@

import cfdm
import netCDF4
import numpy as np
from dask import config
from dask.utils import parse_bytes
import numpy as np
from numpy import __file__ as _numpy__file__
from numpy import __version__ as _numpy__version__
from numpy import all as _numpy_all
Expand Down
4 changes: 4 additions & 0 deletions cf/test/test_Data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3938,6 +3938,10 @@ def test_Data_tolist(self):
self.assertEqual(e, np.array(x).tolist())
self.assertTrue(d.equals(cf.Data(e)))

def test_Data_data(self):
d = cf.Data([1, 2], "m")
self.assertIs(d.data, d)
davidhassell marked this conversation as resolved.
Show resolved Hide resolved


if __name__ == "__main__":
print("Run date:", datetime.datetime.now())
Expand Down