A Python library that provides data acquisition and processing assets shared between Sun (NeuroAI) lab libraries.
This library makes the two main Sun lab libraries used for data acquisition (sl-experiment) and processing (sl-forgery) independent of each other.
The library broadly stores two types of assets. First, it stores dataclasses used to save the data acquired in the lab and configure data acquisition and processing runtimes. Second, it provides the low-level tools and methods used to manage the data at all stages of Sun lab data workflow: acquisition, processing, and analysis.
- Dependencies
- Installation
- Usage
- API Documentation
- Development
- Versioning
- Authors
- License
- Acknowledgments
All library dependencies are installed automatically by all supported installation methods (see the Installation section).
Note, installation from source is highly discouraged for anyone who is not an active project developer.
- Download this repository to the local machine using the preferred method, such as git-cloning. Use one of the stable releases that include precompiled binary and source code distribution (sdist) wheels.
- If the downloaded distribution is stored as a compressed archive, unpack it using the appropriate decompression tool.
cdto the root directory of the prepared project distribution.- Run
python -m pip install .to install the project. Alternatively, if using a distribution with precompiled binaries, usepython -m pip install WHEEL_PATH, replacing 'WHEEL_PATH' with the path to the wheel file.
Use the following command to install the library using pip: pip install sl-shared-assets.
Most library components are intended to be used via other Sun lab libraries. For details on using shared assets for data acquisition and preprocessing, see the sl-experiment library. For details on using shared assets for data processing and dataset formation, see the sl-forgery library.
Warning! End users should not use any component of this library directly or install this library into any Python environment. All assets from this library are intended to be used exclusively by developers working on other Sun lab libraries.
This library provides an MCP server that exposes configuration management tools for AI agent integration. The server enables agents to query and configure shared Sun lab workflow components.
Start the MCP server using the CLI:
sl-configure mcp| Tool | Description |
|---|---|
get_working_directory_tool |
Returns the current Sun lab working directory path |
set_working_directory_tool |
Sets the Sun lab working directory |
get_server_configuration_tool |
Returns the compute server configuration (password masked) |
create_server_configuration_template_tool |
Creates a server configuration template for manual password entry |
get_google_credentials_tool |
Returns the path to the Google service account credentials file |
set_google_credentials_tool |
Sets the path to the Google credentials file |
get_task_templates_directory_tool |
Returns the path to the sl-unity-tasks templates directory |
set_task_templates_directory_tool |
Sets the path to the task templates directory |
list_available_templates_tool |
Lists all available task templates |
get_template_info_tool |
Returns detailed information about a specific task template |
Add the following to the Claude Desktop configuration file:
{
"mcpServers": {
"sl-shared-assets": {
"command": "sl-configure",
"args": ["mcp"]
}
}
}Developers working on integrating sl-shared-assets into other libraries should see the API documentation for the detailed description of the methods and classes exposed by components of this library.
Note! The API documentation includes important information about the 'configuration' Command-Line Interface (CLI) exposed by this library.
This section provides guidance for developers extending this library.
The library uses registry patterns to support multiple data acquisition systems. Each system requires configuration dataclasses. The following steps outline how to add support for a new acquisition system.
Step 1: Add the system to the AcquisitionSystems enum
In configuration_utilities.py, add a new entry to the AcquisitionSystems enum:
from enum import StrEnum
class AcquisitionSystems(StrEnum):
MESOSCOPE_VR = "mesoscope"
NEW_SYSTEM = "new_system" # Add new system hereStep 2: Create the system configuration module
Create a new file (e.g., new_system_configuration.py) containing:
- A system configuration dataclass inheriting from
YamlConfigwith hardware and software settings - An experiment configuration dataclass for runtime experiment parameters
- A
save()method if custom serialization logic is needed
Step 3: Update type aliases and registries
In configuration_utilities.py:
- Extend the
SystemConfigurationtype alias to include the new configuration class - Extend the
ExperimentConfigurationtype alias to include the new experiment configuration class - Add an entry to
_SYSTEM_CONFIG_CLASSESmapping the system name to its configuration class - Create an experiment factory function and register it in
_EXPERIMENT_CONFIG_FACTORIES
Step 4: Update downstream libraries
Coordinate changes with sl-experiment (data acquisition) and sl-forgery (data processing) as needed.
This project uses semantic versioning. See the tags on this repository for the available project releases.
- Ivan Kondratyev (Inkaros)
- Kushaan Gupta (kushaangupta)
- Natalie Yeung
This project is licensed under the GPL3 License: see the LICENSE file for details.
- All Sun lab members for providing the inspiration and comments during the development of this library.
- The creators of all other dependencies and projects listed in the pyproject.toml file.