From ff86c78a0c5f7ad5df0a07d242e33277cb4edc67 Mon Sep 17 00:00:00 2001 From: lochhh Date: Fri, 31 Jan 2025 11:54:26 +0100 Subject: [PATCH 1/5] Add `aeon_api` as submodule --- .gitmodules | 4 ++++ aeon_api | 1 + 2 files changed, 5 insertions(+) create mode 160000 aeon_api diff --git a/.gitmodules b/.gitmodules index 1a2dead1..4e7fafba 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,6 +2,10 @@ path = aeon_mecha url = https://github.com/SainsburyWellcomeCentre/aeon_mecha branch = data-preview +[submodule "aeon_api"] + path = aeon_api + url = https://github.com/SainsburyWellcomeCentre/aeon_api.git + branch = main [submodule "aeon_experiments"] path = aeon_experiments url = https://github.com/SainsburyWellcomeCentre/aeon_experiments diff --git a/aeon_api b/aeon_api new file mode 160000 index 00000000..f98c343f --- /dev/null +++ b/aeon_api @@ -0,0 +1 @@ +Subproject commit f98c343f90e234b7ff2305b046e92f3f2a5d9cd4 From 837e8b0f18f6a0ab37e275482753233228b98714 Mon Sep 17 00:00:00 2001 From: lochhh Date: Fri, 31 Jan 2025 12:18:06 +0100 Subject: [PATCH 2/5] Replace `aeon_mecha` with `aeon_api` --- Makefile | 2 +- make.bat | 2 +- make_mecha_doctree.py => make_api_doctree.py | 12 ++++-------- src/_templates/api_mecha_head.rst | 8 ++++---- src/conf.py | 6 ++++-- src/getting_started/index.md | 6 +++--- src/getting_started/installation.md | 16 ++++++++-------- src/reference/api.md | 4 ++-- 8 files changed, 27 insertions(+), 29 deletions(-) rename make_mecha_doctree.py => make_api_doctree.py (86%) diff --git a/Makefile b/Makefile index 6ce1a2e5..08f28076 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ help: $(SOURCEDIR)/reference/api.rst: @echo "Generating API documentation..." - @python make_mecha_doctree.py + @python make_api_doctree.py @python make_acquisition_doctree.py copy-examples: diff --git a/make.bat b/make.bat index f6e45d6e..c6816566 100644 --- a/make.bat +++ b/make.bat @@ -14,7 +14,7 @@ if "%1" == "" goto help if not "%1" == "clean" ( @echo Building API docs... - python make_mecha_doctree.py + python make_api_doctree.py python make_acquisition_doctree.py @echo Copying example notebooks into 'src'... diff --git a/make_mecha_doctree.py b/make_api_doctree.py similarity index 86% rename from make_mecha_doctree.py rename to make_api_doctree.py index 0c5d440c..1c82973f 100644 --- a/make_mecha_doctree.py +++ b/make_api_doctree.py @@ -1,20 +1,16 @@ import os from pathlib import Path - # modules to ignore in the api doc -ignore_modules = [ - "aeon.dj_pipeline", - "aeon.qc.video", -] +ignore_modules = [] -def make_mecha_doctree(): +def make_api_doctree(): """ Create a doctree of all modules in aeon_mecha/aeon. """ doctree = "" - api_path = Path("aeon_mecha") / "aeon" + api_path = Path("aeon_api") / "aeon" for path in sorted(api_path.rglob("*.py")): if path.name.startswith("_"): continue @@ -36,4 +32,4 @@ def make_mecha_doctree(): if __name__ == "__main__": - make_mecha_doctree() + make_api_doctree() diff --git a/src/_templates/api_mecha_head.rst b/src/_templates/api_mecha_head.rst index 6aac0783..fc6d60f1 100644 --- a/src/_templates/api_mecha_head.rst +++ b/src/_templates/api_mecha_head.rst @@ -1,15 +1,15 @@ .. This file is auto-generated. -.. _target-mecha-reference: +.. _target-aeon-api-reference: -``aeon_mecha`` +``aeon_api`` ============== .. toctree:: - :caption: aeon_mecha API + :caption: aeon API :maxdepth: 1 .. autosummary:: - :toctree: mecha + :toctree: api diff --git a/src/conf.py b/src/conf.py index da0af517..c7a8376a 100644 --- a/src/conf.py +++ b/src/conf.py @@ -19,6 +19,7 @@ [ os.path.abspath("."), os.path.abspath("../aeon_mecha/"), + os.path.abspath("../aeon_api/"), os.path.abspath("../aeon_acquisition"), os.path.abspath("../aeon_experiments"), ] @@ -68,7 +69,7 @@ def get_current_release_tag(): "myst_nb", "sphinx_design", "sphinx_copybutton", - "convertworkflow" + "convertworkflow", ] # Configure the myst parser to enable cool markdown features @@ -146,7 +147,7 @@ def get_current_release_tag(): "css/custom.css", ] html_js_files = [ - 'js/workflow.js', # javascript for embedded workflows + "js/workflow.js", # javascript for embedded workflows ] # linkcheck will skip checking these URLs entirely @@ -175,6 +176,7 @@ def get_current_release_tag(): "aeon-experiments-github": "https://github.com/SainsburyWellcomeCentre/aeon_experiments/{{path}}", "aeon-lineardrive-github": "https://github.com/SainsburyWellcomeCentre/aeon_lineardrive/{{path}}", "aeon-feeder-github": "https://github.com/SainsburyWellcomeCentre/aeon_feeder/{{path}}", + "aeon-api-github": "https://github.com/SainsburyWellcomeCentre/aeon_api/{{path}}", "myst-parser": "https://myst-parser.readthedocs.io/en/latest/{{path}}#{{fragment}}", "semver": "https://semver.org/", "harp-tech": "https://harp-tech.org/{{path}}#{{fragment}}", diff --git a/src/getting_started/index.md b/src/getting_started/index.md index 924ddbfd..734751a5 100644 --- a/src/getting_started/index.md +++ b/src/getting_started/index.md @@ -41,8 +41,8 @@ As each of these different components is built using different languages, spanni ::::{grid} 1 2 2 2 :gutter: 3 -:::{grid-item-card} {fas}`database;sd-text-primary` aeon_mecha -:link: https://github.com/SainsburyWellcomeCentre/aeon_mecha +:::{grid-item-card} {fas}`database;sd-text-primary` aeon_api +:link: https://github.com/SainsburyWellcomeCentre/aeon_api :link-type: url Aeon's main library for interfacing with acquired data ::: @@ -76,7 +76,7 @@ Source code for pellet delivery via feeders used in Aeon experiments :::{note} All experiment data is acquired and/or triggered and/or synced by [Harp devices](https://www.cf-hw.org/harp). -Code in the `aeon_acquisition` and `aeon_mecha` repositories makes use of +Code in the `aeon_acquisition` and `aeon_api` repositories makes use of the [Harp protocol](harp-tech:articles/about) during data acquisition, raw data file writing, and raw data file reading. See also the documentation on diff --git a/src/getting_started/installation.md b/src/getting_started/installation.md index 204d1a62..c2365dd6 100644 --- a/src/getting_started/installation.md +++ b/src/getting_started/installation.md @@ -1,11 +1,11 @@ # Installation -This guide will walk you through the installation of the `aeon_mecha` package, the main package for interacting with raw Aeon data. It also includes instructions for setting up data access to the Aeon data hosted on SWC's Ceph storage (currently only applicable to SWC members). +This guide will walk you through the installation of the `aeon_api` package, the main package for interacting with raw Aeon data. It also includes instructions for setting up data access to the Aeon data hosted on SWC's Ceph storage (currently only applicable to SWC members). -## `aeon_mecha` +## `aeon_api` :::{note} -We always recommend installing `aeon_mecha` inside a +We always recommend installing `aeon_api` inside a [conda](https://docs.conda.io/en/latest/) or [mamba](https://mamba.readthedocs.io/en/latest/) environment, to avoid dependency conflicts with other packages. @@ -40,12 +40,12 @@ export PATH=$PATH:/ceph/aeon/aeon/code/dotnet ``` ::: -Clone the `aeon_mecha` repository into the `~/ProjectAeon/aeon_mecha` directory. +Clone the `aeon_api` repository into the `~/ProjectAeon/aeon_api` directory. ```sh mkdir ~/ProjectAeon cd ~/ProjectAeon -git clone https://github.com/SainsburyWellcomeCentre/aeon_mecha -cd aeon_mecha +git clone https://github.com/SainsburyWellcomeCentre/aeon_api +cd aeon_api ``` Create the `aeon` conda environment and activate it. @@ -54,7 +54,7 @@ conda create -n aeon -c conda-forge python>=3.11 conda activate aeon ``` -Install the `aeon_mecha` package in editable mode. +Install the `aeon_api` package in editable mode. ::::{tab-set} :::{tab-item} Users ```sh @@ -108,4 +108,4 @@ The next step is to configure your IDE to connect to the `swc-gateway` node via :::: ::::: -Within the `aeon` conda environment, Aeon data can be accessed directly from Ceph or the DataJoint database using the [`aeon_mecha` API](target-mecha-reference). Examples for retrieving and visualizing the data can be found in the [User Guide](target-user-guide). \ No newline at end of file +Within the `aeon` conda environment, Aeon data can be accessed directly from Ceph or the DataJoint database using the [`aeon_api` API](target-aeon-api-reference). Examples for retrieving and visualizing the data can be found in the [User Guide](target-user-guide). \ No newline at end of file diff --git a/src/reference/api.md b/src/reference/api.md index cb3047da..a005d520 100644 --- a/src/reference/api.md +++ b/src/reference/api.md @@ -5,13 +5,13 @@ :gutter: 3 :::{grid-item-card} Data API Reference -:link: target-mecha-reference +:link: target-aeon-api-reference :link-type: ref :img-bottom: ../images/api-python-logo.png :class-img-bottom: sd-px-2 :class-card: sd-height-25 -This reference guide contains a detailed description of the `aeon_mecha` low-level API. +This reference guide contains a detailed description of `aeon_api`, Aeon's low-level API. ::: :::{grid-item-card} Acquisition API Reference From 472b3e343cb4ee126eb92f1090430e1c9bab29ad Mon Sep 17 00:00:00 2001 From: lochhh Date: Fri, 31 Jan 2025 18:55:09 +0100 Subject: [PATCH 3/5] Use swc namespace package --- aeon_api | 2 +- make_api_doctree.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aeon_api b/aeon_api index f98c343f..2c5955e2 160000 --- a/aeon_api +++ b/aeon_api @@ -1 +1 @@ -Subproject commit f98c343f90e234b7ff2305b046e92f3f2a5d9cd4 +Subproject commit 2c5955e2a9539173386c3fc6afd0c69fe0af35e8 diff --git a/make_api_doctree.py b/make_api_doctree.py index 1c82973f..0e3496e0 100644 --- a/make_api_doctree.py +++ b/make_api_doctree.py @@ -10,7 +10,7 @@ def make_api_doctree(): Create a doctree of all modules in aeon_mecha/aeon. """ doctree = "" - api_path = Path("aeon_api") / "aeon" + api_path = Path("aeon_api") / "swc" / "aeon" for path in sorted(api_path.rglob("*.py")): if path.name.startswith("_"): continue From b894ebc16c4496f8b4bd775422c0289d7543a450 Mon Sep 17 00:00:00 2001 From: lochhh Date: Thu, 27 Feb 2025 14:30:06 +0000 Subject: [PATCH 4/5] Add `aeon_api` to repo readme --- readme.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 3fc14367..ea0cb96d 100644 --- a/readme.md +++ b/readme.md @@ -28,12 +28,20 @@ Below are the required sets of credentials for Aeon members: To be granted these credentials, please send a single email to [all contact parties](mailto:jai.bhagat.21@ucl.ac.uk,g.lopes@neurogears.org,d.campagner@ucl.ac.uk,helpdesk@swc.ucl.ac.uk,thinh@vathes.com?subject=Request%20for%20Aeon%20credentials) requesting this access. ## Repositories + +### [aeon_api](https://github.com/SainsburyWellcomeCentre/aeon_api) + +![aeon_api_env_build_and_tests](https://github.com/SainsburyWellcomeCentre/aeon_api/actions/workflows/build_env_run_tests.yml/badge.svg?branch=main) +[![aeon_api_tests_code_coverage](https://codecov.io/gh/SainsburyWellcomeCentre/aeon_api/branch/main/graph/badge.svg?token=973EC1CG03)](https://codecov.io/gh/SainsburyWellcomeCentre/aeon_api) + +Aeon's low-level library for interfacing with acquired data. Contains Python modules for raw data file io, data querying, and data processing. + ### [aeon_mecha](https://github.com/SainsburyWellcomeCentre/aeon_mecha) ![aeon_mecha_env_build_and_tests](https://github.com/SainsburyWellcomeCentre/aeon_mecha/actions/workflows/build_env_run_tests.yml/badge.svg?branch=main) [![aeon_mecha_tests_code_coverage](https://codecov.io/gh/SainsburyWellcomeCentre/aeon_mecha/branch/main/graph/badge.svg?token=973EC1CG03)](https://codecov.io/gh/SainsburyWellcomeCentre/aeon_mecha) -Aeon's main library for interfacing with acquired data. Contains Python modules for raw data file io, data querying, data processing, data qc, database ingestion, and building computational data pipelines. This is the main user repository. +Aeon's library for the Aeon DataJoint pipeline. Contains Python modules for Aeon experiment schema definitions, data quality control, data processing, and data ingestion into a DataJoint MySQL database. ### [aeon_experiments](https://github.com/SainsburyWellcomeCentre/aeon_experiments) From 09f9035dd1efb95e26c53d9d57423c46bdfe82b8 Mon Sep 17 00:00:00 2001 From: lochhh Date: Thu, 6 Mar 2025 16:06:41 +0000 Subject: [PATCH 5/5] Use `aeon_mecha sfn2024` branch --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 4e7fafba..88464577 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "aeon_mecha"] path = aeon_mecha url = https://github.com/SainsburyWellcomeCentre/aeon_mecha - branch = data-preview + branch = sfn2024 [submodule "aeon_api"] path = aeon_api url = https://github.com/SainsburyWellcomeCentre/aeon_api.git