cf.Data.get_deterministic_name¶
-
Data.
get_deterministic_name
()[source]¶ Get the deterministic name for the data.
If there is a deterministic name then the data array 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 theequals
method in that NaN and inf values are, in effect, always considered equal.Note that the opposite is not always true. Two
Data
objects that are considered equal by theirequals
methods might not have the same deterministic name.An exception is raised if there is no deterministic name.
New in version 3.15.1.
See also
- Returns
str
The deterministic name.
Examples
>>> d = cf.Data([1, 2, 3], 'm') >>> d.has_deterministic_name() True >>> d.get_deterministic_name() '6380dd3674fbf10d30561484b084e9b3' >>> d1 = cf.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