Skip to main content

A library that defines AIND data schema and validates JSON files for behavior rig models.

Project description

aind-behavior-services

CI PyPI - Version License ruff uv

A repository containing code for data acquisition and processing for AIND behavior rigs.


Installation

The python package can be installed from pypi using the following command:

pip install aind-behavior-services

However, to use all the tasks and hardware that this package supports, you should over over the prerequisites and deployment sections.

Prerequisites

These should only need to be installed once on a fresh new system, and are not required if simply refreshing the install or deploying to a new folder.

  • Windows 10 or 11
  • Run ./scripts/install_dependencies.ps1 to automatically install dependencies
  • The following dependencies should be manually installed:
    • Spinnaker SDK 1.29.0.5 (device drivers for FLIR cameras)

      • On FLIR website: Download > archive > 1.29.0.5 > SpinnakerSDK_FULL_1.29.0.5_x64.exe

Deployment

Install the prerequisites mentioned below. From the root of the repository, run ./scripts/deploy.ps1 to bootstrap both python and bonsai environments.


Generating valid JSON input files

One of the core principles of this repository is the strict adherence to json-schemas. We use Pydantic as a way to write and compile our schemas, but also to generate valid JSON input files. These files can be used by Bonsai (powered by Bonsai.SGen code generation tool) or to simply record metadata. Examples of how to interact with the library can be found in the ./examples folder.


Regenerating schemas

Once a Pydantic model is updated, updates to all downstream dependencies must be made to ensure that the ground-truth data schemas (and all dependent interoperability tools) are also updated. This can be achieved by running the regenerate command from the root of the repository. This script will regenerate all json-schemas along with C# code (./scr/Extensions) used by the Bonsai environment.


Contributors

Contributions to this repository are welcome! However, please ensure that your code adheres to the recommended DevOps practices below:

Linting

We use ruff as our primary linting tool.

Testing

Attempt to add tests when new features are added. To run the currently available tests, run python -m unittest from the root of the repository.

Lock files

We use uv to manage our lock files.

Versioning

Where possible, adhere to Semantic Versioning.


Project dependency tree

classDiagram
    class aind_behavior_curriculum {
        +Task
        +Curriculum
    }

    class aind_behavior_services {
        +Task (Subclasses)
        +Rig (maintains hardware library)
        +Session
        +Calibration (maintains device/calibration library)
        +Deployment instructions
        +Ecosystem documentation
    }

    class aind_behavior_experiment_launcher {
        +Launch experiment
        +Interfaces with external applications (e.g. Bonsai)
        +Interfaces with aind-services
    }

    class aind_behavior_some_task {
        +Concrete implementation of a task
        +Rig (Subclasses for some task)
        +Session
        +Task Logic (Subclasses for some task)
        +Maintains a task data-schema
        +Saves data in standard format
    }

    class aind_behavior_some_task_analysis {
        +Analysis code for some task
    }

    class aind_behavior_core_analysis {
        +Data ingestion
        +Data contract definition
        +Core analysis primitives
        +QC
    }

    aind_behavior_curriculum --|> aind_behavior_services : Subclasses Task
    aind_behavior_services --|> aind_behavior_some_task 
    aind_behavior_some_task --|> aind_behavior_some_task_analysis : Analysis
    aind_behavior_core_analysis --|> aind_behavior_some_task_analysis : Imports core analysis methods
    aind_behavior_some_task_analysis --|> aind_behavior_curriculum : Metrics[Task]
    
    aind_behavior_experiment_launcher --|> aind_behavior_some_task : Launches

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aind_behavior_services-0.10.1.tar.gz (135.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aind_behavior_services-0.10.1-py3-none-any.whl (49.4 kB view details)

Uploaded Python 3

File details

Details for the file aind_behavior_services-0.10.1.tar.gz.

File metadata

File hashes

Hashes for aind_behavior_services-0.10.1.tar.gz
Algorithm Hash digest
SHA256 5b1f95a523c5f6c5ab201a90728cb1b934dc27f63d9a56db572e1d64f239e456
MD5 9c602adc117df2ba396297299b99118d
BLAKE2b-256 1c30f9da74001e75b4484bc6556841925cd457e8649211cd218d8be93af9ec49

See more details on using hashes here.

File details

Details for the file aind_behavior_services-0.10.1-py3-none-any.whl.

File metadata

File hashes

Hashes for aind_behavior_services-0.10.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f0c5da0abace1e4b3ac1e59b57ecc4c6408706ca77ab217aceac874a0ec3757
MD5 4b79adfe636aaaca86a08905c95e89b2
BLAKE2b-256 8f1db786ec9fd513cdc8307387d6fd3f02cb9a19f3d46abb8741f4d2a523c919

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page