SainsburyWellcomeCentre / aeon_mecha

Project Aeon's main library for interfacing with acquired data. Contains modules for raw data file io, data querying, data processing, data qc, database ingestion, and building computational data pipelines.
BSD 3-Clause "New" or "Revised" License
6 stars 6 forks source link

Multiple patch rates and offsets found in one patch for one block #358

Closed ttngu207 closed 1 week ago

ttngu207 commented 7 months ago

In Block level analysis - we expect only one patch rate and patch offset for each patch.

However, in some blocks, there are multiple values found. We need to determine which value to use from the multiple values.

See attached csv file for blocks with the errors

df.csv

jkbhagatio commented 6 months ago

@glopesdev it seems like this is probably a bug where the PatchState is updating before the BlockState. In what cases can this occur?

And I guess for analysis for social02, we're fine just keeping the first rate (in blocks with >1 rate) as the "true" rate

jerlich commented 6 months ago

Is this a bug? At the block transition we don't change the rate until the next pellet delivery.

The csv only has the block times. Can you give an example the list of the rates in one block?

jkbhagatio commented 6 months ago

Is this a bug?

Yes.

Can you give an example the list of the rates in one block?

One patch in one block will have multiple rates: e.g. "100", "300". The bug seems to be that the BlockState file somehow gets written to twice around the time of a block transition, instead of just once, probably due to a race condition

jkbhagatio commented 5 months ago

These double 0's still occur in BlockState, but guess the second 0 can just kind of be safely ignored? @glopesdev

jkbhagatio commented 1 week ago

These double 0's still occur in BlockState, but guess the second 0 can just kind of be safely ignored?

yes.