Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
CBroz1 committed Nov 21, 2024
1 parent da70e26 commit 4f49973
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ dj.FreeTable(dj.conn(), "common_session.session_group").drop()
`open-cv` #1168
- `VideoMaker` class to process frames in multithreaded batches #1168, #1174
- `TrodesPosVideo` updates for `matplotlib` processor #1174
- User prompt if ambiguous insert in `DLCModelSource` #1192

- Spike Sorting

Expand Down
18 changes: 13 additions & 5 deletions src/spyglass/position/v1/position_dlc_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,24 @@ def insert_entry(
dj.conn(), full_table_name=part_table.parents()[-1]
) & {"project_name": project_name}

if cls._test_mode: # temporary fix for #1105
project_path = table_query.fetch(limit=1)[0]
else:
project_path = table_query.fetch1("project_path")
n_found = len(table_query)
if n_found != 1:
logger.warning(
f"Found {len(table_query)} entries found for project "
+ f"{project_name}:\n{table_query}"
)

choice = "y"
if n_found > 1 and not cls._test_mode:
choice = dj.utils.user_choice("Use first entry?")[0]
if n_found == 0 or choice != "y":
return

part_table.insert1(
{
"dlc_model_name": dlc_model_name,
"project_name": project_name,
"project_path": project_path,
"project_path": table_query.fetch("project_path", limit=1)[0],
**key,
},
**kwargs,
Expand Down
2 changes: 0 additions & 2 deletions src/spyglass/position/v1/position_dlc_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ class DLCProject(SpyglassMixin, dj.Manual):
With ability to edit config, extract frames, label frames
"""

# Add more parameters as secondary keys...
# TODO: collapse params into blob dict
definition = """
project_name : varchar(100) # name of DLC project
---
Expand Down

0 comments on commit 4f49973

Please sign in to comment.