-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Possible TODO
- Add
ProgressBar.start_msgproperty invoxel51-eta - Update all usages of
ProgressBarinfiftyoneto usestart_msgrather than separate logging messages - Update the progress callbacks introduced in Report progress of delegated operations #101 PR to use
ctx.set_progress(label=pb.start_msg, progress=pb.progress)
Why? This would provide a bit more info to users about what is actually happening in our builtin operations. This may be especially useful if there is a builtin operation that uses multiple progress bars, in which case the naive implementation may involve two separate progress bars that "reset" progress back to 0% when the second progress bar starts.
One operation that could "want" to have multiple progress bars is @voxel51/io/import_samples when uploading media to a new location before adding samples:
fiftyone-plugins/plugins/io/__init__.py
Line 957 in 3bde4f8
| fos.copy_files(inpaths, outpaths) |
Currently if the upload step happens, there is no progress bar, so the progress indicator in #101 is not particularly useful in this case as it will sit at 0% for awhile and then rapidly jump to 100% as add_samples() is a faster operation than copy_files().
An alternative to the double progress bar problem is this pattern:
progress1 = lambda pb: ctx.set_progress(progress=0.5 * pb.progress)
progress2 = lambda pb: ctx.set_progress(progress=0.5 + 0.5 * pb.progress)