File tree Expand file tree Collapse file tree 4 files changed +82
-8
lines changed Expand file tree Collapse file tree 4 files changed +82
-8
lines changed Original file line number Diff line number Diff line change @@ -1556,12 +1556,30 @@ def _check_line_terminator(self, file_path):
1556
1556
def _LoadSchedule (self ):
1557
1557
if os .path .exists (self .Settings ["schedule_path" ]):
1558
1558
schedule = pd .read_csv (self .Settings ["schedule_path" ])
1559
+
1560
+ # Find the correct week on the schedule
1561
+ dividers = schedule [[isinstance (x ,str )and ('/' in x ) for x in schedule ['Mouse ID' ].values ]]
1562
+ today = datetime .now ().strftime ('%m/%d/%Y' )
1563
+
1564
+ # Multiple weeks on the schedule
1565
+ if len (dividers ) > 1 :
1566
+ first = dividers .iloc [0 ]['Mouse ID' ]
1567
+ if datetime .strptime (today , "%m/%d/%Y" ) < datetime .strptime (first ,"%m/%d/%Y" ):
1568
+ # Use last weeks schedule
1569
+ schedule = schedule .loc [dividers .index .values [1 ]:]
1570
+ else :
1571
+ # Use this weeks schedule
1572
+ schedule = schedule .loc [0 :dividers .index .values [1 ]]
1573
+
1574
+ # Determine what mice are on the schedule
1559
1575
self .schedule_mice = [
1560
1576
x
1561
1577
for x in schedule ["Mouse ID" ].unique ()
1562
1578
if isinstance (x , str ) and (len (x ) > 3 ) and ("/" not in x )
1563
1579
]
1564
- self .schedule = schedule .dropna (subset = ["Mouse ID" , "Box" ]).copy ()
1580
+
1581
+ # Clear rows without a mouse
1582
+ self .schedule = schedule .dropna (subset = ["Mouse ID" ]).copy ()
1565
1583
logging .info ("Loaded behavior schedule" )
1566
1584
else :
1567
1585
self .schedule_mice = None
Original file line number Diff line number Diff line change 262
262
</property >
263
263
</widget >
264
264
</item >
265
+ <item row =" 2" column =" 3" >
266
+ <widget class =" QSpinBox" name =" hab_time_box" >
267
+ <property name =" sizePolicy" >
268
+ <sizepolicy hsizetype =" Fixed" vsizetype =" Fixed" >
269
+ <horstretch >0</horstretch >
270
+ <verstretch >0</verstretch >
271
+ </sizepolicy >
272
+ </property >
273
+ <property name =" minimum" >
274
+ <number >0</number >
275
+ </property >
276
+ <property name =" maximum" >
277
+ <number >90</number >
278
+ </property >
279
+ <property name =" suffix" >
280
+ <string > min</string >
281
+ </property >
282
+ <property name =" prefix" >
283
+ <string > Habituation: </string >
284
+ </property >
285
+ </widget >
286
+ </item >
265
287
<item row =" 2" column =" 1" >
266
288
<widget class =" QPushButton" name =" Save" >
267
289
<property name =" sizePolicy" >
Original file line number Diff line number Diff line change 69
69
<widget class =" QComboBox" name =" Task" >
70
70
<property name =" geometry" >
71
71
<rect >
72
- <x >620 </x >
72
+ <x >650 </x >
73
73
<y >20</y >
74
74
<width >152</width >
75
75
<height >20</height >
2763
2763
<bool >false</bool >
2764
2764
</property >
2765
2765
</widget >
2766
+ <widget class =" QSpinBox" name =" hab_time_box" >
2767
+ <property name =" enabled" >
2768
+ <bool >true</bool >
2769
+ </property >
2770
+ <property name =" geometry" >
2771
+ <rect >
2772
+ <x >240</x >
2773
+ <y >20</y >
2774
+ <width >110</width >
2775
+ <height >23</height >
2776
+ </rect >
2777
+ </property >
2778
+ <property name =" sizePolicy" >
2779
+ <sizepolicy hsizetype =" Expanding" vsizetype =" Expanding" >
2780
+ <horstretch >0</horstretch >
2781
+ <verstretch >0</verstretch >
2782
+ </sizepolicy >
2783
+ </property >
2784
+ <property name =" styleSheet" >
2785
+ <string notr =" true" />
2786
+ </property >
2787
+ <property name =" minimum" >
2788
+ <number >0</number >
2789
+ </property >
2790
+ <property name =" maximum" >
2791
+ <number >90</number >
2792
+ </property >
2793
+ <property name =" suffix" >
2794
+ <string > min</string >
2795
+ </property >
2796
+ <property name =" prefix" >
2797
+ <string > Habituation: </string >
2798
+ </property >
2799
+ </widget >
2766
2800
<widget class =" QPushButton" name =" NewSession" >
2767
2801
<property name =" enabled" >
2768
2802
<bool >true</bool >
3263
3297
<widget class =" QLineEdit" name =" ID" >
3264
3298
<property name =" geometry" >
3265
3299
<rect >
3266
- <x >324 </x >
3300
+ <x >380 </x >
3267
3301
<y >20</y >
3268
3302
<width >71</width >
3269
3303
<height >20</height >
3282
3316
<widget class =" QLabel" name =" label_72" >
3283
3317
<property name =" geometry" >
3284
3318
<rect >
3285
- <x >300 </x >
3319
+ <x >350 </x >
3286
3320
<y >20</y >
3287
3321
<width >21</width >
3288
3322
<height >20</height >
3658
3692
<widget class =" QLabel" name =" label_74" >
3659
3693
<property name =" geometry" >
3660
3694
<rect >
3661
- <x >400 </x >
3695
+ <x >450 </x >
3662
3696
<y >20</y >
3663
3697
<width >71</width >
3664
3698
<height >20</height >
3683
3717
<widget class =" QLineEdit" name =" Experimenter" >
3684
3718
<property name =" geometry" >
3685
3719
<rect >
3686
- <x >474 </x >
3720
+ <x >524 </x >
3687
3721
<y >20</y >
3688
3722
<width >121</width >
3689
3723
<height >20</height >
5016
5050
</tabstops >
5017
5051
<resources />
5018
5052
<connections />
5019
- </ui >
5053
+ </ui >
Original file line number Diff line number Diff line change 1
- __version__ = "1.6.39 "
1
+ __version__ = "1.6.42 "
You can’t perform that action at this time.
0 commit comments