You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ops need to report progress. Our current solution is the OpMonitor, although we may want to review whether we are happy with this mechanism before diving in to add progress reporting to all ops in the system.
I've been thinking about this, and I'm thinking that OpMonitor is not good enough. There are really two components to OpMonitor that should be partitioned out:
The cancellation feature
The progress reporting feature
OpMonitor should probably be remade into an agglomeration of two Objects tailored to each of these two functions. We also might get use of a Hints in there as well, but I wouldn't put it in to start.
I'm also not a fan of passing the OpMonitor through as a parameter. A BiFunction<Double, Double, Double> should not become a Functions.Arity3<Double, Double, OpMonitor, Double> because the OpMonitor is not an input to the algorithm. In other words, the specifics of the OpMonitor do not affect the output of the Op in the way that the two Double inputs do. So I'd like to find a better way to log progress reporting. I'd like to do it in some quasi-static way; it might be nice to have a ConcurrentHashMap<Object, ProgressReporter> where the Object is almost always this. This would also allow Ops to access the ProgressReporter of their OpDependency. Could we allow a static Map in DefaultOpEnvironment, where every Op call initializes a ProgressReporter placeholder? Is there any reason why one Map throughout the whole application is a bad idea? Then, once the user calls apply, the Op can do the progress reporting (if it chooses)? I might try to prototype something tomorrow...
I do like many of the ideas of the progress reporter created within ITK, and think we should do something similar.
Using UUIDs in the creation of a ProgressReporter to differentiate multiple runs of the same Op. Ideally, could this be linked into the creation of the OpExecutionSummary?
Use injection instead of setProgressReporter... like injecting a "slot", or "populator", so that Ops could decide what kind of progress reporter to create without needing to store them at an instance level (e.g. so that static methods & multiple runs on the same object will report progress properly). This would probably work similar to Op dependencies..
Ternary progress reporting (start, stop, in-progress) would be managed by the OpWrapper, with the "injection" scheme mentioned above as a supplement to provide stepwise progress.
I think this issue has been solved for a good amount of time. Ops can report progress through the Progress class, and at the very least all Ops exhibit binary (ternary?) progress reporting when called through the OpBuilder, thanks to AbstractRichOp. So I think we're done here!
I think it is premature to close this. There are many ops that could easily report their progress with Progress but do not currently do so, and in my view, this issue is about adding those calls. For example, coloc.pValue is an expensive operation that calls another coloc op repeatedly in a loop, in order to measure some statistical significance, which would really benefit from progress reporting to communicate how long the user must wait.
There are many ops that could easily report their progress with Progress but do not currently do so, and in my view, this issue is about adding those calls
Heh, that was not what I understood this issue to be. I was focusing on this, from the original message, especially since the following comments were the foundation of what has become scijava-progress:
although we may want to review whether we are happy with this mechanism before diving in to add progress reporting to all ops in the system.
With that being said:
For example, coloc.pValue is an expensive operation that calls another coloc op repeatedly in a loop, in order to measure some statistical significance, which would really benefit from progress reporting to communicate how long the user must wait.
I agree we should do this, but I figured it would come up in another, more dedicated issue, because it isn't clear to me that it belongs here. I filed #128 to track this.
Activity
gselzer commentedon May 13, 2021
Time commitment: 3 weeks
gselzer commentedon Jun 7, 2021
I've been thinking about this, and I'm thinking that
OpMonitoris not good enough. There are really two components toOpMonitorthat should be partitioned out:OpMonitorshould probably be remade into an agglomeration of twoObjects tailored to each of these two functions. We also might get use of aHintsin there as well, but I wouldn't put it in to start.I'm also not a fan of passing the
OpMonitorthrough as a parameter. ABiFunction<Double, Double, Double>should not become aFunctions.Arity3<Double, Double, OpMonitor, Double>because theOpMonitoris not an input to the algorithm. In other words, the specifics of theOpMonitordo not affect the output of the Op in the way that the twoDoubleinputs do. So I'd like to find a better way to log progress reporting. I'd like to do it in some quasi-static way; it might be nice to have aConcurrentHashMap<Object, ProgressReporter>where theObjectis almost alwaysthis. This would also allow Ops to access theProgressReporterof theirOpDependency. Could we allow a staticMapinDefaultOpEnvironment, where every Op call initializes aProgressReporterplaceholder? Is there any reason why oneMapthroughout the whole application is a bad idea? Then, once the user callsapply, the Op can do the progress reporting (if it chooses)? I might try to prototype something tomorrow...I do like many of the ideas of the progress reporter created within ITK, and think we should do something similar.
hinerm commentedon Jun 25, 2021
@gselzer and I discussed a bit today. Highlights:
ProgressReporterto differentiate multiple runs of the same Op. Ideally, could this be linked into the creation of theOpExecutionSummary?setProgressReporter... like injecting a "slot", or "populator", so that Ops could decide what kind of progress reporter to create without needing to store them at an instance level (e.g. so that static methods & multiple runs on the same object will report progress properly). This would probably work similar to Op dependencies..OpWrapper, with the "injection" scheme mentioned above as a supplement to provide stepwise progress.gselzer commentedon Jul 25, 2023
I think this issue has been solved for a good amount of time. Ops can report progress through the
Progressclass, and at the very least all Ops exhibit binary (ternary?) progress reporting when called through theOpBuilder, thanks toAbstractRichOp. So I think we're done here!ctrueden commentedon Jul 25, 2023
I think it is premature to close this. There are many ops that could easily report their progress with
Progressbut do not currently do so, and in my view, this issue is about adding those calls. For example,coloc.pValueis an expensive operation that calls another coloc op repeatedly in a loop, in order to measure some statistical significance, which would really benefit from progress reporting to communicate how long the user must wait.gselzer commentedon Jul 25, 2023
Heh, that was not what I understood this issue to be. I was focusing on this, from the original message, especially since the following comments were the foundation of what has become
scijava-progress:With that being said:
I agree we should do this, but I figured it would come up in another, more dedicated issue, because it isn't clear to me that it belongs here. I filed #128 to track this.
Merge pull request #42 from scijava/scijava/scijava-ops-api/matching-…