Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,14 @@ def _map(self) -> Acquisition:
# populate behavior epoch
metrics = dataset["Behavior"]["Metrics"].data
trial_outcomes = dataset["Behavior"]["SoftwareEvents"]["TrialOutcome"].data["data"].iloc
rewarded = sum(to["is_rewarded"] for to in trial_outcomes)
rewarded = sum(to["is_rewarded"] or (to["trial"]["is_auto_reward_right"] is not None) for to in trial_outcomes)
finished = sum(to["is_right_choice"] is not None for to in trial_outcomes)
water = calculate_consumed_water(self.data_path)
performance_metrics = PerformanceMetrics(
reward_consumed_during_epoch=None if not water else Decimal(str(water)),
reward_consumed_unit=units.VolumeUnit.ML,
trials_total=trial_outcomes[:].shape[0],
trials_finished=metrics.unignored_trials_per_session[-1],
trials_finished=finished,
trials_rewarded=rewarded,
output_parameters=metrics.model_dump(),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def _get_water_calibration(rig_model: AindDynamicForagingRig) -> list[CALIBRATIO
fit_type=FitType.LINEAR,
fit_parameters=GenericModel.model_validate(wc.model_dump()),
),
notes="Water calibration model can be found at https://github.com/AllenNeuralDynamics/Aind.Behavior.Services/blob/main/src/aind_behavior_services/rig/water_valve.py.",
)
)
return vol_cal
Expand Down Expand Up @@ -289,8 +290,8 @@ def _map(self) -> Instrument:
lick_spouts=[
LickSpout(
name="Left lick spout",
manufacturer=Organization.OTHER,
notes=" (v1v2 upgrade): 'manufacturer' field was missing, defaulting to 'Other'.",
manufacturer=Organization.UNKNOWN,
notes="Lick spout manufacturer is unknown.",
spout_diameter=Decimal("1.2"),
spout_diameter_unit=SizeUnit.MM,
solenoid_valve=Device(
Expand All @@ -306,7 +307,7 @@ def _map(self) -> Instrument:
),
LickSpout(
name="Right lick spout",
manufacturer=Organization.OTHER,
manufacturer=Organization.UNKNOWN,
notes="Lick spout manufacturer is unknown.",
spout_diameter=Decimal("1.2"),
spout_diameter_unit=SizeUnit.MM,
Expand Down Expand Up @@ -365,7 +366,7 @@ def _map(self) -> Instrument:
grounded=False,
laser_interlock=False,
air_filtration=False,
notes=" (v1v2 upgrade): Scale is width/length/height",
notes="Scale is width/length/height",
)
)

Expand Down