File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -933,6 +933,9 @@ def __init__(self, obj):
933
933
self ._obj = obj
934
934
self ._all_cell_measures = None
935
935
936
+ def __setstate__ (self , d ):
937
+ self .__dict__ = d
938
+
936
939
def _assert_valid_other_comparison (self , other ):
937
940
flag_dict = create_flag_dict (self ._obj )
938
941
if other not in flag_dict :
Original file line number Diff line number Diff line change 1
1
import itertools
2
+ import pickle
2
3
from textwrap import dedent
3
4
from urllib .request import urlopen
4
5
@@ -1545,3 +1546,10 @@ def test_missing_variables():
1545
1546
ds = vert .copy (deep = True )
1546
1547
ds = ds .drop_vars ("ap" )
1547
1548
assert ds .cf .formula_terms == {"lev" : {"b" : "b" , "ps" : "ps" }}
1549
+
1550
+
1551
+ def test_pickle ():
1552
+ da = xr .DataArray ([1.0 ], name = "a" )
1553
+ ds = da .to_dataset ()
1554
+ pickle .loads (pickle .dumps (da .cf ))
1555
+ pickle .loads (pickle .dumps (ds .cf ))
You can’t perform that action at this time.
0 commit comments