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

Feature Suggestion: Suppress stdout display within config #23

Closed
jranalli opened this issue Sep 27, 2021 · 2 comments
Closed

Feature Suggestion: Suppress stdout display within config #23

jranalli opened this issue Sep 27, 2021 · 2 comments

Comments

@jranalli
Copy link
Collaborator

jranalli commented Sep 27, 2021

I'd propose that you add a config option config['reg_printerror'] or similar to allow suppression of pm.utility.print_error and pm.utility.print_warn output to the stdout. Those outputs are helpful when doing command line programming, but can be an obstacle to try: except: structures meant to handle the error.

Example: To generate a constant entropy line on a pv diagram, you pass a list of pressures at a fixed entropy to T_s(p=p, s=s). There are some conditions where the list of pressures would make T exceed the maximum allowable T, so you could use a try: except pm.utility.PMParamError: structure to catch the error and retry with a limited pressure range in that case. It's useful not to have the error hit the stdout, since it's being handled. This is especially true when we're doing this for cgi figures in pyrodoc, where the stdout is generating useful code/image data.

@chmarti1
Copy link
Owner

This is good, and it is easy to do. I'll leave the issue open until the next major release.

@chmarti1
Copy link
Owner

This is now written in to the planned release for 2.2.0. There will be configuration parameters that allow users to mute error and warning messages. Thanks for the idea!

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