Skip to content

Commit

Permalink
Merge branch 'codespace' of https://github.com/kushalbakshi/element-m…
Browse files Browse the repository at this point in the history
…iniscope into codespace
  • Loading branch information
kushalbakshi committed Nov 22, 2023
2 parents ebc7608 + e203726 commit d73adce
Show file tree
Hide file tree
Showing 3 changed files with 1,632 additions and 120 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ RUN \
# pipeline dependencies
apt-get install gcc g++ ffmpeg libsm6 libxext6 -y && \
pip install numpy Cython && \
pip install --no-cache-dir -e /tmp/element-miniscope[caiman_requirements,caiman] && \
pip install --no-cache-dir -e /tmp/element-miniscope[elements,caiman_requirements,caiman] && \
caimanmanager.py install && \
# clean up
rm -rf /tmp/element-miniscope && \
Expand Down
14 changes: 7 additions & 7 deletions element_miniscope/miniscope.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ class ProcessingParamSet(dj.Lookup):
"""Parameters of the processing method.
Attributes:
paramset_idx (foreign key, smallint): Unique parameter set ID.
paramset_id (foreign key, smallint): Unique parameter set ID.
ProcessingMethod (varchar(16) ): ProcessingMethod from the lookup table.
paramset_desc (varchar(128) ): Description of the parameter set.
paramset_set_hash (uuid): UUID hash for parameter set.
Expand All @@ -375,7 +375,7 @@ class ProcessingParamSet(dj.Lookup):

definition = """
# Parameter set used for processing of miniscope data
paramset_idx: smallint
paramset_id: smallint
---
-> ProcessingMethod
paramset_desc: varchar(128)
Expand All @@ -388,7 +388,7 @@ class ProcessingParamSet(dj.Lookup):
def insert_new_params(
cls,
processing_method: str,
paramset_idx: int,
paramset_id: int,
paramset_desc: str,
params: dict,
processing_method_desc: str = "",
Expand All @@ -397,7 +397,7 @@ def insert_new_params(
Args:
processing_method (str): Name of the processing method or software.
paramset_idx (int): Unique number for the set of processing parameters.
paramset_id (int): Unique number for the set of processing parameters.
paramset_desc (str): Description of the processing parameter set.
params (dict): Dictionary of processing parameters for the selected processing_method.
processing_method_desc (str, optional): Description of the processing method. Defaults to "".
Expand All @@ -411,16 +411,16 @@ def insert_new_params(
)
param_dict = {
"processing_method": processing_method,
"paramset_idx": paramset_idx,
"paramset_id": paramset_id,
"paramset_desc": paramset_desc,
"params": params,
"param_set_hash": dict_to_uuid(params),
}
q_param = cls & {"param_set_hash": param_dict["param_set_hash"]}

if q_param: # If the specified param-set already exists
pname = q_param.fetch1("paramset_idx")
if pname == paramset_idx: # If the existed set has the same name: job done
pname = q_param.fetch1("paramset_id")
if pname == paramset_id: # If the existed set has the same name: job done
return
else: # If not same name: human error, try adding with different name
raise dj.DataJointError(
Expand Down
Loading

0 comments on commit d73adce

Please sign in to comment.