From 4f7050e88bc5f6ffc1ef1c21b103e3c46ff1d572 Mon Sep 17 00:00:00 2001 From: Kabilar Gunalan Date: Mon, 13 Jan 2025 09:12:44 -0600 Subject: [PATCH 1/3] Update URL for DANDI Docs (#1210) * Update URL for DANDI Docs * Update changelog --- CHANGELOG.md | 6 ++++++ notebooks/05_Export.ipynb | 4 ++-- notebooks/py_scripts/05_Export.py | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b85fda6b..0e0626b9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## [0.5.5] (TBD) + +### Infrastructure + +- Update URL for DANDI Docs #1210 + ## [0.5.4] (December 20, 2024) ### Infrastructure diff --git a/notebooks/05_Export.ipynb b/notebooks/05_Export.ipynb index 2f540f849..af66a998d 100644 --- a/notebooks/05_Export.ipynb +++ b/notebooks/05_Export.ipynb @@ -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", diff --git a/notebooks/py_scripts/05_Export.py b/notebooks/py_scripts/05_Export.py index 7cf0183c0..ba4aa1f3c 100644 --- a/notebooks/py_scripts/05_Export.py +++ b/notebooks/py_scripts/05_Export.py @@ -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. # From 2a37bfff0351ee120421478f378ee3313a999db8 Mon Sep 17 00:00:00 2001 From: Samuel Bray Date: Mon, 13 Jan 2025 07:22:45 -0800 Subject: [PATCH 2/3] Ensure merge tables declared in new database (#1205) * ensure merge tables declared * update changelog --- CHANGELOG.md | 4 +++- src/spyglass/common/populate_all_common.py | 3 +++ src/spyglass/utils/dj_helper_fn.py | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e0626b9e..05ce927ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,11 @@ # Change Log -## [0.5.5] (TBD) + +## [0.5.5] (Unreleased) ### Infrastructure +- Ensure merge tables are declared during file insertion #1205 - Update URL for DANDI Docs #1210 ## [0.5.4] (December 20, 2024) diff --git a/src/spyglass/common/populate_all_common.py b/src/spyglass/common/populate_all_common.py index d3b0d7f62..9b3bd59fb 100644 --- a/src/spyglass/common/populate_all_common.py +++ b/src/spyglass/common/populate_all_common.py @@ -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( @@ -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, diff --git a/src/spyglass/utils/dj_helper_fn.py b/src/spyglass/utils/dj_helper_fn.py index 890ac496e..0d2b9fd98 100644 --- a/src/spyglass/utils/dj_helper_fn.py +++ b/src/spyglass/utils/dj_helper_fn.py @@ -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): From dbae127f79c2a440dbaf3fd898e529c0e27906f2 Mon Sep 17 00:00:00 2001 From: Samuel Bray Date: Thu, 16 Jan 2025 08:45:36 -0800 Subject: [PATCH 3/3] Fix missing pos interval map entry in pose estimation (#1208) * fix missing pos interval map entry in pose estimation * update changelog * strip extra key values in no_transaction_make --- CHANGELOG.md | 5 +++++ src/spyglass/common/common_behav.py | 3 +++ src/spyglass/position/v1/position_dlc_pose_estimation.py | 1 - 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05ce927ef..7523435fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ - Ensure merge tables are declared during file insertion #1205 - Update URL for DANDI Docs #1210 +### Pipelines + +- Position + - Allow population of missing `PositionIntervalMap` entries during population of `DLCPoseEstimation` #1208 + ## [0.5.4] (December 20, 2024) ### Infrastructure diff --git a/src/spyglass/common/common_behav.py b/src/spyglass/common/common_behav.py index 53f8b7dcd..0569d46e3 100644 --- a/src/spyglass/common/common_behav.py +++ b/src/spyglass/common/common_behav.py @@ -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="") diff --git a/src/spyglass/position/v1/position_dlc_pose_estimation.py b/src/spyglass/position/v1/position_dlc_pose_estimation.py index 69a325a4f..04f7724f4 100644 --- a/src/spyglass/position/v1/position_dlc_pose_estimation.py +++ b/src/spyglass/position/v1/position_dlc_pose_estimation.py @@ -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: