-
Notifications
You must be signed in to change notification settings - Fork 99
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
PR3: Display changelog/announcement page in SLEAP GUI #1556
base: shrivaths/changelog-announcement-2
Are you sure you want to change the base?
Changes from 30 commits
b7f7748
25eda37
8706ccb
fdf5547
d584de2
f809bda
cce7183
2c68518
ca25347
27f0d28
168056e
5e2fb37
944428f
793faa6
561a109
465eb3f
f7c510d
d071ac8
58ffca8
02aa249
a724ec2
9827510
cd98d7c
a9673d8
b7e475d
2cc02d7
709de70
18974db
cada26c
3c35dda
713c068
86d1a44
1737561
7859b93
ec2b2d7
59f2438
bd8d004
ea2111d
7ff49f0
5391131
6ddb158
895a074
af67d55
b5d5139
150453d
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[ | ||
{ | ||
"title": "SLEAP v1.3.3", | ||
"date": "12/12/2023", | ||
"content": "\n\n\nThis is a brown-bag release following insufficient restrictions on allowable `tensorflow` versions for the \"pypi\" extra `sleap[pypi]` in 1.3.2. While the conda packages for 1.3.2 were not affected (since `tensorflow` is pulled in from anaconda), the PyPI only package installed via `pip install sleap[pypi]` had conflicts between the version of `tensorflow` and the version of `keras`. See [1.3.0](https://github.com/talmolab/sleap/releases/tag/v1.3.0), [1.3.1](https://github.com/talmolab/sleap/releases/tag/v1.3.1), and [1.3.2](https://github.com/talmolab/sleap/releases/tag/v1.3.2) for previous notable changes. \n\n**From 1.3.2+, to install SLEAP through pip use `pip install sleap[pypi]` to ensure all dependencies are gathered.**\n\nAs a reminder:\n\n> The 1.3.1 dependency update requires [Mamba](https://mamba.readthedocs.io/en/latest/index.html) for faster dependency resolution. If you already have anaconda installed, then you _can_ set the solver to libmamba in the base environment:\n>```\n>conda update -n base conda\n>conda install -n base conda-libmamba-solver\n>conda config --set solver libmamba\n>```\n>Any subsequent `mamba` commands in the docs will need to be replaced with `conda` if you choose to use your existing Anaconda installation. \n>\n>Otherwise, follow the [recommended installation instruction for Mamba](https://mamba.readthedocs.io/en/latest/installation.html).\n\n### Quick install\n**`mamba` (Windows/Linux/GPU)**:\n```\nmamba create -y -n sleap -c conda-forge -c nvidia -c sleap -c anaconda sleap=1.3.3\n```\n\n**`mamba` (Mac)**:\n```\nmamba create -y -n sleap -c conda-forge -c anaconda -c sleap sleap=1.3.3\n```\n\n**`pip` (any OS except Apple Silicon)**:\n```\npip install sleap[pypi]==1.3.3\n```\n\n### Full Changelog\n\n##### Fixes\n* Do not try to remove item if already deleted by @roomrys in https://github.com/talmolab/sleap/pull/1498\n* Set `LD_LIBRARY_PATH` on mamba activate by @roomrys in https://github.com/talmolab/sleap/pull/1496\n* Reset `LD_LIBRARY_PATH` on deactivate by @roomrys in #1502\n\n##### Dependencies\n* Add version restirctions to tendorflow for pypi by @roomrys in #1485\n* Remove `imageio` pin by @roomrys in #1501\n\n**Full Changelog**: https://github.com/talmolab/sleap/compare/v1.3.2...v1.3.3\n\n" | ||
}, | ||
{ | ||
"title": "SLEAP v1.3.2", | ||
"date": "12/10/2023", | ||
"content": "\n\n\nSLEAP 1.3.2 adds some nice usability features thanks to both the community ideas and new contributors! See [1.3.0](https://github.com/talmolab/sleap/releases/tag/v1.3.0) and [1.3.1](https://github.com/talmolab/sleap/releases/tag/v1.3.1) for previous notable changes. As a reminder:\n\n> The 1.3.1 dependency update requires [Mamba](https://mamba.readthedocs.io/en/latest/index.html) for faster dependency resolution. If you already have anaconda installed, then you _can_ set the solver to libmamba in the base environment:\n>```\n>conda update -n base conda\n>conda install -n base conda-libmamba-solver\n>conda config --set solver libmamba\n>```\n>Any subsequent `mamba` commands in the docs will need to be replaced with `conda` if you choose to use your existing Anaconda installation. \n>\n>Otherwise, follow the [recommended installation instruction for Mamba](https://mamba.readthedocs.io/en/latest/installation.html).\n\n### Quick install\n**`mamba` (Windows/Linux/GPU)**:\n```\nmamba create -y -n sleap -c conda-forge -c nvidia -c sleap -c anaconda sleap=1.3.2\n```\n\n**`mamba` (Mac)**:\n```\nmamba create -y -n sleap -c conda-forge -c anaconda -c sleap sleap=1.3.2\n```\n\n**`pip` (any OS except Apple Silicon)**:\n```\npip install sleap[pypi]==1.3.2\n```\n\n### Highlights\n* Limit max tracks via track-local queues by @shrivaths16 and @talmo in https://github.com/talmolab/sleap/pull/1447\n* Add option to remove videos in batch by @gitttt-1234 in https://github.com/talmolab/sleap/pull/1382 and https://github.com/talmolab/sleap/pull/1406\n* Add shortcut to export analysis for current video by @KevinZ0217 in https://github.com/talmolab/sleap/pull/1414 and https://github.com/talmolab/sleap/pull/1444\n* Add video path and frame indices to metrics by @roomrys in https://github.com/talmolab/sleap/pull/1396\n* Add a button for copying model config to clipboard by @KevinZ0217 in https://github.com/talmolab/sleap/pull/1433\n* Add Option to Export CSV by @gitttt-1234 in https://github.com/talmolab/sleap/pull/1438\n\n### Full Changelog\n\n##### Enhancements\n* Add option to remove videos in batch by @gitttt-1234 in https://github.com/talmolab/sleap/pull/1382 and https://github.com/talmolab/sleap/pull/1406\n* Add `Track` when add `Instance` by @roomrys in https://github.com/talmolab/sleap/pull/1408\n* Add `Video` to cache when adding `Track` by @roomrys in https://github.com/talmolab/sleap/pull/1407\n* Add shortcut to export analysis for current video by @KevinZ0217 in https://github.com/talmolab/sleap/pull/1414 and https://github.com/talmolab/sleap/pull/1444\n* Add video path and frame indices to metrics by @roomrys in https://github.com/talmolab/sleap/pull/1396\n* Improve error message for detecting video backend by @roomrys in https://github.com/talmolab/sleap/pull/1441\n* Add a button for copying model config to clipboard by @KevinZ0217 in https://github.com/talmolab/sleap/pull/1433\n* Add Option to Export CSV by @gitttt-1234 in https://github.com/talmolab/sleap/pull/1438\n* Limit max tracks via track-local queues by @shrivaths16 and @talmo in https://github.com/talmolab/sleap/pull/1447\n\n##### Fixes\n* Minor fix in computation of OKS by @shrivaths16 in https://github.com/talmolab/sleap/pull/1383 and https://github.com/talmolab/sleap/pull/1399\n* Fix `Filedialog` to work across (mac)OS by @roomrys in https://github.com/talmolab/sleap/pull/1393\n* Fix panning bounding box by @gitttt-1234 in https://github.com/talmolab/sleap/pull/1398\n* Fix skeleton templates by @roomrys in https://github.com/talmolab/sleap/pull/1404\n* Fix labels export for json by @roomrys in https://github.com/talmolab/sleap/pull/1410\n* Correct GUI state emulation by @roomrys in https://github.com/talmolab/sleap/pull/1422\n* Update status message on status bar by @shrivaths16 in https://github.com/talmolab/sleap/pull/1411\n* Fix error thrown when last video is deleted by @shrivaths16 in https://github.com/talmolab/sleap/pull/1421\n* Add model folder to the unzip path by @roomrys in https://github.com/talmolab/sleap/pull/1445\n* Fix drag and drop by @talmo in https://github.com/talmolab/sleap/pull/1449\n\n##### Dependencies\n* Pin micromamba version by @roomrys in https://github.com/talmolab/sleap/pull/1376\n* Add pip extras by @roomrys in https://github.com/talmolab/sleap/pull/1481\n\n##### New Contributors\n* @shrivaths16 made their first contribution in https://github.com/talmolab/sleap/pull/1383\n* @gitttt-1234 made their first contribution in https://github.com/talmolab/sleap/pull/1382\n* @KevinZ0217 made their first contribution in https://github.com/talmolab/sleap/pull/1414\n\n**Full Changelog**: https://github.com/talmolab/sleap/compare/v1.3.1...v1.3.2\n" | ||
} | ||
] |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,89 @@ | ||||||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||||||
GUI for displaying the new announcement. | ||||||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
from qtpy.QtCore import Signal, Qt | ||||||||||||||||||||||||||||||||
from qtpy.QtWebEngineWidgets import QWebEngineView | ||||||||||||||||||||||||||||||||
from qtpy.QtCore import Property, Signal, QObject, QUrl | ||||||||||||||||||||||||||||||||
from qtpy.QtWebChannel import QWebChannel | ||||||||||||||||||||||||||||||||
from qtpy import QtWidgets | ||||||||||||||||||||||||||||||||
from pathlib import Path | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
class BulletinWorker(QtWidgets.QMainWindow): | ||||||||||||||||||||||||||||||||
def __init__(self, content, parent=None): | ||||||||||||||||||||||||||||||||
super(BulletinWorker, self).__init__(parent) | ||||||||||||||||||||||||||||||||
self._content = content | ||||||||||||||||||||||||||||||||
# Set the window to stay on top | ||||||||||||||||||||||||||||||||
self.setWindowFlags(self.windowFlags() | Qt.WindowStaysOnTopHint) | ||||||||||||||||||||||||||||||||
self.setWindowTitle("What's New?") | ||||||||||||||||||||||||||||||||
self.setGeometry(0, 0, 900, 750) | ||||||||||||||||||||||||||||||||
self.center_on_screen() | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
def center_on_screen(self): | ||||||||||||||||||||||||||||||||
# Get the screen geometry | ||||||||||||||||||||||||||||||||
screen_geometry = QtWidgets.QDesktopWidget().screenGeometry() | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
# Calculate the center of the screen | ||||||||||||||||||||||||||||||||
center_x = (screen_geometry.width() - self.width()) // 2 | ||||||||||||||||||||||||||||||||
center_y = (screen_geometry.height() - self.height()) // 2 | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
# Move the window to the center of the screen | ||||||||||||||||||||||||||||||||
self.move(center_x, center_y) | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
def show_bulletin(self): | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
self.document = Document() | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
# Set the webchannel | ||||||||||||||||||||||||||||||||
self.channel = QWebChannel() | ||||||||||||||||||||||||||||||||
self.channel.registerObject("content", self.document) | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
self.document.set_text(self._content) | ||||||||||||||||||||||||||||||||
self.view = QWebEngineView() | ||||||||||||||||||||||||||||||||
self.view.page().setWebChannel(self.channel) | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
filename = str(Path(__file__).resolve().parent / "bulletin/markdown.html") | ||||||||||||||||||||||||||||||||
url = QUrl.fromLocalFile(filename) | ||||||||||||||||||||||||||||||||
self.view.load(url) | ||||||||||||||||||||||||||||||||
Comment on lines
+46
to
+48
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. The path to the - filename = str(Path(__file__).resolve().parent / "bulletin/markdown.html")
+ filename = Path(__file__).resolve().parent / "bulletin/markdown.html" Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
self.view.setGeometry(0, 0, 600, 400) | ||||||||||||||||||||||||||||||||
# Set the central window with view | ||||||||||||||||||||||||||||||||
self.setCentralWidget(self.view) | ||||||||||||||||||||||||||||||||
self.show() | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
class Document(QObject): | ||||||||||||||||||||||||||||||||
textChanged = Signal(str) | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
def __init__(self, parent=None): | ||||||||||||||||||||||||||||||||
super().__init__(parent) | ||||||||||||||||||||||||||||||||
self.m_text = "" | ||||||||||||||||||||||||||||||||
Comment on lines
+59
to
+61
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. As per the previous review comment, consider adding an optional - def __init__(self, parent=None):
+ def __init__(self, parent=None, text=""):
super().__init__(parent)
- self.m_text = ""
+ self.m_text = text Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
Comment on lines
+59
to
+62
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. The - def __init__(self, parent=None):
+ def __init__(self, parent=None, text=""):
super().__init__(parent)
- self.m_text = ""
+ self.m_text = text Commitable suggestion (Beta)
Suggested change
|
||||||||||||||||||||||||||||||||
def get_text(self): | ||||||||||||||||||||||||||||||||
return self.m_text | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
def set_text(self, text): | ||||||||||||||||||||||||||||||||
if self.m_text == text: | ||||||||||||||||||||||||||||||||
return | ||||||||||||||||||||||||||||||||
self.m_text = text | ||||||||||||||||||||||||||||||||
self.textChanged.emit(self.m_text) | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
text = Property(str, fget=get_text, fset=set_text, notify=textChanged) | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
# class MyWebEngineView(QWebEngineView): | ||||||||||||||||||||||||||||||||
# def createWindow(self, type): | ||||||||||||||||||||||||||||||||
# new_view = MyWebEngineView(self) | ||||||||||||||||||||||||||||||||
# new_view.show() | ||||||||||||||||||||||||||||||||
# return new_view | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
# def acceptNavigationRequest(self, url, navigation_type, is_main_frame): | ||||||||||||||||||||||||||||||||
# if navigation_type == QWebEnginePage.NavigationTypeLinkClicked: | ||||||||||||||||||||||||||||||||
# # Emit the linkClicked signal when a link is clicked | ||||||||||||||||||||||||||||||||
# self.page().mainFrame().javaScriptWindowObjectCleared.connect( | ||||||||||||||||||||||||||||||||
# lambda: self.page().mainFrame().addToJavaScriptWindowObject("linkHandler", self) | ||||||||||||||||||||||||||||||||
# ) | ||||||||||||||||||||||||||||||||
# self.page().runJavaScript("linkHandler.linkClicked('%s');" % url.toString()) | ||||||||||||||||||||||||||||||||
# return False | ||||||||||||||||||||||||||||||||
# return super().acceptNavigationRequest(url, navigation_type, is_main_frame) | ||||||||||||||||||||||||||||||||
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. Commented-out code, such as the - # class MyWebEngineView(QWebEngineView):
- # def createWindow(self, type):
- # ...
- # return new_view
- # ... Committable suggestion
Suggested change
|
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.
The class
BulletinWorker
is named as if it performs background work, but it inherits fromQMainWindow
and seems to be responsible for UI presentation. Consider renaming the class to reflect its purpose more accurately.