Skip to content

Commit 04206da

Browse files
authored
Merge pull request #1627 from AllenNeuralDynamics/hot-fix-isnan-schedule-error
checks type for using np.isnan
2 parents de40e1a + be16b2b commit 04206da

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/foraging_gui/Foraging.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,7 +1623,7 @@ def _GetProtocol(self, mouse_id):
16231623
return
16241624
logging.info("Getting protocol")
16251625
protocol = self._GetInfoFromSchedule(mouse_id, "Protocol")
1626-
if (protocol is None) or (protocol == "") or (np.isnan(protocol)):
1626+
if (protocol is None) or (protocol == "") or (isinstance(protocol, (int, float, np.generic)) and np.isnan(protocol)):
16271627
if not self.Settings["add_default_project_name"]:
16281628
logging.info(
16291629
"Protocol not on schedule, not using default because add_default_project_name=False"
@@ -1634,7 +1634,7 @@ def _GetProtocol(self, mouse_id):
16341634
protocol = 2414
16351635

16361636
self.Metadata_dialog.meta_data["session_metadata"]["IACUCProtocol"] = (
1637-
str(int(protocol))
1637+
str(protocol)
16381638
)
16391639
self.Metadata_dialog._update_metadata(
16401640
update_rig_metadata=False, update_session_metadata=True

0 commit comments

Comments
 (0)