Skip to content

Commit

Permalink
Merge pull request #376 from davidhassell/dask-data
Browse files Browse the repository at this point in the history
dask: `Data.data`
  • Loading branch information
davidhassell authored Apr 12, 2022
2 parents 9413261 + 4fbbaab commit 872576a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cf/data/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -6051,11 +6051,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
10 changes: 10 additions & 0 deletions cf/test/test_Data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3967,6 +3967,16 @@ def test_Data_tolist(self):
self.assertEqual(e, np.array(x).tolist())
self.assertTrue(d.equals(cf.Data(e)))

def test_Data_data(self):
for d in [
cf.Data(1),
cf.Data([1, 2], fill_value=0),
cf.Data([1, 2], "m"),
cf.Data([1, 2], mask=[1,0], units="m"),
cf.Data([[0, 1, 2], [3, 4, 5]], chunks=2),
]:
self.assertIs(d.data, d)

def test_Data_dump(self):
d = cf.Data([1, 2], "m")
x = (
Expand Down

0 comments on commit 872576a

Please sign in to comment.