Skip to content

Commit

Permalink
fixing clang and flake issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jepietryga committed Aug 18, 2021
1 parent fee159a commit 925fff2
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion thirdparty/pybind11
Submodule pybind11 updated 118 files
21 changes: 12 additions & 9 deletions tomviz/operators/Operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ class Operator : public QObject
/// Returns true if the operation supports early completion midway through the
/// applyTransform function via the cancelTransform slot. Defaults to false,
/// can be set by the setSupportsEarlyCompletion(bool) method by subclasses.
bool supportsEarlyCompletionMidTransform() const { return m_supportsEarlyCompletion; }
bool supportsEarlyCompletionMidTransform() const
{
return m_supportsEarlyCompletion;
}

/// Return the total number of progress updates (assuming each update
/// increments the progress from 0 to some maximum. If the operator doesn't
Expand Down Expand Up @@ -254,11 +257,9 @@ public slots:
virtual void earlyCompletionTransform();
bool isCanceled() { return m_state == OperatorState::Canceled; }

/// Distinction between this and isFinished is necessary to prevent cascading errors
bool isEarlyCompleted()
{
return m_state == OperatorState::Complete;
}
/// Distinction between this and isFinished is necessary to prevent cascading
/// errors
bool isEarlyCompleted() { return m_state == OperatorState::Complete; }
bool isFinished()
{
return m_state == OperatorState::Complete ||
Expand Down Expand Up @@ -292,9 +293,11 @@ protected slots:
/// the cancelTransform slot to listen for the cancel signal and handle it.
void setSupportsCancel(bool b) { m_supportsCancel = b; }

/// Method to set whether the operator supports early completion midway through the
/// transform method call. If you set this to true, you should also override
/// the earlyCompletionTransform slot to listen for the done signal and handle it.
/// Method to set whether the operator supports early completion midway
/// through the transform method call.
/// If you set this to true, you should also override
/// the earlyCompletionTransform slot to listen for the done signal and
/// handle it.
void setSupportsEarlyCompletion(bool b) { m_supportsEarlyCompletion = b; }

private:
Expand Down
3 changes: 2 additions & 1 deletion tomviz/operators/OperatorPython.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ OperatorPython::OperatorPython(DataSource* parentObject)
qCritical() << "Unable to locate is_cancelable.";
}

d->IsEarlyCompletableFunction = d->InternalModule.findFunction("is_early_completable");
d->IsEarlyCompletableFunction =
d->InternalModule.findFunction("is_early_completable");
if (!d->IsEarlyCompletableFunction.isValid()) {
qCritical() << "Unable to locate is_early_completeable.";
return;
Expand Down
3 changes: 2 additions & 1 deletion tomviz/pybind11/Wrapping.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ PYBIND11_PLUGIN(_wrapping)
py::class_<OperatorPythonWrapper>(m, "OperatorPythonWrapper")
.def(py::init([](void* op) { return new OperatorPythonWrapper(op); }))
.def_property_readonly("canceled", &OperatorPythonWrapper::canceled)
.def_property_readonly("early_completed", &OperatorPythonWrapper::earlyCompleted)
.def_property_readonly("early_completed",
&OperatorPythonWrapper::earlyCompleted)
.def_property("progress_maximum",
&OperatorPythonWrapper::totalProgressSteps,
&OperatorPythonWrapper::setTotalProgressSteps)
Expand Down
12 changes: 7 additions & 5 deletions tomviz/python/tomviz/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ def canceled(self):

class EarlyCompletableOperator(CancelableOperator):
"""
An early completable operator allows a user to interrupt the execution of an operator
using either "cancel" or "early complete". The early completable property can be
used in the transform(...) method to break out when an operator is finished early,
like if an iterative algorithm is a reasonable quality before the designated
iterations are reached. Use similar to "cancel", but be sure to return data.
An early completable operator allows a user to interrupt the execution of
an operator using either "cancel" or "early complete".
The early completable property can be used in the transform(...)
method to break out when an operator is finished early,
like if an iterative algorithm is a reasonable quality before
the designated iterations are reached.
Use similar to "cancel", but be sure to return data.
"""
@property
def early_completed(self):
Expand Down

0 comments on commit 925fff2

Please sign in to comment.