npc_lims
neuropixels cloud lab information management system Tools to fetch and update paths, metadata and state for Mindscope Neuropixels sessions, in the cloud.
quickstart
-
make a new Python >=3.9 virtual environment with conda or venv (lighter option, since this package does not require pandas, numpy etc.):
python -m venv .venv
-
activate the virtual environment:
- Windows
.venv\scripts\activate
- Unix
source .venv/bin/activate.sh
-
install the package:
python -m pip install npc_lims
-
setup credentials
- required environment variables:
- AWS S3
AWS_DEFAULT_REGIONAWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY- to find and read files on S3
- must have read access on relevant aind buckets
- can be in a standard
~/.awslocation, as used by AWS CLI or boto3
- CodeOcean API
CODE_OCEAN_API_TOKENCODE_OCEAN_DOMAIN- to find processed data in "data assets" via the Codeocean API
- generated in CodeOcean:
- right click on
Account(bottom left, person icon) - click
User Secrets- these are secrets than can be made available as environment variables in CodeOcean capsules - go to
Access Tokensand clickGenerate new token- this is for programatically querying CodeOcean's databases- in
Token NameenterCodeocean API (read)and checkreadon capsules and datasets - a token will be generated: click copy (storing it in a password manager, if you use one)
- in
- head back to
User Secretswhere we'll paste it into a new secret viaAdd secret > API credentials- indescriptionenterCodeocean API (read)- inAPI keyenterCODE_OCEAN_API_KEY- inAPI secretpaste the copied secret from before (should start withcop_...)CODE_OCEAN_DOMAINis the codeocean https address, up to and including.org
- right click on
- AWS S3
- environment variables can also be specified in a file named
.envin the current working directory- example: https://www.dotenv.org/docs/security/env.html
- be very careful that this file does not get pushed to public locations, e.g. github
- if using git, add it to a
.gitignorefile in your project's root directory:
.env*
- if using git, add it to a
- required environment variables:
-
now in Python we can find sessions that are available to work with:
>>> import npc_lims; # get a sequence of `SessionInfo` dataclass instances, one per session: >>> tracked_sessions: tuple[npc_lims.SessionInfo, ...] = npc_lims.get_session_info() # each `SessionInfo` instance has minimal metadata about its session: >>> tracked_sessions[0] # doctest: +SKIP npc_lims.SessionInfo(id='626791_2022-08-15', subject=626791, date='2022-08-15', idx=0, project='DRPilotSession', is_ephys=True, is_sync=True, allen_path=PosixUPath('//allen/programs/mindscope/workgroups/dynamicrouting/PilotEphys/Task 2 pilot/DRpilot_626791_20220815')) >>> tracked_sessions[0].is_ephys # doctest: +SKIP False # currently, we're only tracking behavior and ephys sessions that use variants of https://github.com/samgale/DynamicRoutingTask/blob/main/TaskControl.py: >>> all(s.date.year >= 2022 for s in tracked_sessions) True
-
"tracked sessions" are discovered via 3 routes:
- https://github.com/AllenInstitute/npc_lims/blob/main/tracked_sessions.yaml
\\allen\programs\mindscope\workgroups\dynamicrouting\DynamicRoutingTask\DynamicRoutingTraining.xlsx\\allen\programs\mindscope\workgroups\dynamicrouting\DynamicRoutingTask\DynamicRoutingTrainingNSB.xlsx
Metadata
Release files for npc_lims 0.1.201
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| npc_lims-0.1.201.tar.gz | 51.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| npc_lims-0.1.201-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 108.3 kB
Release files / npc_lims-0.1.201.tar.gz
| Download URL | npc_lims-0.1.201.tar.gz |
|---|---|
| Size | 51.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ca0f8ada7ee346ccc907333d04e02c910abb7ba1ad7f379f3157de5bde4dad7
|
|
BLAKE2b-256 checksum How to use checksums |
da9c69e7de1c7ea2cbfeb9c0bffa0cd1789625dd60d44dd61fecef080af297cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / npc_lims-0.1.201-py3-none-any.whl
| Download URL | npc_lims-0.1.201-py3-none-any.whl |
|---|---|
| Size | 56.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62177f9097e01764e62ebb549d6d31049478d072b9b79370d031ae1266125f69
|
|
BLAKE2b-256 checksum How to use checksums |
9511a4ad2d15c69b2529566a90c8f008630f7a2e63043dc22d7476f66e63915e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|