diff --git a/CHANGELOG.md b/CHANGELOG.md index 43d704718..cdeb4db02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ import all foreign key references. from NWB #1433 - Split `SpyglassMixin` into task-specific mixins #1435 #1451 - Auto-load within-Spyglass tables for graph operations #1368 +- Add explicit `kachery-cloud` dependency #1430 - Allow rechecking of recomputes #1380, #1413 - Set default codecov threshold for test fail, disable patch check #1370, #1372 - Simplify PR template #1370 diff --git a/environment.yml b/environment.yml index 26155a7cc..b168130f8 100644 --- a/environment.yml +++ b/environment.yml @@ -39,4 +39,5 @@ dependencies: - pip: - ghostipy # for common_filter - mountainsort4 + - kachery-cloud - . diff --git a/environment_dlc.yml b/environment_dlc.yml index df6026c18..d77e9bddd 100644 --- a/environment_dlc.yml +++ b/environment_dlc.yml @@ -39,4 +39,5 @@ dependencies: - pip: - ghostipy # for common_filter - mountainsort4 + - kachery-cloud - .[dlc] diff --git a/environment_moseq_cpu.yml b/environment_moseq_cpu.yml index b40dfb646..5728b561b 100644 --- a/environment_moseq_cpu.yml +++ b/environment_moseq_cpu.yml @@ -39,4 +39,5 @@ dependencies: - pip: - ghostipy # for common_filter - mountainsort4 + - kachery-cloud - .[moseq-cpu] diff --git a/environment_moseq_gpu.yml b/environment_moseq_gpu.yml index 3d80f42a8..f5501a8a8 100644 --- a/environment_moseq_gpu.yml +++ b/environment_moseq_gpu.yml @@ -39,4 +39,5 @@ dependencies: - pip: - ghostipy # for common_filter - mountainsort4 + - kachery-cloud - .[moseq-gpu] diff --git a/notebooks/00_Setup.ipynb b/notebooks/00_Setup.ipynb index 0d28173f9..ab706e92e 100644 --- a/notebooks/00_Setup.ipynb +++ b/notebooks/00_Setup.ipynb @@ -502,30 +502,48 @@ "metadata": {}, "outputs": [], "source": [ - "import os\n", "import datajoint as dj\n", "from spyglass.settings import SpyglassConfig\n", "\n", - "# change to the root directory of the project\n", - "if os.path.basename(os.getcwd()) == \"notebooks\":\n", - " os.chdir(\"..\")\n", + "username = \"your username\" # replace with username made for you in the spyglass database\n", + "initial_password = (\n", + " \"your initial password\" # replace with the initial password given to you\n", + ")\n", + "new_password = (\n", + " \"your new password\" # replace with the new password you want to set\n", + ")\n", + "spyglass_base_dir = \"/path/like/stelmo/nwb/\" # replace with a path on your system where spyglass can store NWB files\n", + "database_host = \"address like: 'localhost' or 'lmf-db.cin.ucsf.edu'\"\n", "\n", - "# connect to the database\n", - "dj.conn()\n", "\n", - "# change your password\n", - "dj.admin.set_password()\n", + "dj.config.update(\n", + " {\n", + " \"database.host\": database_host,\n", + " \"database.user\": username,\n", + " \"database.password\": initial_password,\n", + " \"database.port\": 3306,\n", + " }\n", + ")\n", + "\n", + "dj.conn() # connect to the database\n", + "\n", + "# change your password from the initial password\n", + "dj.admin.set_password(new_password, update_config=True)\n", "\n", "# save the configuration\n", "SpyglassConfig().save_dj_config(\n", - " save_method=\"local\", # global or local\n", - " base_dir=\"/path/like/stelmo/nwb/\",\n", - " database_user=\"your username\",\n", - " database_password=\"your password\", # remove this line for shared machines\n", - " database_host=\"localhost or lmf-db.cin.ucsf.edu\", # only list one\n", + " save_method=\"global\", # global or local\n", + " base_dir=spyglass_base_dir,\n", + " database_user=username,\n", + " database_password=new_password,\n", + " database_host=database_host, # only list one\n", " database_port=3306,\n", " set_password=False,\n", - ")" + ")\n", + "\n", + "# ensure the configuration is saved for future use\n", + "dj.config.save_global()\n", + "dj.config.save_local()" ] }, { diff --git a/notebooks/py_scripts/00_Setup.py b/notebooks/py_scripts/00_Setup.py index 6dff1cdb5..d8dc2058f 100644 --- a/notebooks/py_scripts/00_Setup.py +++ b/notebooks/py_scripts/00_Setup.py @@ -5,7 +5,7 @@ # extension: .py # format_name: light # format_version: '1.5' -# jupytext_version: 1.17.0 +# jupytext_version: 1.17.2 # kernelspec: # display_name: spyglass # language: python @@ -426,30 +426,48 @@ # # + -import os import datajoint as dj from spyglass.settings import SpyglassConfig -# change to the root directory of the project -if os.path.basename(os.getcwd()) == "notebooks": - os.chdir("..") +username = "your username" # replace with username made for you in the spyglass database +initial_password = ( + "your initial password" # replace with the initial password given to you +) +new_password = ( + "your new password" # replace with the new password you want to set +) +spyglass_base_dir = "/path/like/stelmo/nwb/" # replace with a path on your system where spyglass can store NWB files +database_host = "address like: 'localhost' or 'lmf-db.cin.ucsf.edu'" + -# connect to the database -dj.conn() +dj.config.update( + { + "database.host": database_host, + "database.user": username, + "database.password": initial_password, + "database.port": 3306, + } +) + +dj.conn() # connect to the database -# change your password -dj.admin.set_password() +# change your password from the initial password +dj.admin.set_password(new_password, update_config=True) # save the configuration SpyglassConfig().save_dj_config( - save_method="local", # global or local - base_dir="/path/like/stelmo/nwb/", - database_user="your username", - database_password="your password", # remove this line for shared machines - database_host="localhost or lmf-db.cin.ucsf.edu", # only list one + save_method="global", # global or local + base_dir=spyglass_base_dir, + database_user=username, + database_password=new_password, + database_host=database_host, # only list one database_port=3306, set_password=False, ) + +# ensure the configuration is saved for future use +dj.config.save_global() +dj.config.save_local() # - #
Legacy config diff --git a/pyproject.toml b/pyproject.toml index fb2eb723c..086b9350b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,6 +44,7 @@ dependencies = [ # "ghostipy", # removed from list bc M1 users need to install pyfftw first "hdmf>=3.4.6", "ipympl", + "kachery-cloud", "matplotlib", "ndx_franklab_novela>=0.1.0", "ndx-pose",