Skip to content

Conversation

@samuelbray32
Copy link
Collaborator

@samuelbray32 samuelbray32 commented Oct 10, 2025

Description

Fixes #1264

  • Add kachery-cloud as a dependency since no longer comes with sortingview

dj config setup tutorial

  • pull variables to top of cell so harder for users to miss
  • First connect to data base with initial admin-given password
  • Ensure saves global (common thing users miss

Checklist:

  • N If this PR should be accompanied by a release, I have updated the CITATION.cff
  • N If this PR edits table definitions, I have included an alter snippet for release notes.
  • N If this PR makes changes to position, I ran the relevant tests locally.
  • If this PR makes user-facing changes, I have added/edited docs/notebooks to reflect the changes
  • I have updated the CHANGELOG.md with PR number and description.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@edeno edeno requested review from Copilot and edeno October 15, 2025 21:05
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses startup issues for new users by adding the missing kachery-cloud dependency and improving the database configuration tutorial workflow.

  • Added kachery-cloud as an explicit dependency across all environment files
  • Refactored the database setup tutorial to pull configuration variables to the top for better visibility
  • Fixed return type consistency in AnalysisNwbfile.get_abs_path method

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
pyproject.toml Added kachery-cloud to project dependencies
environment.yml, environment_dlc.yml, environment_moseq_cpu.yml, environment_moseq_gpu.yml Added kachery-cloud to pip dependencies in all environment files
notebooks/00_Setup.ipynb, notebooks/py_scripts/00_Setup.py Restructured database setup tutorial to clarify configuration steps and ensure global config is saved
src/spyglass/common/common_nwbfile.py Changed return type from Path to str for consistency
CHANGELOG.md Added changelog entries for the dependency addition and return type fix

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

"cell_type": "code",
"execution_count": null,
"id": "7ebcb0bf",
"metadata": {},
Copy link
Collaborator

@edeno edeno Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line #17.            "database.host": "lmf-db.cin.ucsf.edu",

Do we want this to be specific to our database?


Reply via ReviewNB

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, sorry. this should be the database_host value defined above

@edeno edeno requested a review from CBroz1 October 15, 2025 21:07
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.24%. Comparing base (85b1415) to head (06a1675).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1430   +/-   ##
=======================================
  Coverage   71.24%   71.24%           
=======================================
  Files         114      114           
  Lines       13248    13248           
=======================================
  Hits         9438     9438           
  Misses       3810     3810           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@edeno edeno requested a review from CBroz1 November 12, 2025 01:10
Copy link
Member

@CBroz1 CBroz1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the migration to globally saved config, we could delete the chdir lines across all notebooks, to avoid carrying the vestige

I might also add a 'common error' section to 01_Concepts.ipynb along the lines of "Prompted for your username when you thought you saved your config? Find your settings with:"

print(dj.config) # Usually ./dj_local_conf.json or ~/.datajoint_config.json

"To manually connect without a config..."

dj.conn(user="youruser", password="yourpass", host="yourhost")

"If you think you may be having connection issues, try the above or contact admin to reset your password"

Could be this pr, could be an issue to resolve in the next

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove this line, let it use the default, global

# "ghostipy", # removed from list bc M1 users need to install pyfftw first
"hdmf>=3.4.6",
"ipympl",
"kachery-cloud",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be in yaml and toml files? As an imported package, my thought would be to only list here in toml and let the yaml's - . handle installing for the conda env

Comment on lines +469 to +470
dj.config.save_global()
dj.config.save_local()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because save_dj_config should do this already, yeah? I might change this too a check-exists.

Suggested change
dj.config.save_global()
dj.config.save_local()
your_config = Path.home() / '.datajoint_config.json'
print(f"Config exists: {your_config.exists()}"

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Add explicit `kachery-cloud` dependency #1430
- Add explicit `kachery-cloud` dependency #1430
- Default ton globally saved config #1430

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update Kachery setup instructions

4 participants