a
    SmÍi6  ã                   @   sH   d dl Z d dlmZ d dlmZ G dd„ dejƒZG dd„ dejƒZdS )é    N)Údatetime)Údbc                   @   sî   e Zd ZdZejejddZeje d¡dddZ	eje d¡ddZ
e ej¡Ze e d¡¡Zejejd	d
Zejejdd
Zejejd	d
Zejejdd
Zeje d¡ddZeje d¡ddZejejed
ZejddddZdS )ÚAnalysisTypeZanalysis_typesT©Úprimary_keyé2   F)ÚuniqueÚnullableéÿ   )r	   r   ©Údefaulté   ÚAnalysisRunZanalysis_typeÚdynamic)ÚbackrefÚlazyN)Ú__name__Ú
__module__Ú__qualname__Ú__tablename__r   ÚColumnÚIntegerÚidÚStringÚslugÚnameÚTextÚdescriptionÚcategoryZ	min_fixesZmin_animalsÚFloatZmin_duration_hoursÚBooleanZrequires_regular_samplingZpython_moduleZpython_functionÚJSONÚdictZdefault_paramsÚrelationshipÚruns© r%   r%   úL/home/japhy/trackingScienceReplication.artiswrong.com/app/models/analysis.pyr      s   r   c                   @   s(  e Zd ZdZejejddZeje d¡dd„ ddZ	e eje 
d¡¡Ze eje 
d	¡¡Ze eje 
d
¡¡Ze ej¡Ze ej¡Ze ej¡Ze ej¡ZejejedZeje d¡ddZe e d¡¡Ze ej¡Ze ej¡Ze ej¡Ze ej¡Ze ej¡ZejejejdZ dS )r   Úanalysis_runsTr   é$   c                   C   s   t t ¡ ƒS )N)ÚstrÚuuidÚuuid4r%   r%   r%   r&   Ú<lambda>!   ó    zAnalysisRun.<lambda>)r   r   zusers.idzdatasets.idzanalysis_types.idr   é   Zqueuedr
   N)!r   r   r   r   r   r   r   r   r   r*   Ú
ForeignKeyÚuser_idÚ
dataset_idZanalysis_type_idr!   Z
animal_idsÚDateTimeÚ
time_startÚtime_endZbboxr"   ÚparamsÚstatusZcelery_task_idZ
started_atZcompleted_atr   Úerror_messageZresult_summaryZresult_artifactsr   ÚutcnowÚ
created_atr%   r%   r%   r&   r      s&   r   )r*   r   Úapp.extensionsr   ÚModelr   r   r%   r%   r%   r&   Ú<module>   s   