Skip to content

Commit c4a9ab8

Browse files
author
Thinh Nguyen
committed
chronic and acute probe insertions as different python modules
1 parent 7c67f65 commit c4a9ab8

File tree

3 files changed

+763
-14
lines changed

3 files changed

+763
-14
lines changed

element_array_ephys/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import datajoint as dj
22
import pathlib
3+
import uuid
4+
import hashlib
35

46

57
dj.config['enable_python_native_blobs'] = True
@@ -54,3 +56,14 @@ def find_root_directory(root_directories, full_path):
5456
except StopIteration:
5557
raise FileNotFoundError('No valid root directory found (from {})'
5658
' for {}'.format(root_directories, full_path))
59+
60+
61+
def dict_to_uuid(key):
62+
"""
63+
Given a dictionary `key`, returns a hash string as UUID
64+
"""
65+
hashed = hashlib.md5()
66+
for k, v in sorted(key.items()):
67+
hashed.update(str(k).encode())
68+
hashed.update(str(v).encode())
69+
return uuid.UUID(hex=hashed.hexdigest())

0 commit comments

Comments
 (0)