Skip to content
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

8.26.0 #742

Merged
merged 17 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

8.26.0
------
* feature: added GUI field for session narrative
* changed: renamed menu item for getting V7 training status
* changed: documentation and tests
* removed: detailed version strings for IBLRIG (+dirty etc)

8.25.0
------
* feature: fiber photometry loader
Expand Down
2 changes: 2 additions & 0 deletions docs/source/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ Using IBLRIG v8
.. include:: usage_copy.rst
.. include:: usage_video.rst
.. include:: usage_neuropixel.rst
.. include:: usage_neurophotometrics.rst

9 changes: 1 addition & 8 deletions iblrig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,4 @@
# 5) git tag the release in accordance to the version number below (after merge!)
# >>> git tag 8.15.6
# >>> git push origin --tags
__version__ = '8.25.0'


from iblrig.version_management import get_detailed_version_string

# The following method call will try to get post-release information (i.e. the number of commits since the last tagged
# release corresponding to the one above), plus information about the state of the local repository (dirty/broken)
__version__ = get_detailed_version_string(__version__)
__version__ = '8.26.0'
7 changes: 3 additions & 4 deletions iblrig/base_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,11 +727,10 @@ def send2bonsai(self, **kwargs):
:example: client.send2bonsai(trial_num=6, sim_freq=50)
:return:
"""
for k in kwargs:
for k, v in kwargs.items():
if k in self.OSC_PROTOCOL:
# need to convert basic numpy types to low-level python types for
# punch card generation OSC module, I might as well have written C code
value = kwargs[k].item() if isinstance(kwargs[k], np.generic) else kwargs[k]
# need to convert basic numpy types to low-level python types for OSC module
value = v.item() if isinstance(v, np.generic) else v
self.send_message(self.OSC_PROTOCOL[k]['mess'], self.OSC_PROTOCOL[k]['type'](value))

def exit(self):
Expand Down
21 changes: 20 additions & 1 deletion iblrig/gui/tab_log.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from PyQt5.QtCore import QSettings, pyqtSlot
from PyQt5.QtCore import QSettings, QTimer, pyqtSignal, pyqtSlot
from PyQt5.QtGui import QBrush, QColorConstants, QFont
from PyQt5.QtWidgets import QApplication, QWidget

from iblrig.gui.ui_tab_log import Ui_TabLog


class TabLog(QWidget, Ui_TabLog):
_narrative = b''
narrativeUpdated = pyqtSignal(bytes)

def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.setupUi(self)
Expand All @@ -21,6 +24,22 @@ def __init__(self, *args, **kwargs):
self.spinBoxFontSize.valueChanged.connect(self.setFontSize)
self.spinBoxFontSize.setValue(self.settings.value('font_size', 11, int))

self.plainTextEditNarrative.textChanged.connect(self.narrativeChanged)
self.narrativeTimer = QTimer()
self.narrativeTimer.setSingleShot(True)
self.narrativeTimer.timeout.connect(self.narrativeTimerTimeout)

@pyqtSlot()
def narrativeChanged(self):
self.narrativeTimer.start(5000)

@pyqtSlot()
def narrativeTimerTimeout(self):
narrative = str.encode(self.plainTextEditNarrative.toPlainText())
if narrative != self._narrative:
self.narrativeUpdated.emit(narrative)
self._narrative = narrative

@pyqtSlot()
def clear(self):
"""Clear the log."""
Expand Down
4 changes: 2 additions & 2 deletions iblrig/gui/ui_login.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'iblrig/gui/ui_login.ui'
# Form implementation generated from reading ui file 'iblrig\gui\ui_login.ui'
#
# Created by: PyQt5 UI code generator 5.15.9
# Created by: PyQt5 UI code generator 5.15.10
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
Expand Down
58 changes: 53 additions & 5 deletions iblrig/gui/ui_tab_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,41 @@
class Ui_TabLog(object):
def setupUi(self, TabLog):
TabLog.setObjectName("TabLog")
TabLog.resize(607, 766)
TabLog.resize(619, 821)
self.verticalLayout = QtWidgets.QVBoxLayout(TabLog)
self.verticalLayout.setObjectName("verticalLayout")
self.plainTextEditLog = QtWidgets.QPlainTextEdit(TabLog)
self.splitter = QtWidgets.QSplitter(TabLog)
self.splitter.setFrameShape(QtWidgets.QFrame.NoFrame)
self.splitter.setOrientation(QtCore.Qt.Vertical)
self.splitter.setHandleWidth(12)
self.splitter.setChildrenCollapsible(False)
self.splitter.setObjectName("splitter")
self.widgetLog = QtWidgets.QWidget(self.splitter)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(2)
sizePolicy.setHeightForWidth(self.widgetLog.sizePolicy().hasHeightForWidth())
self.widgetLog.setSizePolicy(sizePolicy)
self.widgetLog.setObjectName("widgetLog")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.widgetLog)
self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.groupBoxLog = QtWidgets.QGroupBox(self.widgetLog)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(3)
sizePolicy.setHeightForWidth(self.groupBoxLog.sizePolicy().hasHeightForWidth())
self.groupBoxLog.setSizePolicy(sizePolicy)
self.groupBoxLog.setObjectName("groupBoxLog")
self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.groupBoxLog)
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.plainTextEditLog = QtWidgets.QPlainTextEdit(self.groupBoxLog)
self.plainTextEditLog.setStyleSheet("QPlainTextEdit {background-color: rgb(0, 0, 0)};")
self.plainTextEditLog.setLineWrapMode(QtWidgets.QPlainTextEdit.NoWrap)
self.plainTextEditLog.setReadOnly(True)
self.plainTextEditLog.setObjectName("plainTextEditLog")
self.verticalLayout.addWidget(self.plainTextEditLog)
self.widget = QtWidgets.QWidget(TabLog)
self.verticalLayout_5.addWidget(self.plainTextEditLog)
self.widget = QtWidgets.QWidget(self.groupBoxLog)
self.widget.setObjectName("widget")
self.horizontalLayout = QtWidgets.QHBoxLayout(self.widget)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
Expand All @@ -48,7 +73,27 @@ def setupUi(self, TabLog):
self.pushButtonClipboard.setIcon(icon)
self.pushButtonClipboard.setObjectName("pushButtonClipboard")
self.horizontalLayout.addWidget(self.pushButtonClipboard)
self.verticalLayout.addWidget(self.widget)
self.verticalLayout_5.addWidget(self.widget)
self.verticalLayout_2.addWidget(self.groupBoxLog)
self.widgetNarrative = QtWidgets.QWidget(self.splitter)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(1)
sizePolicy.setHeightForWidth(self.widgetNarrative.sizePolicy().hasHeightForWidth())
self.widgetNarrative.setSizePolicy(sizePolicy)
self.widgetNarrative.setObjectName("widgetNarrative")
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.widgetNarrative)
self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.groupsBoxNarrative = QtWidgets.QGroupBox(self.widgetNarrative)
self.groupsBoxNarrative.setObjectName("groupsBoxNarrative")
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.groupsBoxNarrative)
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.plainTextEditNarrative = QtWidgets.QPlainTextEdit(self.groupsBoxNarrative)
self.plainTextEditNarrative.setObjectName("plainTextEditNarrative")
self.verticalLayout_4.addWidget(self.plainTextEditNarrative)
self.verticalLayout_3.addWidget(self.groupsBoxNarrative)
self.verticalLayout.addWidget(self.splitter)
self.labelFontSize.setBuddy(self.spinBoxFontSize)

self.retranslateUi(TabLog)
Expand All @@ -57,11 +102,14 @@ def setupUi(self, TabLog):
def retranslateUi(self, TabLog):
_translate = QtCore.QCoreApplication.translate
TabLog.setWindowTitle(_translate("TabLog", "Form"))
self.groupBoxLog.setTitle(_translate("TabLog", "Session Log"))
self.labelFontSize.setStatusTip(_translate("TabLog", "Set the log\'s font size"))
self.labelFontSize.setText(_translate("TabLog", "&Font Size"))
self.spinBoxFontSize.setStatusTip(_translate("TabLog", "Set the log\'s font size"))
self.pushButtonClipboard.setStatusTip(_translate("TabLog", "Copy log to clipboard"))
self.pushButtonClipboard.setText(_translate("TabLog", " &Copy"))
self.groupsBoxNarrative.setTitle(_translate("TabLog", "Session Narrative"))
self.plainTextEditNarrative.setPlaceholderText(_translate("TabLog", "Enter your obvservations here ..."))
from iblrig.gui import resources_rc


Expand Down
Loading
Loading