-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty/initialize fields #1248
base: develop
Are you sure you want to change the base?
Empty/initialize fields #1248
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3766,6 +3766,22 @@ def _set_default_project(self): | |
self.Metadata_dialog.project_info = project_info | ||
self.Metadata_dialog.ProjectName.addItems([project_name]) | ||
return project_name | ||
|
||
def _empty_initialize_fields(self): | ||
'''empty fields from the previous session''' | ||
self.open_ephys=[] | ||
self.ManualWaterVolume=[0,0] | ||
# clear camera start and end time | ||
if not self.Camera_dialog.StartRecording.isChecked(): | ||
self.Camera_dialog.camera_start_time='' | ||
self.Camera_dialog.camera_stop_time='' | ||
# clear fiber start and end time | ||
if hasattr(self, 'fiber_photometry_end_time'): | ||
del self.fiber_photometry_end_time | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we deleting this one and not clearing it like the others? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. either way should work. I have updated to empty string to keep consistent. |
||
if not self.StartExcitation.isChecked(): | ||
if hasattr(self, 'fiber_photometry_start_time'): | ||
del self.fiber_photometry_start_time | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question here |
||
|
||
def _Start(self): | ||
'''start trial loop''' | ||
|
@@ -4054,8 +4070,8 @@ def _Start(self): | |
self._StopCurrentSession() | ||
# to see if we should start a new session | ||
if self.StartANewSession==1 and self.ANewTrial==1: | ||
# generate a new session id | ||
self.ManualWaterVolume=[0,0] | ||
# if we are starting a new session, we should initialize/empty some fields | ||
self._empty_initialize_fields() | ||
# start a new logging | ||
try: | ||
# Do not start a new session if the camera is already open, this means the session log has been started or the existing session has not been completed. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite know the downstream effect but would these variables be better initialized as None? seems weird to me that they are just empty stings but maybe that is what the code is expecting downstream
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also does this fix #1124?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's related to the downstream metadata generation. This empty str indicates no camera datastream detected.
Yes, that issue was fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@micahwoodard is the concern here addressed?