npc_lims
neuropixels cloud lab information management system Tools to fetch and update paths, metadata and state for Mindscope Neuropixels sessions, in the cloud.
populate tracked_sessions.yaml from experiment tracking spreadsheet
python -m npc_lims.metadata.ephys_tracking `
"C:\Users\ben.hardcastle\Desktop\upload_ephys.bat" `
"Ephys Experiment Tracking.xlsx" `
"tracked_sessions.yaml" `
--write # omit to do a dry run
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.204
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| npc_lims-0.1.204.tar.gz | 69.0 kB | Without provenance | Details for npc_lims-0.1.204.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| npc_lims-0.1.204-py3-none-any.whl | Python 3 | none | any | Details for npc_lims-0.1.204-py3-none-any.whl |
Total release size: 145.6 kB
Release files / npc_lims-0.1.204.tar.gz
| Download URL | npc_lims-0.1.204.tar.gz |
|---|---|
| Size | 69.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e87b00ba29c2779b0b25dc36a204f7e1dc4e5240dbcfff13f73e518dc0eec461
|
|
BLAKE2b-256 checksum How to use checksums |
41ad441d88d379c6407babcbc8ce5983904b33de236fbbafce2ddffc94eaae9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","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.204-py3-none-any.whl
| Download URL | npc_lims-0.1.204-py3-none-any.whl |
|---|---|
| Size | 76.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
da1cb41fabe555987d9ec3d3dd0c2a40fb09f290a00438073dd956fac9e18132
|
|
BLAKE2b-256 checksum How to use checksums |
acdf86964a3f63a5b5c72d3100d8e3d205d173dad0f6d120884e9c1662b0d27b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for npc_lims 0.1.204
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.