Skip to content

Commit 1c1b4e6

Browse files
authored
Merge pull request #376 from davidhassell/cached-elements
Control setting and display of cached data elements
2 parents 763673e + bed2b12 commit 1c1b4e6

30 files changed

+802
-191
lines changed

Changelog.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,19 @@ Version NEXTVERSION
88
(https://github.com/NCAS-CMS/cfdm/issues/354)
99
* Read Zarr v2 and v3 datasets that contain a group hierarchy with
1010
`cfdm.read` (https://github.com/NCAS-CMS/cfdm/issues/355)
11-
* New function `cfdm.dataset_flatten` that replaces the deprecated
11+
* New function `cfdm.dataset_flatten` that replaces the deprecated*
1212
`cfdm.netcdf_flatten` (https://github.com/NCAS-CMS/cfdm/issues/355)
13+
* New function to control the creation of cached elements during data
14+
display: `cfdm.display_data`
15+
(https://github.com/NCAS-CMS/cfdm/issues/363)
16+
* New methods: `cfdm.Data.get_cached_elements`,
17+
`cfdm.Data.cache_elements`
18+
(https://github.com/NCAS-CMS/cfdm/issues/363)
19+
* Set cached elements during `cfdm.Data.__init__`
20+
(https://github.com/NCAS-CMS/cfdm/issues/363)
21+
* Removed the `cfdm.constants.CONSTANTS` dictionary, replacing it
22+
with `cfdm.ConstantAccess.constants`
23+
(https://github.com/NCAS-CMS/cfdm/issues/361)
1324
* Reduce the time taken to import `cfdm`
1425
(https://github.com/NCAS-CMS/cfdm/issues/361)
1526
* New optional dependency: ``zarr>=3.1.3``

cfdm/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
chunksize,
6161
configuration,
6262
dirname,
63+
display_data,
6364
environment,
6465
integer_dtype,
6566
log_level,

cfdm/auxiliarycoordinate.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class AuxiliaryCoordinate(
4949
def dump(
5050
self,
5151
display=True,
52+
data=None,
5253
_omit_properties=None,
5354
_key=None,
5455
_level=0,
@@ -65,6 +66,10 @@ def dump(
6566
6667
:Parameters:
6768
69+
{{data: `bool` or `None`, optional}}
70+
71+
.. versionadded:: (cfdm) NEXTVERSION
72+
6873
display: `bool`, optional
6974
If False then return the description as a string. By
7075
default the description is printed.
@@ -78,6 +83,7 @@ def dump(
7883
_title = "Auxiliary coordinate: " + self.identity(default="")
7984

8085
return super().dump(
86+
data=data,
8187
display=display,
8288
_key=_key,
8389
_level=_level,

cfdm/bounds.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class Bounds(
4747

4848
def dump(
4949
self,
50+
data=None,
5051
display=True,
5152
_key=None,
5253
_title=None,
@@ -66,6 +67,10 @@ def dump(
6667
6768
:Parameters:
6869
70+
{{data: `bool` or `None`, optional}}
71+
72+
.. versionadded:: (cfdm) NEXTVERSION
73+
6974
display: `bool`, optional
7075
If False then return the description as a string. By
7176
default the description is printed.
@@ -79,6 +84,7 @@ def dump(
7984
_title = "Bounds: " + self.identity(default="")
8085

8186
return super().dump(
87+
data=data,
8288
display=display,
8389
_key=_key,
8490
_omit_properties=_omit_properties,

cfdm/cellconnectivity.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def creation_commands(
127127

128128
def dump(
129129
self,
130+
data=None,
130131
display=True,
131132
_omit_properties=None,
132133
_key=None,
@@ -144,6 +145,10 @@ def dump(
144145
145146
:Parameters:
146147
148+
{{data: `bool` or `None`, optional}}
149+
150+
.. versionadded:: (cfdm) NEXTVERSION
151+
147152
display: `bool`, optional
148153
If False then return the description as a string. By
149154
default the description is printed.
@@ -157,6 +162,7 @@ def dump(
157162
_title = "Cell Connectivity: " + self.identity(default="")
158163

159164
return super().dump(
165+
data=data,
160166
display=display,
161167
_key=_key,
162168
_omit_properties=_omit_properties,

cfdm/cellmeasure.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ def creation_commands(
120120

121121
def dump(
122122
self,
123+
data=None,
123124
display=True,
124125
_omit_properties=None,
125126
_key=None,
@@ -137,6 +138,10 @@ def dump(
137138
138139
:Parameters:
139140
141+
{{data: `bool` or `None`, optional}}
142+
143+
.. versionadded:: (cfdm) NEXTVERSION
144+
140145
display: `bool`, optional
141146
If False then return the description as a string. By
142147
default the description is printed.
@@ -161,6 +166,7 @@ def dump(
161166
_title += f" (external variable: {ncvar})"
162167

163168
return super().dump(
169+
data=data,
164170
display=display,
165171
_key=_key,
166172
_omit_properties=_omit_properties,

cfdm/count.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class Count(
4343

4444
def dump(
4545
self,
46+
data=None,
4647
display=True,
4748
_key=None,
4849
_title=None,
@@ -62,6 +63,10 @@ def dump(
6263
6364
:Parameters:
6465
66+
{{data: `bool` or `None`, optional}}
67+
68+
.. versionadded:: (cfdm) NEXTVERSION
69+
6570
display: `bool`, optional
6671
If False then return the description as a string. By
6772
default the description is printed.
@@ -75,6 +80,7 @@ def dump(
7580
_title = "Count: " + self.identity(default="")
7681

7782
return super().dump(
83+
data=data,
7884
display=display,
7985
_key=_key,
8086
_omit_properties=_omit_properties,

0 commit comments

Comments
 (0)