Skip to content

Commit 1fdbcf1

Browse files
authored
Merge pull request #30 from ttngu207/chronic_and_acute
chronic and acute probe insertions as different python modules
2 parents 7c67f65 + 7474f8f commit 1fdbcf1

File tree

4 files changed

+765
-16
lines changed

4 files changed

+765
-16
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ ARG PKG_NAME
55
ARG PKG_VERSION
66

77
FROM datajoint/${IMAGE}:py${PY_VER}-${DISTRO}
8-
COPY --chown=dja:anaconda ./requirements.txt ./setup.py \
8+
COPY --chown=anaconda:anaconda ./requirements.txt ./setup.py \
99
/main/
10-
COPY --chown=dja:anaconda ./${PKG_NAME} /main/${PKG_NAME}
10+
COPY --chown=anaconda:anaconda ./${PKG_NAME} /main/${PKG_NAME}
1111
RUN \
1212
cd /main && \
1313
pip install . && \

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())

element_array_ephys/ephys.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
import re
44
import numpy as np
55
import inspect
6-
import uuid
7-
import hashlib
86
import importlib
97

108
from .readers import spikeglx, kilosort, openephys
11-
from . import probe, find_full_path, find_root_directory
9+
from . import probe, find_full_path, find_root_directory, dict_to_uuid
1210

1311
schema = dj.schema()
1412

@@ -481,8 +479,8 @@ class CuratedClustering(dj.Imported):
481479

482480
class Unit(dj.Part):
483481
definition = """
484-
-> master
485482
# Properties of a given unit from a round of clustering (and curation)
483+
-> master
486484
unit: int
487485
---
488486
-> probe.ElectrodeConfig.Electrode # electrode with highest waveform amplitude for this unit
@@ -746,13 +744,3 @@ def generate_electrode_config(probe_type: str, electrodes: list):
746744

747745
return electrode_config_key
748746

749-
750-
def dict_to_uuid(key):
751-
"""
752-
Given a dictionary `key`, returns a hash string as UUID
753-
"""
754-
hashed = hashlib.md5()
755-
for k, v in sorted(key.items()):
756-
hashed.update(str(k).encode())
757-
hashed.update(str(v).encode())
758-
return uuid.UUID(hex=hashed.hexdigest())

0 commit comments

Comments
 (0)