Skip to main content

npc_lims

neuropixels cloud lab information management system Tools to fetch and update paths, metadata and state for Mindscope Neuropixels sessions, in the cloud.

PyPI Python version

Coverage CI/CD GitHub issues

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_REGION
        • AWS_ACCESS_KEY_ID
        • AWS_SECRET_ACCESS_KEY
        • to find and read files on S3
        • must have read access on relevant aind buckets
        • can be in a standard ~/.aws location, as used by AWS CLI or boto3
      • CodeOcean API
        • CODE_OCEAN_API_TOKEN
        • CODE_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 Tokens and click Generate new token - this is for programatically querying CodeOcean's databases
            • in Token Name enter Codeocean API (read) and check read on capsules and datasets
            • a token will be generated: click copy (storing it in a password manager, if you use one)
          • head back to User Secrets where we'll paste it into a new secret via Add secret > API credentials - in description enter Codeocean API (read) - in API key enter CODE_OCEAN_API_KEY - in API secret paste the copied secret from before (should start with cop_...) CODE_OCEAN_DOMAIN is the codeocean https address, up to and including .org
    • environment variables can also be specified in a file named .env in the current working directory
  • 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:

Metadata

Release files for npc_lims 0.1.207

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for npc_lims 0.1.207
File Size Uploaded Provenance Actions
npc_lims-0.1.207.tar.gz 69.3 kB Without provenance Details for npc_lims-0.1.207.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for npc_lims 0.1.207
File Interpreter ABI Platform Actions
npc_lims-0.1.207-py3-none-any.whl Python 3 none any Details for npc_lims-0.1.207-py3-none-any.whl

Total release size: 146.4 kB

Release files / npc_lims-0.1.207.tar.gz

Download URL npc_lims-0.1.207.tar.gz
Size 69.3 kB
Tags Source
SHA-256 checksum
How to use checksums
2d0be91c611bd2e0315111d0e470d8da5f9bca4f705400448691d827eae10965
BLAKE2b-256 checksum
How to use checksums
2b0ca7d2a34b2238fe8f86fd68fab984d9ae7121dfde0cdfc42c8249fb7f2518
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.207-py3-none-any.whl

Download URL npc_lims-0.1.207-py3-none-any.whl
Size 77.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db432c0ffafbac977d52113f7e0e8fa89c84a31f619e307a9c3b0ea1265094a4
BLAKE2b-256 checksum
How to use checksums
087e1f60d9fece218acb95a9f5fc5874adc3cf3dd99064d280c88711378f8359
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.207

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.

Release history Release notifications | RSS feed

This release

0.1.207 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page