Open JaerongA opened 6 months ago
Thanks @JaerongA .
@jkbhagatio, these are the files to be manually fixed and placed into the preprocessed
directory
@JaerongA any other chunks/files from other streams? (potentially ingestion errors from the streams
schema)?
@ttngu207 Yes, there are 16 keys that errored out in the streams
schema.
Here's the code that yielded key errors.
from aeon.schema import schemas
from aeon.io.api import load
from aeon.dj_pipeline import acquisition, streams
import pandas as pd
import datetime
key = {'experiment_name': 'social0.1-aeon3',
'chunk_start': datetime.datetime(2023, 12, 1, 14, 0),
'device_serial_number': 'COM15',
'rfid_reader_install_time': datetime.datetime(2023, 11, 22, 10, 19, 33)}
chunk_start, chunk_end, dir_type = (acquisition.Chunk & key).fetch1(
"chunk_start", "chunk_end", "directory_type"
)
raw_data_dir = acquisition.Experiment.get_data_directory(key, directory_type=dir_type)
device_name = (streams.RfidReader & key).fetch1('rfid_reader_name')
devices_schema = getattr(
schemas,
(acquisition.Experiment.DevicesSchema & {"experiment_name": key["experiment_name"]}).fetch1(
"devices_schema_name"
),
)
stream_reader = getattr(getattr(devices_schema, device_name), "RfidEvents")
stream_data = load(
root=raw_data_dir.as_posix(),
reader=stream_reader,
start=pd.Timestamp(chunk_start),
end=pd.Timestamp(chunk_end),
)
keys
keys = [
{
"experiment_name": "social0.1-aeon3",
"chunk_start": datetime.datetime(2023, 12, 1, 14, 0),
"device_serial_number": "COM15",
"rfid_reader_install_time": datetime.datetime(2023, 11, 22, 10, 19, 33),
},
{
"experiment_name": "social0.1-aeon3",
"chunk_start": datetime.datetime(2023, 11, 30, 15, 47, 19),
"device_serial_number": "COM12",
"rfid_reader_install_time": datetime.datetime(2023, 11, 22, 10, 19, 33),
},
{
"experiment_name": "social0.1-aeon3",
"chunk_start": datetime.datetime(2023, 12, 2, 15, 58, 34),
"device_serial_number": "COM13",
"rfid_reader_install_time": datetime.datetime(2023, 11, 22, 10, 19, 33),
},
{
"experiment_name": "social0.1-aeon3",
"chunk_start": datetime.datetime(2023, 12, 3, 13, 5, 15),
"device_serial_number": "COM15",
"rfid_reader_install_time": datetime.datetime(2023, 11, 22, 10, 19, 33),
},
{
"experiment_name": "social0.1-aeon3",
"chunk_start": datetime.datetime(2023, 11, 30, 13, 0),
"device_serial_number": "COM13",
"rfid_reader_install_time": datetime.datetime(2023, 11, 22, 10, 19, 33),
},
{
"experiment_name": "social0.1-aeon3",
"chunk_start": datetime.datetime(2023, 11, 30, 14, 0),
"device_serial_number": "COM17",
"rfid_reader_install_time": datetime.datetime(2023, 11, 22, 10, 19, 33),
},
{
"experiment_name": "social0.1-aeon3",
"chunk_start": datetime.datetime(2023, 12, 2, 15, 0),
"device_serial_number": "COM13",
"rfid_reader_install_time": datetime.datetime(2023, 11, 22, 10, 19, 33),
},
{
"experiment_name": "social0.1-aeon3",
"chunk_start": datetime.datetime(2023, 12, 3, 13, 30, 30),
"device_serial_number": "COM15",
"rfid_reader_install_time": datetime.datetime(2023, 11, 22, 10, 19, 33),
},
{
"experiment_name": "social0.1-aeon3",
"chunk_start": datetime.datetime(2023, 11, 30, 13, 55, 41),
"device_serial_number": "COM13",
"rfid_reader_install_time": datetime.datetime(2023, 11, 22, 10, 19, 33),
},
{
"experiment_name": "social0.1-aeon3",
"chunk_start": datetime.datetime(2023, 11, 30, 15, 0),
"device_serial_number": "COM17",
"rfid_reader_install_time": datetime.datetime(2023, 11, 22, 10, 19, 33),
},
{
"experiment_name": "social0.1-aeon3",
"chunk_start": datetime.datetime(2023, 11, 30, 15, 47, 19),
"device_serial_number": "COM17",
"rfid_reader_install_time": datetime.datetime(2023, 11, 22, 10, 19, 33),
},
{
"experiment_name": "social0.1-aeon3",
"chunk_start": datetime.datetime(2023, 12, 3, 13, 0),
"device_serial_number": "COM15",
"rfid_reader_install_time": datetime.datetime(2023, 11, 22, 10, 19, 33),
},
{
"experiment_name": "social0.1-aeon3",
"chunk_start": datetime.datetime(2023, 12, 2, 14, 0),
"device_serial_number": "COM13",
"rfid_reader_install_time": datetime.datetime(2023, 11, 22, 10, 19, 33),
},
{
"experiment_name": "social0.1-aeon3",
"chunk_start": datetime.datetime(2023, 11, 30, 14, 0),
"device_serial_number": "COM12",
"rfid_reader_install_time": datetime.datetime(2023, 11, 22, 10, 19, 33),
},
{
"experiment_name": "social0.1-aeon3",
"chunk_start": datetime.datetime(2023, 11, 30, 15, 0),
"device_serial_number": "COM12",
"rfid_reader_install_time": datetime.datetime(2023, 11, 22, 10, 19, 33),
},
{
"experiment_name": "social0.1-aeon3",
"chunk_start": datetime.datetime(2023, 12, 1, 14, 0),
"device_serial_number": "COM12",
"rfid_reader_install_time": datetime.datetime(2023, 11, 22, 10, 19, 33),
},
]
Thanks @JaerongA
Looks like the errors are mostly from SubjectVisits
and Rfid
streams
Once the corrected data has been put in 'processed' I will let @ttngu207 @JaerongA know, to proceed with ingestion
This is related to #327 . The following 9 chunks from social0.2 (from AEON3 and AEON4) have errored out during
acquisition.Environment
ingestion.For example, running the following code yields a KeyError.