Skip to content

Commit

Permalink
Merge branch 'master' into 1207_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelbray32 authored Jan 16, 2025
2 parents ad9955f + 2a37bff commit 2658773
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Change Log


## [0.5.5] (Unreleased)

### Infrastructure

- Ensure merge tables are declared during file insertion #1205
- Update URL for DANDI Docs #1210

### Pipelines

- Position
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/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
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 2658773

Please sign in to comment.