auto-pi-lot / autopilot

Distributed behavioral experiments
https://docs.auto-pi-lot.com
Mozilla Public License 2.0
92 stars 23 forks source link

Trial_Data has no attribute columns #185

Open cxrodgers opened 2 years ago

cxrodgers commented 2 years ago

When running my task I get this traceback:

                    ERROR    [agents.pilot.Pilot.rpiparent03] got exception while running task, task stopping                                                        pilot.py:857
                              type object 'TrialData' has no attribute 'columns'                                                                                                 
                             ╭───────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────╮             
                             │ /home/pi/dev/autopilot/autopilot/agents/pilot.py:838 in run_task                                                                    │             
                             │                                                                                                                                     │             
                             │   835 │   │   │   │   │   # I think this is no longer true, there is no DATA                                                        │             
                             │   836 │   │   │   │   │   if trial_data:                                                                                            │             
                             │   837 │   │   │   │   │   │   for k, v in data.items():                                                                             │             
                             │ ❱ 838 │   │   │   │   │   │   │   if k in self.task.TrialData.columns.keys():                                                       │             
                             │   839 │   │   │   │   │   │   │   │   row[k] = v                                                                                    │             
                             │   840 │   │   │   │   │                                                                                                             │             
                             │   841 │   │   │   │   │   # If the trial is over (either completed or bailed), flush the row                                        │             
                             ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯             
                             AttributeError: type object 'TrialData' has no attribute 'columns'  

(Line numbers are different because I'm in my own branch.) But even so, this code doesn't look quite right to me, because self.task.TrialData is now of class autopilot.data.models.protocol.Trial_Data, which doesn't have an attribute columns. Should it be if k in self.task.TrialData.to_pytables_description().columns.keys()?