cfdm.Data.get_deterministic_name

Data.get_deterministic_name()[source]

Get the deterministic name for the data.

If there is a deterministic name then, in some sense, the data may be assumed to be equal to that of another Data object with the same deterministic name. This measure of equality is different to that applied by the equals method in that:

  • Numerical tolerance is not accounted for.

  • NaN and inf values are considered equal.

Warning

Two Data objects that are considered equal by their equals methods could have different deterministic names, and two Data objects that are considered unequal by their equals methods could have the same deterministic names.

Performance

Ascertaining a measure of equality via deterministic names does not require the Dask array to be computed so is, in general, much faster than using the equals method.

New in version (cfdm): 1.11.2.0

Returns
str

The deterministic name.

Examples

>>> d = cfdm.Data([1, 2, 3], 'm')
>>> d.has_deterministic_name()
True
>>> d.get_deterministic_name()
'6380dd3674fbf10d30561484b084e9b3'
>>> d1 = cfdm.Data([1, 2, 3], 'metre')
>>> d1.get_deterministic_name()
'6380dd3674fbf10d30561484b084e9b3'
>>> d1.get_deterministic_name() == d.get_deterministic_name()
True
>>> d1.equals(d)
True
>>> e = d + 1 - 1
>>> e.get_deterministic_name()
'0b83ada62d4b014bae83c3de1c1d3a80'
>>> e.get_deterministic_name() == d.get_deterministic_name()
False
>>> e.equals(d)
True