You are viewing the latest unreleased documentation v3.3.dev0. You may prefer a stable version.

iris.experimental.ugrid.metadata#

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

Eventual destination: iris.common.metadata.

In this module:

Metadata container for a Connectivity.

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

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

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

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

Args:

  • other (metadata):

    A metadata instance of the same type.

Kwargs:

  • lenient (boolean):

    Enable/disable lenient combination. The default is to automatically detect whether this lenient operation is enabled.

Returns

Metadata instance.

count(value, /)#

Return number of occurrences of value.

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

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.

Args:

  • other (metadata):

    A metadata instance of the same type.

Kwargs:

  • lenient (boolean):

    Enable/disable lenient difference. The default is to automatically detect whether this lenient operation is enabled.

Returns

Metadata instance of member differences or None.

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

Determine whether the associated metadata members are equivalent.

Args:

  • other (metadata):

    A metadata instance of the same type.

Kwargs:

  • lenient (boolean):

    Enable/disable lenient equivalence. The default is to automatically detect whether this lenient operation is enabled.

Returns

Boolean.

classmethod from_metadata(other)#

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.

Args:

  • other (metadata):

    A metadata instance of any type.

Returns

New metadata instance.

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

Return first index of value.

Raises ValueError if the value is not present.

name(default=None, token=False)#

Returns 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’.

Kwargs:

  • default:

    The fall-back string representing the default name. Defaults to the string ‘unknown’.

  • token:

    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.

Returns

String.

classmethod token(name)#

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

Args:

  • name:

    The string name to verify

Returns

The provided name if valid, otherwise None.

DEFAULT_NAME = 'unknown'#
attributes#

Alias for field number 4

cf_role#

Alias for field number 5

location_axis#

Alias for field number 7

long_name#

Alias for field number 1

standard_name#

Alias for field number 0

start_index#

Alias for field number 6

units#

Alias for field number 3

var_name#

Alias for field number 2

↑ top ↑

Metadata container for a MeshCoord.

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

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

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

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

Args:

  • other (metadata):

    A metadata instance of the same type.

Kwargs:

  • lenient (boolean):

    Enable/disable lenient combination. The default is to automatically detect whether this lenient operation is enabled.

Returns

Metadata instance.

count(value, /)#

Return number of occurrences of value.

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

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.

Args:

  • other (metadata):

    A metadata instance of the same type.

Kwargs:

  • lenient (boolean):

    Enable/disable lenient difference. The default is to automatically detect whether this lenient operation is enabled.

Returns

Metadata instance of member differences or None.

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

Determine whether the associated metadata members are equivalent.

Args:

  • other (metadata):

    A metadata instance of the same type.

Kwargs:

  • lenient (boolean):

    Enable/disable lenient equivalence. The default is to automatically detect whether this lenient operation is enabled.

Returns

Boolean.

classmethod from_metadata(other)#

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.

Args:

  • other (metadata):

    A metadata instance of any type.

Returns

New metadata instance.

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

Return first index of value.

Raises ValueError if the value is not present.

name(default=None, token=False)#

Returns 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’.

Kwargs:

  • default:

    The fall-back string representing the default name. Defaults to the string ‘unknown’.

  • token:

    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.

Returns

String.

classmethod token(name)#

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

Args:

  • name:

    The string name to verify

Returns

The provided name if valid, otherwise None.

DEFAULT_NAME = 'unknown'#
attributes#

Alias for field number 4

axis#

Alias for field number 6

location#

Alias for field number 5

long_name#

Alias for field number 1

standard_name#

Alias for field number 0

units#

Alias for field number 3

var_name#

Alias for field number 2

↑ top ↑

Metadata container for a Mesh.

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

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

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

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

Args:

  • other (metadata):

    A metadata instance of the same type.

Kwargs:

  • lenient (boolean):

    Enable/disable lenient combination. The default is to automatically detect whether this lenient operation is enabled.

Returns

Metadata instance.

count(value, /)#

Return number of occurrences of value.

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

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.

Args:

  • other (metadata):

    A metadata instance of the same type.

Kwargs:

  • lenient (boolean):

    Enable/disable lenient difference. The default is to automatically detect whether this lenient operation is enabled.

Returns

Metadata instance of member differences or None.

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

Determine whether the associated metadata members are equivalent.

Args:

  • other (metadata):

    A metadata instance of the same type.

Kwargs:

  • lenient (boolean):

    Enable/disable lenient equivalence. The default is to automatically detect whether this lenient operation is enabled.

Returns

Boolean.

classmethod from_metadata(other)#

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.

Args:

  • other (metadata):

    A metadata instance of any type.

Returns

New metadata instance.

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

Return first index of value.

Raises ValueError if the value is not present.

name(default=None, token=False)#

Returns 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’.

Kwargs:

  • default:

    The fall-back string representing the default name. Defaults to the string ‘unknown’.

  • token:

    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.

Returns

String.

classmethod token(name)#

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

Args:

  • name:

    The string name to verify

Returns

The provided name if valid, otherwise None.

DEFAULT_NAME = 'unknown'#
attributes#

Alias for field number 4

edge_dimension#

Alias for field number 7

face_dimension#

Alias for field number 8

long_name#

Alias for field number 1

node_dimension#

Alias for field number 6

standard_name#

Alias for field number 0

topology_dimension#

Alias for field number 5

units#

Alias for field number 3

var_name#

Alias for field number 2