-
Notifications
You must be signed in to change notification settings - Fork 3
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
Create a GudPy class #487
Create a GudPy class #487
Conversation
… run purge, GUI iteration workflow
…ers to avoid writing test files to home directory
Test Results 3 files 3 suites 51m 16s ⏱️ Results for commit 76026cb. ♻️ This comment has been updated with latest results. |
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.
Huuuuuge!
It's hard to do anything other than a sweeping review on a PR of this size, but the overriding impression is that this makes things a lot more harmonious, a lot cleaner, and a lot easier to read and understand workflow-wise compared to what we had before. Fabulous job!
Some small comments and typo corrections, but basically ready to go in and move on.
Co-authored-by: Tristan Youngs <[email protected]>
Very large PR that serves to reduce bugs and create a distinction between the headless and GUI modes of gudpy.
Key goals of this PR:
GudPyMainWindow
Implements three significant modules:
core/gudpy
The main backend module that handles all of the processing logic, made to be completely separate from Qt. Contains the following classes:
GudPy
Class to act as the main GudPy backend. Holds all the necessary data and implements all functions needed to run GudPy headlessly.
Process
Base class for all processes.
Implements a key function
_outputChanged
which is called on output of the underlying process, and allows the class to be subclassed by a QThread with this function to be overriden by a signal-emitting function- therefore removing the need to reimpliment the logic to be compatible with the GUI version.Purge(Process), Gudrun(Process)
Classes to manage the running of purge_det and gudrun_dcs binaries.
Runs all processes inside a temporary directory using a context manager to avoid polluting the user's directory. Replaces the use of
subprocess.run()
withsubprocess.Popen
to allow simpler live-output capture.GudrunIterator, CompositionIterator
Class to manage the iteration of gudrun_dcs.
Takes away logic/task queing responsibilities from the iteration dialog classes. Replaces using a queue with a list of Gudrun objects that are iterated over.
RunModes
Class that combines the old
gudpy/core/run_containers_as_samples.py
andgudpy/core/run_individual_files.py
modules into one class that can manage different modes to run gudrun.BatchProcessing
Class to manage the batch processing workflow, implementing all the newly refactored methods.
gui/widgets/core/worker
The module that provides GUI compatibility/Multithreading to the classes in
core/gudpy
.Subclasses
QThread
and the processing classes incore/gudpy
to implement slots and signals and extra logic needed for the GUI. Allows for the headless mode to maintain complete separation from Qt.Replaces the previous use of
QProcess
with creatingQThread
workers for each process.gui/widgets/core/control
Contains the class
GudPyController
to act as the controller between the GUI and the backend (GudPy) class.Significantly removes responsibility from
GudPyMainWindow
and creates a separation between logic and GUI methods.Reimplements functions from
GudPy
class to accomodate the GUI.