File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 55import click
66import sys
77import os
8+ from datetime import datetime
89
910from .plots .animal import (
1011 plot_session_date ,
@@ -146,11 +147,20 @@ def generate_report(animal_id: int, output_dir: str):
146147 with open (report_file , "w" ) as f :
147148 f .write ("ETHOPY ANALYSIS REPORT\n " )
148149 f .write (f"Animal ID: { animal_id } \n " )
149- f .write ("Generated: {}\n " .format (click . DateTime (). now ()))
150+ f .write ("Generated: {}\n " .format (datetime . now ()))
150151 f .write ("=" * 50 + "\n \n " )
151152
152153 f .write ("SESSION SUMMARY\n " )
153154 f .write (f"Total sessions: { len (sessions )} \n " )
155+ if get_performance (animal_id , session_row ['session' ]) is None :
156+ f .write (
157+ f" Performance: no behavior in this session\n "
158+ )
159+ else :
160+ f .write (
161+ f" Performance: { get_performance (animal_id , session_row ['session' ]):.3f} \n "
162+ )
163+
154164 f .write (
155165 f"Session range: { sessions ['session' ].min ()} - { sessions ['session' ].max ()} \n \n "
156166 )
You can’t perform that action at this time.
0 commit comments