You are viewing the latest unreleased documentation 3.10.0.dev14. You can switch to a stable version.

iris.experimental.ugrid.metadata#

The common metadata API classes for iris.experimental.ugrid.mesh.

Eventual destination: iris.common.metadata.

class iris.experimental.ugrid.metadata.ConnectivityMetadata(standard_name, long_name, var_name, units, attributes, cf_role, start_index, location_axis)[source]#

Bases: ConnectivityMetadataNamedtuple, BaseMetadata

Metadata container for a Connectivity.

Create new instance of ConnectivityMetadataNamedtuple(standard_name, long_name, var_name, units, attributes, cf_role, start_index, location_axis)

DEFAULT_NAME = 'unknown'#
attributes#

Alias for field number 4

cf_role#

Alias for field number 5

combine(other, lenient=None)[source]#

Return a new metadata instance created by combining each of the associated metadata members.

Parameters:
  • other (metadata) – A metadata instance of the same type.

  • lenient (bool, optional) – Enable/disable lenient combination. The default is to automatically detect whether this lenient operation is enabled.

Return type:

Metadata instance.

count(value, /)#

Return number of occurrences of value.

difference(other, lenient=None)[source]#

Perform lenient metadata difference operation.

Return a new metadata instance created by performing a difference comparison between each of the associated metadata members.

A metadata member returned with a value of “None” indicates that there is no difference between the members being compared. Otherwise, a tuple of the different values is returned.

Parameters:
  • other (metadata) – A metadata instance of the same type.

  • lenient (bool, optional) – Enable/disable lenient difference. The default is to automatically detect whether this lenient operation is enabled.

Return type:

Metadata instance of member differences or None.

equal(other, lenient=None)[source]#

Determine whether the associated metadata members are equivalent.

Parameters:
  • other (metadata) – A metadata instance of the same type.

  • lenient (bool, optional) – Enable/disable lenient equivalence. The default is to automatically detect whether this lenient operation is enabled.

Return type:

bool

classmethod from_metadata(other)#

Convert metadata instance to this metadata type.

Convert the provided metadata instance from a different type to this metadata type, using only the relevant metadata members.

Non-common metadata members are set to None.

Parameters:

other (metadata) – A metadata instance of any type.

Return type:

New metadata instance.

index(value, start=0, stop=9223372036854775807, /)#

Return first index of value.

Raises ValueError if the value is not present.

location_axis#

Alias for field number 7

long_name#

Alias for field number 1

name(default=None, token=False)#

Return a string name representing the identity of the metadata.

First it tries standard name, then it tries the long name, then the NetCDF variable name, before falling-back to a default value, which itself defaults to the string ‘unknown’.

Parameters:
  • default (optional) – The fall-back string representing the default name. Defaults to the string ‘unknown’.

  • token (bool, default=False) – If True, ensures that the name returned satisfies the criteria for the characters required by a valid NetCDF name. If it is not possible to return a valid name, then a ValueError exception is raised. Defaults to False.

Return type:

str

standard_name#

Alias for field number 0

start_index#

Alias for field number 6

classmethod token(name)#

Verify validity of provided NetCDF name.

Determine whether the provided name is a valid NetCDF name and thus safe to represent a single parsable token.

Parameters:

name (str) – The string name to verify.

Return type:

The provided name if valid, otherwise None.

units#

Alias for field number 3

var_name#

Alias for field number 2

class iris.experimental.ugrid.metadata.MeshCoordMetadata(standard_name, long_name, var_name, units, attributes, location, axis)[source]#

Bases: MeshCoordMetadataNamedtuple, BaseMetadata

Metadata container for a MeshCoord.

Create new instance of MeshCoordMetadataNamedtuple(standard_name, long_name, var_name, units, attributes, location, axis)

DEFAULT_NAME = 'unknown'#
attributes#

Alias for field number 4

axis#

Alias for field number 6

combine(other, lenient=None)[source]#

Return a new metadata instance created by combining each of the associated metadata members.

Parameters:
  • other (metadata) – A metadata instance of the same type.

  • lenient (bool, optional) – Enable/disable lenient combination. The default is to automatically detect whether this lenient operation is enabled.

Return type:

Metadata instance.

count(value, /)#

Return number of occurrences of value.

difference(other, lenient=None)[source]#

Perform lenient metadata difference operation.

Return a new metadata instance created by performing a difference comparison between each of the associated metadata members.

A metadata member returned with a value of “None” indicates that there is no difference between the members being compared. Otherwise, a tuple of the different values is returned.

Parameters:
  • other (metadata) – A metadata instance of the same type.

  • lenient (bool, optional) – Enable/disable lenient difference. The default is to automatically detect whether this lenient operation is enabled.

Return type:

Metadata instance of member differences or None.

equal(other, lenient=None)[source]#

Determine whether the associated metadata members are equivalent.

Parameters:
  • other (metadata) – A metadata instance of the same type.

  • lenient (bool, optional) – Enable/disable lenient equivalence. The default is to automatically detect whether this lenient operation is enabled.

Return type:

bool

classmethod from_metadata(other)#

Convert metadata instance to this metadata type.

Convert the provided metadata instance from a different type to this metadata type, using only the relevant metadata members.

Non-common metadata members are set to None.

Parameters:

other (metadata) – A metadata instance of any type.

Return type:

New metadata instance.

index(value, start=0, stop=9223372036854775807, /)#

Return first index of value.

Raises ValueError if the value is not present.

location#

Alias for field number 5

long_name#

Alias for field number 1

name(default=None, token=False)#

Return a string name representing the identity of the metadata.

First it tries standard name, then it tries the long name, then the NetCDF variable name, before falling-back to a default value, which itself defaults to the string ‘unknown’.

Parameters:
  • default (optional) – The fall-back string representing the default name. Defaults to the string ‘unknown’.

  • token (bool, default=False) – If True, ensures that the name returned satisfies the criteria for the characters required by a valid NetCDF name. If it is not possible to return a valid name, then a ValueError exception is raised. Defaults to False.

Return type:

str

standard_name#

Alias for field number 0

classmethod token(name)#

Verify validity of provided NetCDF name.

Determine whether the provided name is a valid NetCDF name and thus safe to represent a single parsable token.

Parameters:

name (str) – The string name to verify.

Return type:

The provided name if valid, otherwise None.

units#

Alias for field number 3

var_name#

Alias for field number 2

class iris.experimental.ugrid.metadata.MeshMetadata(standard_name, long_name, var_name, units, attributes, topology_dimension, node_dimension, edge_dimension, face_dimension)[source]#

Bases: MeshMetadataNamedtuple, BaseMetadata

Metadata container for a Mesh.

Create new instance of MeshMetadataNamedtuple(standard_name, long_name, var_name, units, attributes, topology_dimension, node_dimension, edge_dimension, face_dimension)

DEFAULT_NAME = 'unknown'#
attributes#

Alias for field number 4

combine(other, lenient=None)[source]#

Return a new metadata instance created by combining each of the associated metadata members.

Parameters:
  • other (metadata) – A metadata instance of the same type.

  • lenient (bool, optional) – Enable/disable lenient combination. The default is to automatically detect whether this lenient operation is enabled.

Return type:

Metadata instance.

count(value, /)#

Return number of occurrences of value.

difference(other, lenient=None)[source]#

Perform lenient metadata difference operation.

Return a new metadata instance created by performing a difference comparison between each of the associated metadata members.

A metadata member returned with a value of “None” indicates that there is no difference between the members being compared. Otherwise, a tuple of the different values is returned.

Parameters:
  • other (metadata) – A metadata instance of the same type.

  • lenient (bool, optional) – Enable/disable lenient difference. The default is to automatically detect whether this lenient operation is enabled.

Return type:

Metadata instance of member differences or None.

edge_dimension#

Alias for field number 7

equal(other, lenient=None)[source]#

Determine whether the associated metadata members are equivalent.

Parameters:
  • other (metadata) – A metadata instance of the same type.

  • lenient (bool, optional) – Enable/disable lenient equivalence. The default is to automatically detect whether this lenient operation is enabled.

Return type:

bool

face_dimension#

Alias for field number 8

classmethod from_metadata(other)#

Convert metadata instance to this metadata type.

Convert the provided metadata instance from a different type to this metadata type, using only the relevant metadata members.

Non-common metadata members are set to None.

Parameters:

other (metadata) – A metadata instance of any type.

Return type:

New metadata instance.

index(value, start=0, stop=9223372036854775807, /)#

Return first index of value.

Raises ValueError if the value is not present.

long_name#

Alias for field number 1

name(default=None, token=False)#

Return a string name representing the identity of the metadata.

First it tries standard name, then it tries the long name, then the NetCDF variable name, before falling-back to a default value, which itself defaults to the string ‘unknown’.

Parameters:
  • default (optional) – The fall-back string representing the default name. Defaults to the string ‘unknown’.

  • token (bool, default=False) – If True, ensures that the name returned satisfies the criteria for the characters required by a valid NetCDF name. If it is not possible to return a valid name, then a ValueError exception is raised. Defaults to False.

Return type:

str

node_dimension#

Alias for field number 6

standard_name#

Alias for field number 0

classmethod token(name)#

Verify validity of provided NetCDF name.

Determine whether the provided name is a valid NetCDF name and thus safe to represent a single parsable token.

Parameters:

name (str) – The string name to verify.

Return type:

The provided name if valid, otherwise None.

topology_dimension#

Alias for field number 5

units#

Alias for field number 3

var_name#

Alias for field number 2