Contributing to OpenScope Experimental Launcher
Thank you for your interest in contributing! Our goal is to provide a generic, robust launcher for neuroscience experiments, with all project- and experiment-specific logic handled by modular pipeline modules.
Philosophy
Generic Launchers: The core launchers (for Bonsai, MATLAB, Python, etc.) are designed to be as generic as possible.
Modular Pipelines: All pre- and post-acquisition steps (e.g., mouse weight prompts, experiment notes) are implemented as standalone modules, not in the launcher core.
Extensibility: New modules can be added for any experiment-specific or project-specific operation, without modifying the launcher code.
How to Contribute
Fork the repository and create a branch.
Add or improve a module: - Launcher modules live in
src/openscope_experimental_launcher/pre_acquisitionorpost_acquisitionand typically exposerun_pre_acquisition/run_post_acquisition(orrun) returning0on success. - Script modules stay with the workflow repository checked out viarepository_url; reference them using the structuredmodule_type: "script_module"entry in your parameter file so they evolve alongside the main experiment code.Register your module in your parameter file: - For launcher modules, add the name (without
.py) topre_acquisition_pipelineorpost_acquisition_pipeline. - For script modules, add an object withmodule_type,module_path(relative to the repo root), and optionalmodule_parameters/function_args. See Pre- and Post-Acquisition Modules for the full schema.Write or update tests.
Submit a pull request.
Example: Adding a Pre-Acquisition Module
# src/openscope_experimental_launcher/pre_acquisition/my_custom_module.py
def run_pre_acquisition(param_file):
# Your logic here
return 0 # success
Example: Using Your Module in a Pipeline
{
"pre_acquisition_pipeline": [
"my_custom_module",
{
"module_type": "script_module",
"module_path": "code/custom_repo/pipeline/post_process.py",
"module_parameters": {
"function": "prepare_metadata",
"function_args": {
"output_path": "{session_folder}/derived/metadata.json"
}
}
}
],
...
}
Guidelines
Keep modules focused and single-purpose.
Do not add experiment-specific logic to the launcher core.
Document your module’s purpose and usage in its docstring.
See the
docs/folder for more details and best practices.
— MIT License.