Skip to content

[FR] Report labels along with progress of delegated operations? #104

@brimoor

Description

@brimoor

Possible TODO

  • Add ProgressBar.start_msg property in voxel51-eta
  • Update all usages of ProgressBar in fiftyone to use start_msg rather 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:

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions