Skip to content

Commit 4987f7f

Browse files
committed
script as software
1 parent 3f19221 commit 4987f7f

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/aind_data_schema/device.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ class Software(AindModel):
103103

104104
name: str = Field(..., title="Software name")
105105
version: str = Field(..., title="Software version")
106+
url: Optional[str] = Field(None, title="URL to commit being used")
106107
parameters: Optional[dict] = Field(None, title="Software parameters", additionalProperties={"type": "string"})
107108

108109

src/aind_data_schema/stimulus.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,10 @@ class BehaviorStimulation(AindModel):
9898
title="Behavior software",
9999
description="The software used to control the behavior (e.g. Bonsai)",
100100
)
101-
behavior_script: str = Field(
101+
behavior_script: Software = Field(
102102
...,
103103
title="Behavior script",
104-
description="URL for the commit of the code used to run the behavior",
105-
)
106-
behavior_script_version: str = Field(..., title="Behavior script version")
107-
input_parameters: Dict[str, Any] = Field(
108-
..., title="Input parameters", description="Parameters used in behavior session"
104+
description="provide URL to the commit of the script and the parameters used",
109105
)
110106
output_parameters: Dict[str, Any] = Field(
111107
...,

tests/test_behavior.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,15 @@ def test_constructors(self):
5757
behavior_software=[Software(
5858
name="Bonsai",
5959
version="0.1"
60-
)
60+
),
6161
],
6262
session_number=3,
63-
behavior_script="URL_to_code",
64-
behavior_script_version="0.1",
65-
input_parameters={"reward volume": 0.01},
63+
behavior_script=Software(
64+
name="Foraging v1",
65+
version="0.1",
66+
url="URL_to_code",
67+
input_parameters={"reward probability": 0.08},
68+
),
6669
output_parameters={},
6770
reward_consumed_during_epoch=820,
6871
trials_total=551,

0 commit comments

Comments
 (0)