Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MS2PIPFeatureGenerator and DeepLCFeatureGenerator, provide a progress callback #150

Open
vrkosk opened this issue May 23, 2024 · 1 comment

Comments

@vrkosk
Copy link

vrkosk commented May 23, 2024

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.

@vrkosk
Copy link
Author

vrkosk commented Aug 8, 2024

There is actually debug logging that is almost sufficient for what I was looking for. I've done:

logging.getLogger('ms2rescore.feature_generators.deeplc').setLevel(logging.DEBUG)
logging.getLogger('deeplc.deeplc').setLevel(logging.DEBUG)

logging.getLogger('ms2rescore.feature_generators.ms2pip').setLevel(logging.DEBUG)
logging.getLogger('ms2pip.core').setLevel(logging.DEBUG)

And this gives sufficient progress messages from DeepLC (e.g. an ASCII progress bar). Maybe it's sufficient to increment the log level of these messages to INFO?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants