Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/LorenFrankLab/spyglass in…
Browse files Browse the repository at this point in the history
…to 1025
  • Loading branch information
CBroz1 committed Sep 13, 2024
2 parents 1c64cd9 + 6c8a566 commit 13aba2c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dj.FreeTable(dj.conn(), "common_session.session_group").drop()

- Common

- Drop `SessionGroup` table #1082
- Drop `SessionGroup` table #1106

- Decoding

Expand All @@ -36,6 +36,7 @@ dj.FreeTable(dj.conn(), "common_session.session_group").drop()

- Position

- Fix video directory bug in `DLCPoseEstimationSelection` #1103
- Restore #973, allow DLC without position tracking #1100

- Spike Sorting
Expand Down
7 changes: 6 additions & 1 deletion src/spyglass/position/v1/position_dlc_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ def insert_entry(
table_query = dj.FreeTable(
dj.conn(), full_table_name=part_table.parents()[-1]
) & {"project_name": project_name}
project_path = table_query.fetch1("project_path")

if cls._test_mode: # temporary fix for #1105
project_path = table_query.fetch(limit=1)[0]
else:
project_path = table_query.fetch1("project_path")

part_table.insert1(
{
"dlc_model_name": dlc_model_name,
Expand Down
5 changes: 2 additions & 3 deletions src/spyglass/position/v1/position_dlc_pose_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,8 @@ def _insert_est_with_log(
if not v_path:
raise FileNotFoundError(f"Video file not found for {key}")
logger.info("Pose Estimation Selection")
v_dir = Path(v_path).parent
logger.info("video_dir: %s", v_dir)
v_path = find_mp4(video_path=v_dir, video_filename=v_fname)
logger.info(f"video_dir: {v_path}")
v_path = find_mp4(video_path=Path(v_path), video_filename=v_fname)
if check_crop:
params["cropping"] = self.get_video_crop(
video_path=v_path.as_posix()
Expand Down
7 changes: 5 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -982,13 +982,16 @@ def populate_training(
if len(train_tbl & model_train_key) == 0:
_ = add_training_files
DOWNLOADS.move_dlc_items(labeled_vid_dir)
sgp.v1.DLCModelTraining.populate(model_train_key)
sgp.v1.DLCModelTraining().populate(model_train_key)
yield model_train_key


@pytest.fixture(scope="session")
def model_source_key(sgp, model_train_key, populate_training):
yield (sgp.v1.DLCModelSource & model_train_key).fetch1("KEY")

_ = populate_training

yield (sgp.v1.DLCModelSource & model_train_key).fetch("KEY")[0]


@pytest.fixture(scope="session")
Expand Down

0 comments on commit 13aba2c

Please sign in to comment.