-
Notifications
You must be signed in to change notification settings - Fork 84
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
'Done' Button Implementation #2177
Conversation
e3cd470
to
4b9aa13
Compare
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.
A few inline comments, would be happy to talk in person about them.
tomviz/ProgressDialogManager.cxx
Outdated
@@ -81,7 +81,23 @@ void ProgressDialogManager::operationStarted() | |||
layout->addWidget(progressBar); | |||
} | |||
layout->addWidget(progressWidget); | |||
if (op->supportsCancelingMidTransform()) { | |||
if (op->supportsDoneingMidTransform()) { |
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.
Can we come up with a better name I don't "Doneing" is a word :-) What about "early completion"
tomviz/operators/Operator.h
Outdated
@@ -34,7 +34,8 @@ enum class OperatorState | |||
Complete, | |||
Canceled, | |||
Error, | |||
Edit | |||
Edit, | |||
Done |
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.
Do we need a new state or can we just use Complete
?
tomviz/operators/Operator.h
Outdated
bool isCanceled() { return m_state == OperatorState::Canceled; } | ||
bool isDone() | ||
{ | ||
return m_state == OperatorState::Done || m_state == OperatorState::Complete; |
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.
For the look of this, Complete
could be used without need to add another state.
tomviz/operators/OperatorPython.cxx
Outdated
@@ -144,6 +145,11 @@ OperatorPython::OperatorPython(DataSource* parentObject) | |||
qCritical() << "Unable to locate is_cancelable."; | |||
} | |||
|
|||
d->IsDoneableFunction = d->InternalModule.findFunction("is_doneable"); |
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.
supports_early_completion
?
tomviz/operators/OperatorPython.cxx
Outdated
@@ -144,6 +145,11 @@ OperatorPython::OperatorPython(DataSource* parentObject) | |||
qCritical() << "Unable to locate is_cancelable."; | |||
} | |||
|
|||
d->IsDoneableFunction = d->InternalModule.findFunction("is_doneable"); | |||
if (!d->IsDoneableFunction.isValid()) { | |||
qCritical() << "Unable to locate is_doneable."; |
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.
You probably want a return
, as the rest of the function is not going to work without the python function.
@jepietryga Why was |
It shouldn't have been, I didn't make any modifications to the thirdparty/pybind11 when I ran "git commit *". I have been having some git issues, so it's possible I accidentally pulled the most recent pybind11 while I was trying to fix things? It may be necessary for me to drop this current pull request and set-up a new one once these things are fixed. |
@jepietryga @cjh1 Is this one ready for merge? |
I think there are still some flake8 and clang format issues? |
I'll finalize this. There are some flake8 issues that I can't fix too easily, so some advice would be appreciated: The other flake issues and one clang issue should be quickly fixed. EDIT: The two above listed issues are the only remaining format concerns from flake8, clang is 100% good now! |
We can add some |
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.
@jepietryga We have fixed up the CI issues on our end of the CI is now clean ( along with you clang-format and flake8 fixes, thank you. I have one more suggestion and you can take it or leave it. Seeing earlyCompleted
typed out makes me thing that is should just be completed
and CompletableOperator
, others feel free to chime in. I think we are close, I just want to get the naming right as this will be part of the interface.
tomviz/operators/Operator.h
Outdated
|
||
/// Distinction between this and isFinished is necessary to prevent cascading | ||
/// errors | ||
bool isEarlyCompleted() { return m_state == OperatorState::Complete; } |
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.
Shouldn't this just be isCompleted
, more general and could be used else where.
tomviz/python/Recon_ART.py
Outdated
@@ -58,9 +58,15 @@ def transform(self, dataset, Niter=1, Nupdates=0, beta=1.0): | |||
counter = 1 | |||
for i in range(Niter): | |||
|
|||
if self.early_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 think this should just be completed
, if so we should make the change elsewhere as well.
tomviz/python/Recon_SIRT.py
Outdated
@@ -4,7 +4,7 @@ | |||
import time | |||
|
|||
|
|||
class ReconSirtOperator(tomviz.operators.CancelableOperator): | |||
class ReconSirtOperator(tomviz.operators.EarlyCompletableOperator): |
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.
Sorry to be a pain but seeing the names "written" down, may be this should just be CompletableOperator
In process of making the recommended changes! I think the recommended naming makes sense. |
@cjh1 Code should be working! The things I checked were using a sample dataset, then trying ART, SIRT, and TV Minimization. Part of the way through a reconstruction, I clicked the "Ok" button, then did some data transforms to ensure it didn't try to redo the pipeline |
…tive operators to be prematurely finished but still have their data used in a pipeline. Signed-off-by: jepi <jacobpietryga@gmail.com> Signed-off-by: Jacob Pietryga <jepi@umich.edu> Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Signed-off-by: jepi <jacobpietryga@gmail.com> Signed-off-by: Jacob Pietryga <jepi@umich.edu> Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Signed-off-by: jepi <jacobpietryga@gmail.com> Signed-off-by: Jacob Pietryga <jepi@umich.edu> Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Signed-off-by: jepi <jacobpietryga@gmail.com> Signed-off-by: Jacob Pietryga <jepi@umich.edu> Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Signed-off-by: jepi <jacobpietryga@gmail.com> Signed-off-by: Jacob Pietryga <jepi@umich.edu> Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Signed-off-by: Jacob Pietryga <jepi@umich.edu> Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Signed-off-by: Jacob Pietryga <jepi@umich.edu> Signed-off-by: jepietryga <jacobpietryga@gmail.com>
…ators to be early cancelable Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com> Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Co-authored-by: Christian Clauss <cclauss@me.com> Signed-off-by: jepietryga <jacobpietryga@gmail.com>
Signed-off-by: jepietryga <jacobpietryga@gmail.com>
57f18be
to
844e5f1
Compare
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.
@jepietryga LGTM, thanks for sticking with it!
This pull request implements a 'Done' button, specifically intended for iterative reconstruction algorithms that reach a desirable level of completion prior reaching the set number of iterations. Operators that are "Doneable" will be able to use this button to early terminate processing, but unlike cancel, the data will still be useable by subsequent operators (such as "Square Root") without restarting the pipeline.
Most changes are necessary for this functionality, but Recon_SIRT.py was changed simply to take advantage of it.
This addresses issue #2162.