Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"bonsai.sgen": {
"version": "0.4.0",
"version": "0.6.1",
"commands": [
"bonsai.sgen"
]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ bin
obj
Packages
Bonsai.exe.WebView2
Bonsai/Settings/
*.bin
*.avi
*.dll
Expand Down
100 changes: 50 additions & 50 deletions bonsai/Bonsai.config

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion bonsai/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ if (!(Test-Path "./Bonsai.exe")) {
Expand-Archive "temp.zip" -DestinationPath "." -Force
Move-Item -Path "temp.config" "NuGet.config" -Force -ErrorAction SilentlyContinue
Remove-Item -Path "temp.zip"
Remove-Item -Path "Bonsai32.exe"
}
& .\Bonsai.exe --no-editor
Pop-Location
9 changes: 0 additions & 9 deletions docs/json-schemas.rig.rst

This file was deleted.

22 changes: 16 additions & 6 deletions docs/json-schemas.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
json-schemas
json-schema
-------------
.. toctree::
:maxdepth: 4
The following json-schemas are used as the format definition of the input for this task. They are the result of the `Pydantic`` models defined in `src/aind_behavior_device_olfactometer`, and are also used to generate `src/Extensions/AindBehaviorDeviceOlfactometer.cs` via `Bonsai.Sgen`.

json-schemas.session
json-schemas.rig
json-schemas.task_logic
`Download Schema <https://raw.githubusercontent.com/AllenNeuralDynamics/Aind.Behavior.Device.Olfactometer/main/src/DataSchemas/aind_behavior_device_olfactometer.json>`_

Task Logic Schema
~~~~~~~~~~~~~~~~~
.. jsonschema:: https://raw.githubusercontent.com/AllenNeuralDynamics/Aind.Behavior.Device.Olfactometer/main/src/DataSchemas/aind_behavior_device_olfactometer.json#/$defs/OlfactometerCalibrationLogic
:lift_definitions:
:auto_reference:


Rig Schema
~~~~~~~~~~~~~~
.. jsonschema:: https://raw.githubusercontent.com/AllenNeuralDynamics/Aind.Behavior.Device.Olfactometer/main/src/DataSchemas/aind_behavior_device_olfactometer.json#/$defs/OlfactometerCalibrationRig
:lift_definitions:
:auto_reference:
9 changes: 0 additions & 9 deletions docs/json-schemas.session.rst

This file was deleted.

9 changes: 0 additions & 9 deletions docs/json-schemas.task_logic.rst

This file was deleted.

6 changes: 6 additions & 0 deletions examples/clabe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# In order to get picked up, move this file to the root of the project or ./local

data_dir: C:/Data

default_behavior_picker:
config_library_dir: '\\allen\aind\scratch\AindBehavior.db\AindBehaviorDeviceOlfactometer'
23 changes: 21 additions & 2 deletions examples/olfactometer.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import os

from aind_behavior_services.base import get_commit_hash
from aind_behavior_services.calibration import aind_manipulator as man
from aind_behavior_services.calibration import olfactometer as olf
from aind_behavior_services.rig import HarpAnalogInput, HarpWhiteRabbit
from aind_behavior_services.rig.harp import HarpAnalogInput, HarpWhiteRabbit
from aind_behavior_services.session import AindBehaviorSessionModel
from aind_behavior_services.utils import utcnow

from aind_behavior_device_olfactometer import rig, task_logic
from aind_behavior_device_olfactometer.rig import AlicatFlowmeter

channels_config = {
olf.OlfactometerChannel.Channel0: olf.OlfactometerChannelConfig(
Expand Down Expand Up @@ -45,11 +47,28 @@
commit_hash=get_commit_hash(),
)

manipulator_calibration = man.AindManipulatorCalibration(
output=man.AindManipulatorCalibrationOutput(),
input=man.AindManipulatorCalibrationInput(
full_step_to_mm=(man.ManipulatorPosition(x=0.010, y1=0.010, y2=0.010, z=0.010)),
axis_configuration=[
man.AxisConfiguration(axis=man.Axis.Y1, min_limit=-0.01, max_limit=25),
man.AxisConfiguration(axis=man.Axis.Y2, min_limit=-0.01, max_limit=25),
man.AxisConfiguration(axis=man.Axis.X, min_limit=-0.01, max_limit=25),
man.AxisConfiguration(axis=man.Axis.Z, min_limit=-0.01, max_limit=25),
],
homing_order=[man.Axis.Y1, man.Axis.Y2, man.Axis.X, man.Axis.Z],
initial_position=man.ManipulatorPosition(y1=0, y2=0, x=0, z=0),
),
)

_rig = rig.OlfactometerCalibrationRig(
rig_name="OlfactometerRig",
harp_olfactometer=rig.HarpOlfactometer(port_name="COM10", calibration=calibration),
harp_olfactometer=olf.Olfactometer(port_name="COM10", calibration=calibration),
harp_analog_input=HarpAnalogInput(port_name="COM8"),
harp_clock_generator=HarpWhiteRabbit(port_name="COM9"),
harp_manipulator=man.AindManipulatorDevice(port_name="COM7", calibration=manipulator_calibration),
flowmeter=AlicatFlowmeter(port_name="COM6", device_id="A", pooling_period=0.2),
)


Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ classifiers = [
]

dependencies = [
"aind_behavior_services>=0.10, <0.11",
"aind_behavior_services<0.13",
]

[project.urls]
Expand All @@ -29,7 +29,7 @@ Changelog = "https://github.com/AllenNeuralDynamics/Aind.Behavior.Device.Olfacto

[project.optional-dependencies]

launcher = ["aind_behavior_experiment_launcher[aind-services]>=0.3.0"]
launcher = ["aind_clabe[aind-services]"]

dev = ["aind_behavior_device_olfactometer[launcher]",
"ruff",
Expand All @@ -47,7 +47,7 @@ docs = [
]

analysis = [
"aind-behavior-core-analysis@git+https://github.com/AllenNeuralDynamics/Aind.Behavior.CoreAnalysis@051bc0c",
"contraqctor",
"numpy",
"pandas",
"matplotlib",
Expand Down
1 change: 1 addition & 0 deletions scripts/deploy.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
powershell -ExecutionPolicy Bypass -File .\scripts\deploy.ps1
27 changes: 27 additions & 0 deletions scripts/deploy.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
$scriptPath = $MyInvocation.MyCommand.Path
$scriptDirectory = Split-Path -Parent $scriptPath
Set-Location (Split-Path -Parent $scriptDirectory)
Write-Output "Creating a Python environment..."

if (-not (Get-Command uv -ErrorAction SilentlyContinue)) {
throw "The 'uv' command was not found. See https://docs.astral.sh/uv/getting-started/installation/ for instructions."
}

if (Test-Path -Path ./.venv) {
Remove-Item ./.venv -Recurse -Force
}
&uv venv
.\.venv\Scripts\Activate.ps1
Write-Output "Synchronizing environment..."
&uv sync --extra launcher
Write-Output "Creating a Bonsai environment and installing packages..."
if (Test-Path -Path "bonsai") {
Set-Location "bonsai"
.\setup.ps1
} elseif (Test-Path -Path ".bonsai") {
Set-Location ".bonsai"
.\setup.ps1
} else {
throw "Neither 'bonsai' nor '.bonsai' directory found."
}
Set-Location ..
Loading
Loading