You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every time PdfFit is instantiated, there is a block of text printed to the console. This similarly happens in other situations. I cannot catch this output because within the PdfFit.__init__ there is another line that globally overwrites stdout, making it impossible for me to redirect using e.g. a context manager. I'm not sure this is good practice: is there any particular reason this is done? I understand that it's important to the authors to display the copyright statements and whatnot, but surely it's reasonable to allow the user to disable this?
I have two suggestions:
Simply use print, instead of redirecting stdout, allowing users to catch this in an outer context
Allow the user to disable this block when initializing PdfFit.
Thanks!
The text was updated successfully, but these errors were encountered:
On Mon, May 13, 2024 at 12:04 PM Matthew Carbone ***@***.***> wrote:
This has been causing me some headaches:
https://github.com/diffpy/diffpy.pdffit2/blob/c4a2989a33f0ebaf0b650962073b0e04bec141de/diffpy/pdffit2/output.py#L28
Every time PdfFit is instantiated, there is a block of text printed to
the console. This similarly happens in other situations. I cannot catch
this output because within the PdfFit.__init__ there is another line that
*globally* overwrites stdout, making it impossible for me to redirect
using e.g. a context manager. I'm not sure this is good practice: is there
any particular reason this is done? I understand that it's important to the
authors to display the copyright statements and whatnot, but surely it's
reasonable to allow the user to disable this?
I have two suggestions:
1. Simply use print, instead of redirecting stdout, allowing users to
catch this in an outer context
2. Allow the user to disable this block when initializing PdfFit.
Thanks!
—
Reply to this email directly, view it on GitHub
<#25>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABAOWUNGNENQPFTQOB3KAETZCDQARAVCNFSM6AAAAABHUQALGCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGI4TGMRSHAYDQNQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Simon Billinge
Professor,
Department of Applied Physics and Applied Mathematics
Columbia University
This has been causing me some headaches:
diffpy.pdffit2/diffpy/pdffit2/output.py
Line 28 in c4a2989
Every time
PdfFit
is instantiated, there is a block of text printed to the console. This similarly happens in other situations. I cannot catch this output because within thePdfFit.__init__
there is another line that globally overwrites stdout, making it impossible for me to redirect using e.g. a context manager. I'm not sure this is good practice: is there any particular reason this is done? I understand that it's important to the authors to display the copyright statements and whatnot, but surely it's reasonable to allow the user to disable this?I have two suggestions:
PdfFit
.Thanks!
The text was updated successfully, but these errors were encountered: