Skip to content

Commit

Permalink
Merge branch 'master' into moseq
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelbray32 authored Jan 16, 2025
2 parents 31014f9 + dbae127 commit 3dacc40
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 6 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
# Change Log

## [0.5.4] (Unreleased)

## [0.5.5] (Unreleased)

### Infrastructure

- Ensure merge tables are declared during file insertion #1205
- Update URL for DANDI Docs #1210
- Add common method `get_position_interval_epoch` #1056

### Pipelines

- Position
- Allow population of missing `PositionIntervalMap` entries during population of `DLCPoseEstimation` #1208

- Behavior
- Implement pipeline for keypoint-moseq extraction of behavior syllables #1056


## [0.5.4] (December 20, 2024)

### Infrastructure
Expand Down
4 changes: 2 additions & 2 deletions notebooks/05_Export.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -928,9 +928,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The first step you will need to do is to [create a Dandi account](https://www.dandiarchive.org/handbook/16_account/). \n",
"The first step you will need to do is to [create a Dandi account](https://docs.dandiarchive.org/16_account/). \n",
"With this account you can then [register a new dandiset](https://dandiarchive.org/dandiset/create) by providing a name and basic metadata. \n",
"Dandi's instructions for these steps are available [here](https://www.dandiarchive.org/handbook/13_upload/).\n",
"Dandi's instructions for these steps are available [here](https://docs.dandiarchive.org/13_upload/).\n",
"\n",
"The key information you will need from your registration is the `dandiset ID` and your account `api_key`, both of which are available from your registered account.\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions notebooks/py_scripts/05_Export.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@

# ### Dandiset Upload

# The first step you will need to do is to [create a Dandi account](https://www.dandiarchive.org/handbook/16_account/).
# The first step you will need to do is to [create a Dandi account](https://docs.dandiarchive.org/16_account/).
# With this account you can then [register a new dandiset](https://dandiarchive.org/dandiset/create) by providing a name and basic metadata.
# Dandi's instructions for these steps are available [here](https://www.dandiarchive.org/handbook/13_upload/).
# Dandi's instructions for these steps are available [here](https://docs.dandiarchive.org/13_upload/).
#
# The key information you will need from your registration is the `dandiset ID` and your account `api_key`, both of which are available from your registered account.
#
Expand Down
3 changes: 3 additions & 0 deletions src/spyglass/common/common_behav.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,9 @@ def _no_transaction_make(self, key):
EPSILON = 0.51 # tolerated time diff in bounds across epoch/pos
no_pop_msg = "CANNOT POPULATE PositionIntervalMap"

# Strip extra info from key if not passed via populate call
key = {k: v for k, v in key.items() if k in self.primary_key}

nwb_file_name = key["nwb_file_name"]
pos_intervals = get_pos_interval_list_names(nwb_file_name)
null_key = dict(key, position_interval_name="")
Expand Down
3 changes: 3 additions & 0 deletions src/spyglass/common/populate_all_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from spyglass.common.common_task import TaskEpoch
from spyglass.common.common_usage import InsertError
from spyglass.utils import logger
from spyglass.utils.dj_helper_fn import declare_all_merge_tables


def log_insert_error(
Expand Down Expand Up @@ -117,6 +118,8 @@ def populate_all_common(
"""
from spyglass.spikesorting.imported import ImportedSpikeSorting

declare_all_merge_tables()

error_constants = dict(
dj_user=dj.config["database.user"],
connection_id=dj.conn().connection_id,
Expand Down
1 change: 0 additions & 1 deletion src/spyglass/position/v1/position_dlc_pose_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ def _logged_make(self, key):
"nwb_file_name": key["nwb_file_name"],
"epoch": key["epoch"],
},
populate_missing=False,
)
)
if interval_list_name:
Expand Down
14 changes: 14 additions & 0 deletions src/spyglass/utils/dj_helper_fn.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,20 @@ def ensure_names(
return getattr(table, "full_table_name", None)


def declare_all_merge_tables():
"""Ensures all merge tables in the spyglass core package are declared.
- Prevents circular imports
- Prevents errors from table declaration within a transaction
- Run during nwb insertion
"""
from spyglass.decoding.decoding_merge import DecodingOutput # noqa: F401
from spyglass.lfp.lfp_merge import LFPOutput # noqa: F401
from spyglass.position.position_merge import PositionOutput # noqa: F401
from spyglass.spikesorting.spikesorting_merge import ( # noqa: F401
SpikeSortingOutput,
)


def fuzzy_get(index: Union[int, str], names: List[str], sources: List[str]):
"""Given lists of items/names, return item at index or by substring."""
if isinstance(index, int):
Expand Down

0 comments on commit 3dacc40

Please sign in to comment.