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

Could we hide stdout for routines like abundance? #15

Open
DougBurke opened this issue Sep 24, 2021 · 0 comments
Open

Could we hide stdout for routines like abundance? #15

DougBurke opened this issue Sep 24, 2021 · 0 comments

Comments

@DougBurke
Copy link
Member

We could add a flag like quiet or redirect_stdout or ... so that we can run a routine and not see the stdout output:

>>> import xspec_models_cxc as x
>>> x.abundance('wilm')
 Solar Abundance Vector set to wilm:  Wilms, J., Allen, A. & McCray, R. ApJ 542 914 (2000) (abundances are set to zero for those elements not included in the paper).
>>> x.abundance('wilm', quiet=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: abundance(): incompatible function arguments. The following argument types are supported:
    1. () -> str
    2. (table: str) -> None

Invoked with: 'wilm'; kwargs: quiet=True

I think it's "more fun" than just adding a flag, as I have seen in Sherpa these messages appearing in the session where I'm running jupyter lab (i.e. who gets to define the stdout that the XSPEC model library is using?) but I don't have concrete evidence of this at this time.

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

No branches or pull requests

1 participant