Skip to content

Commit

Permalink
Merge pull request #1 from Woutah/release-0.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Woutah authored Jul 6, 2023
2 parents 4eb687a + f845b63 commit 8c839a9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
3 changes: 2 additions & 1 deletion configurun/app/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class OptionsSource(Enum):
QUEUE = 1


class MainWindow():
class MainWindow(QtCore.QObject):
"""
The main QT window for this app which provides the user with several tools to edit/manage/run machine learning
settings.
Expand Down Expand Up @@ -73,6 +73,7 @@ def __init__(self,
settings_in_workspace_path (bool, optional): Whether to store the settings in the workspace path or in the default
QSettings location. Defaults to True
"""
super().__init__()
self.ui = Ui_MainWindow() # pylint: disable=C0103
self.ui.setupUi(window)

Expand Down
7 changes: 1 addition & 6 deletions configurun/app/models/run_queue_table_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def set_run_queue(self, new_run_queue : RunQueue) -> None:
for connection in self._run_queue_connections:
connection.disconnect()

#NOTE: runqueue connections are not qt-signals, insertions etc. are not necessarily done in the main thread
self._run_queue_connections.append(self._run_queue.queueChanged.connect(self._queue_changed))
self._run_queue_connections.append( #On item-insertion in runQueue
self._run_queue.allItemsDictInsertion.connect(self._handle_run_queue_insertion)
Expand All @@ -139,12 +140,6 @@ def set_run_queue(self, new_run_queue : RunQueue) -> None:
self._run_queue_connections.append(self._run_queue.autoProcessingStateChanged.connect(
self.autoprocessing_state_changed))


# self._cur_queue_copy = self._run_queue.get_queue_snapshot_copy()
# self._cur_run_list_copy = self._run_queue.get_run_list_snapshot_copy()


# if also_instantiate:
self._reset_model()
self.endResetModel()

Expand Down
16 changes: 14 additions & 2 deletions configurun/app/network_main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class NetworkMainWindow(MainWindow):
- settings_in_workspace_path (bool, optional) - Whether to store the settings in the workspace path or in the
default QSettings location. Defaults to True
"""
_authenConnectionStateChanged = QtCore.Signal(bool) #Emitted when the connection state changes (True=authenticated)
# Copy used to make sure that the signal emitted from the run_queue is emitted in the qt-main thread
# (since it's a non-qt signal using PySignal).

def __init__(self,
configuration_model : ConfigurationModel,
Expand Down Expand Up @@ -102,8 +105,17 @@ def __init__(self,
self.server_connection_state_changed(self._run_queue.is_connected_and_authenticated()) #Set initial state


#========= Link runqueue signals to UI updates ===========
#NOTE: authenConnectionChanged is a non-main-thread non-qt-signal
# as such, we must make sure that updates to the UI are done in the main thread by using a single-shot timer
self._authenConnectionStateChanged.connect(self.server_connection_state_changed)
self._run_queue.authenConnectionStateChanged.connect(
lambda connected : self._authenConnectionStateChanged.emit(connected)
)



#=========== Link connection view buttons to connection window ==============
self._run_queue.authenConnectionStateChanged.connect(self.server_connection_state_changed)
self.network_connection_widget.connectClicked.connect(self.connect_to_server)
self.network_connection_widget.disconnectClicked.connect(self.disconnect_from_server)
self.network_connection_widget.cancelClicked.connect(lambda *_: self.connection_window.close())
Expand Down Expand Up @@ -175,7 +187,7 @@ def server_connection_state_changed(self, connected : bool) -> None:
else:
self.network_connection_widget.client_disconnected()
self.connection_window.activateWindow()
self.connection_window.show()
self.connection_window.show() #Goes wrong here
self.window.statusBar().showMessage("Not Connected", timeout=0) #Show message until next msg


Expand Down
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@

setup(
name = "configurun",
version= "0.2.1",
version= "0.2.2",
packages=find_packages('.'),
description=("PySide6 based user-interface tools to create and manage machine learning "
"training/testing-configurations and run them automatically and/or remotely.."),
description=("Cross-platform user-interface tools to create and manage (machine learning) configurations and run them automatically and remotely."),
long_description=open('README.md', encoding='utf-8').read(),
long_description_content_type='text/markdown',
author="Wouter Stokman",
Expand All @@ -22,7 +21,7 @@
'multiprocess>=0.70.00', #Works for 0.70.14
'numpydoc>=1.4.0', #Works for 1.5.0
'pycryptodome>=3.10.0', #Works for 3.18.0
'pyside6-utils==1.2.0',
'pyside6-utils>=1.2.0',
'PySignal>=1.1.1' #Works for 1.1.1,
]
)

0 comments on commit 8c839a9

Please sign in to comment.