diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c86790ee..7523435fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 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. # 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):