Skip to content
Snippets Groups Projects
Commit 942a3c96 authored by Nils-Arne Dreier's avatar Nils-Arne Dreier
Browse files

perf: compute hash of a tuple instead summing up multiple hashes

parent 67442db6
No related branches found
No related tags found
1 merge request!47[hiopy] refactor variable handling and distribution
......@@ -32,12 +32,7 @@ def grid_id(var):
if "coordinates" in crs.attrs:
try:
lon, lat = crs.attrs["coordinates"].split(" ")
s = hash(
hash(str(zgroup[lat][:]))
+ hash(str(zgroup[lon][:]))
+ var_group
+ spatial_chunk_shape
)
s = hash((str(zgroup[lat][:]), str(zgroup[lon][:]), var_group, spatial_chunk_shape))
return s
except Exception as e:
raise RuntimeError("Cannot parse coordinates") from e
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment