SainsburyWellcomeCentre / aeon_experiments

Experiment workflows for Project Aeon
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

Fix timestamp errors and repetitions in environment subject visits #551

Closed aspaNeuro closed 1 month ago

aspaNeuro commented 1 month ago

There was a CombineLatest storing the SubjectState inside this workflow which was resending the old event of a visit when subject state changed. The timestamp from the past would sometimes imply that the logger would try to write into a file that was previously created and closed, causing the application to crash.

The FormatRegionVisits.bonsai was refactored to ensure only subject visit changes are logged by adding a WithLatestFrom to gate the output from CombineLatest.

Fixes #514