Skip to content

MS2PIPFeatureGenerator and DeepLCFeatureGenerator, provide a progress callback #150

@vrkosk

Description

@vrkosk

Currently (ms2rescore 3.0.3), MS2PIPFeatureGenerator has some code to provide a progress bar when running in a terminal. It's done using rich.progress.track. DeepLCFeatureGenerator seems to not use it.

When a script using MS2PIPFeatureGenerator is run with stderr and stdout is directed to something that isn't a terminal (e.g. pipe to a file or another process), there's no progress feedback printed. It would be nice to have some mechanism to print simple progress messages instead of a rich progress bar. For example, just provide a lambda argument like:

    MS2PIPFeatureGenerator(
        progress_callback=lambda percentage, text: print "PROGRESS:{}; {}".format(percentage, text)
   )

Pretty much any other way is fine, even sending them as logging.info() messages.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions