Skip to content

Commit c6e48c2

Browse files
Update docs: API updates to tutorial code etc.
1 parent 2c3921c commit c6e48c2

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

docs/source/releases.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Documentation for all versions of cf.
1616
**CF-1.13**
1717
-----------
1818

19+
* `Version 3.21.0 <https://ncas-cms.github.io/cf-python-docs/3.21.0>`_ (2026-08-28)
1920
* `Version 3.20.1 <https://ncas-cms.github.io/cf-python-docs/3.20.1>`_ (2026-07-07)
2021
* `Version 3.20.0 <https://ncas-cms.github.io/cf-python-docs/3.20.0>`_ (2026-04-10)
2122
* `Version 3.19.0 <https://ncas-cms.github.io/cf-python-docs/3.19.0>`_ (2026-01-19)

docs/source/tutorial.rst

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4618,19 +4618,18 @@ All the of above examples use arrays in memory to construct the data
46184618
instances for the field and metadata constructs. It is, however,
46194619
possible to create data from arrays that reside on disk. The `cf.read`
46204620
function creates data in this manner. A pointer to an array in a
4621-
netCDF file can be stored in a `cf.NetCDF4Array` or
4622-
`~cf.H5netcdfAarray` instance, which is used to initialise a
4623-
`cf.Data` instance.
4621+
netCDF file can be stored in a `cf.XnetcdfArray` instance, which
4622+
is used to initialise a `cf.Data` instance.
46244623

46254624
.. code-block:: python
46264625
:caption: *Define a variable from a dataset with the netCDF package
4627-
and use it to create a NetCDF4Array instance with which
4626+
and use it to create a XnetcdfArray instance with which
46284627
to initialise a Data instance.*
46294628

46304629
>>> import netCDF4
46314630
>>> nc = netCDF4.Dataset('file.nc', 'r')
46324631
>>> v = nc.variables['ta']
4633-
>>> netcdf_array = cf.NetCDF4Array(filename='file.nc', address='ta',
4632+
>>> netcdf_array = cf.XnetcdfArray(filename='file.nc', address='ta',
46344633
... dtype=v.dtype, shape=v.shape)
46354634
>>> data_disk = cf.Data(netcdf_array)
46364635

@@ -4647,7 +4646,7 @@ netCDF file can be stored in a `cf.NetCDF4Array` or
46474646

46484647
Note that data type, number of dimensions, dimension sizes and number
46494648
of elements of the array on disk that are used to initialise the
4650-
`cf.NetCDF4Array` instance are those expected by the CF data model,
4649+
`cf.XnetcdfArray` instance are those expected by the CF data model,
46514650
which may be different to those of the netCDF variable in the file
46524651
(although they are the same in the above example). For example, a
46534652
netCDF character array of shape ``(12, 9)`` is viewed in cf as a
@@ -5393,7 +5392,7 @@ in that file:
53935392
>>> h = cf.example_field(0)
53945393
>>> h
53955394
<CF Field: specific_humidity(latitude(5), longitude(8)) 1>
5396-
>>> cf.write(h, 'append-example-file.nc', mode='a', netcdf_backend='netCDF4')
5395+
>>> cf.write(h, 'append-example-file.nc', mode='a', backend='netCDF4')
53975396
>>> cf.read('append-example-file.nc')
53985397
[<CF Field: air_potential_temperature(time(36), latitude(5), longitude(8)) K>,
53995398
<CF Field: specific_humidity(latitude(5), longitude(8)) 1>]
@@ -6876,7 +6875,7 @@ method:
68766875

68776876
>>> q, t = cf.read('file.nc')
68786877
>>> t.set_quantize_on_write(algorithm='bitgroom', quantization_nsd=1)
6879-
>>> cf.write(t, 'quantized.nc', netcdf_backend='netCDF4')
6878+
>>> cf.write(t, 'quantized.nc', backend='netCDF4')
68806879
>>> quantized = cf.read('quantized.nc')[0]
68816880
>>> c = quantized.get_quantization()
68826881
>>> c

0 commit comments

Comments
 (0)