@@ -131,7 +131,7 @@ We can easily get all of the associated metadata of the :class:`~iris.cube.Cube`
131131using the ``metadata `` property:
132132
133133    >>> cube.metadata 
134-     CubeMetadata(standard_name='air_temperature', long_name=None, var_name='air_temperature', units=Unit('K'), attributes={ 'Conventions': 'CF-1.5', 'STASH': STASH(model=1, section=3, item=236), 'Model scenario': 'A1B', 'source': 'Data from Met Office Unified Model 6.05'}, cell_methods=(CellMethod(method='mean', coord_names=('time',), intervals=('6 hour',), comments=()),)) 
134+     CubeMetadata(standard_name='air_temperature', long_name=None, var_name='air_temperature', units=Unit('K'), attributes=CubeAttrsDict(globals={}, locals={ 'Conventions': 'CF-1.5', 'STASH': STASH(model=1, section=3, item=236), 'Model scenario': 'A1B', 'source': 'Data from Met Office Unified Model 6.05'}) , cell_methods=(CellMethod(method='mean', coord_names=('time',), intervals=('6 hour',), comments=()),)) 
135135
136136We can also inspect the ``metadata `` of the ``longitude ``
137137:class: `~iris.coords.DimCoord ` attached to the :class: `~iris.cube.Cube ` in the same way:
@@ -675,8 +675,8 @@ For example, consider the following :class:`~iris.common.metadata.CubeMetadata`,
675675
676676.. doctest :: metadata-combine 
677677
678-     >>> cube.metadata   #  doctest: +SKIP  
679-     CubeMetadata(standard_name='air_temperature', long_name=None, var_name='air_temperature', units=Unit('K'), attributes={ 'Conventions': 'CF-1.5', 'STASH': STASH(model=1, section=3, item=236), 'Model scenario': 'A1B', 'source': 'Data from Met Office Unified Model 6.05'}, cell_methods=(CellMethod(method='mean', coord_names=('time',), intervals=('6 hour',), comments=()),)) 
678+     >>> cube.metadata 
679+     CubeMetadata(standard_name='air_temperature', long_name=None, var_name='air_temperature', units=Unit('K'), attributes=CubeAttrsDict(globals={}, locals={ 'Conventions': 'CF-1.5', 'STASH': STASH(model=1, section=3, item=236), 'Model scenario': 'A1B', 'source': 'Data from Met Office Unified Model 6.05'}) , cell_methods=(CellMethod(method='mean', coord_names=('time',), intervals=('6 hour',), comments=()),)) 
680680
681681We can perform the **identity function ** by comparing the metadata with itself,
682682
@@ -701,7 +701,7 @@ which is replaced with a **different value**,
701701    >>> metadata !=  cube.metadata 
702702    True 
703703    >>> metadata.combine(cube.metadata)  #  doctest: +SKIP 
704-     CubeMetadata(standard_name=None, long_name=None, var_name='air_temperature', units=Unit('K'), attributes={'STASH': STASH(model=1, section=3, item=236), 'source': 'Data from Met Office Unified Model 6.05', 'Model scenario': 'A1B', 'Conventions': 'CF-1.5 '}, cell_methods=(CellMethod(method='mean', coord_names=('time',), intervals=('6 hour',), comments=()),)) 
704+     CubeMetadata(standard_name=None, long_name=None, var_name='air_temperature', units=Unit('K'), attributes={'Conventions': 'CF-1.5', 'Model scenario': 'A1B', ' STASH': STASH(model=1, section=3, item=236), 'source': 'Data from Met Office Unified Model 6.05'}, cell_methods=(CellMethod(method='mean', coord_names=('time',), intervals=('6 hour',), comments=()),)) 
705705
706706The ``combine `` method combines metadata by performing a **strict ** comparison
707707between each of the associated metadata member values,
@@ -810,16 +810,17 @@ the ``from_metadata`` class method. For example, given the following
810810
811811.. doctest :: metadata-convert 
812812
813-     >>> cube.metadata   #  doctest: +SKIP  
814-     CubeMetadata(standard_name='air_temperature', long_name=None, var_name='air_temperature', units=Unit('K'), attributes={ 'Conventions': 'CF-1.5', 'STASH': STASH(model=1, section=3, item=236), 'Model scenario': 'A1B', 'source': 'Data from Met Office Unified Model 6.05'}, cell_methods=(CellMethod(method='mean', coord_names=('time',), intervals=('6 hour',), comments=()),)) 
813+     >>> cube.metadata 
814+     CubeMetadata(standard_name='air_temperature', long_name=None, var_name='air_temperature', units=Unit('K'), attributes=CubeAttrsDict(globals={}, locals={ 'Conventions': 'CF-1.5', 'STASH': STASH(model=1, section=3, item=236), 'Model scenario': 'A1B', 'source': 'Data from Met Office Unified Model 6.05'}) , cell_methods=(CellMethod(method='mean', coord_names=('time',), intervals=('6 hour',), comments=()),)) 
815815
816816We can easily convert it to a :class: `~iris.common.metadata.DimCoordMetadata ` instance
817817using ``from_metadata ``,
818818
819819.. doctest :: metadata-convert 
820820
821-     >>> DimCoordMetadata.from_metadata(cube.metadata)  #  doctest: +SKIP 
822-     DimCoordMetadata(standard_name='air_temperature', long_name=None, var_name='air_temperature', units=Unit('K'), attributes={'Conventions': 'CF-1.5', 'STASH': STASH(model=1, section=3, item=236), 'Model scenario': 'A1B', 'source': 'Data from Met Office Unified Model 6.05'}, coord_system=None, climatological=None, circular=None) 
821+     >>> newmeta =  DimCoordMetadata.from_metadata(cube.metadata) 
822+     >>> print (newmeta)
823+     DimCoordMetadata(standard_name=air_temperature, var_name=air_temperature, units=K, attributes={'Conventions': 'CF-1.5', 'STASH': STASH(model=1, section=3, item=236), 'Model scenario': 'A1B', 'source': 'Data from Met Office Unified Model 6.05'}) 
823824
824825By examining :numref: `metadata members table `, we can see that the
825826:class: `~iris.cube.Cube ` and :class: `~iris.coords.DimCoord ` container
@@ -849,9 +850,9 @@ class instance,
849850
850851.. doctest :: metadata-convert 
851852
852-      >>> longitude.metadata.from_metadata(cube.metadata) 
853-      DimCoordMetadata(standard_name='air_temperature', long_name=None, var_name='air_temperature', units=Unit('K'), attributes={'Conventions': 'CF-1.5', 'STASH': STASH(model=1, section=3, item=236), 'Model scenario': 'A1B', 'source': 'Data from Met Office Unified Model 6.05'}, coord_system=None, climatological=None, circular=None )
854- 
853+    >>>  newmeta  =  longitude.metadata.from_metadata(cube.metadata)
854+    >>>  print (newmeta )
855+     DimCoordMetadata(standard_name=air_temperature, var_name=air_temperature, units=K, attributes={'Conventions': 'CF-1.5', 'STASH': STASH(model=1, section=3, item=236), 'Model scenario': 'A1B', 'source': 'Data from Met Office Unified Model 6.05'}) 
855856
856857.. _metadata assignment :
857858
@@ -978,7 +979,7 @@ Indeed, it's also possible to assign to the ``metadata`` property with a
978979    >>> longitude.metadata 
979980    DimCoordMetadata(standard_name='longitude', long_name=None, var_name='longitude', units=Unit('degrees'), attributes={}, coord_system=GeogCS(6371229.0), climatological=False, circular=False) 
980981    >>> longitude.metadata =  cube.metadata 
981-     >>> longitude.metadata   #  doctest: +SKIP  
982+     >>> longitude.metadata 
982983    DimCoordMetadata(standard_name='air_temperature', long_name=None, var_name='air_temperature', units=Unit('K'), attributes={'Conventions': 'CF-1.5', 'STASH': STASH(model=1, section=3, item=236), 'Model scenario': 'A1B', 'source': 'Data from Met Office Unified Model 6.05'}, coord_system=GeogCS(6371229.0), climatological=False, circular=False) 
983984
984985Note that, only **common ** metadata members will be assigned new associated
0 commit comments