better / convoys

Implementation of statistical models to analyze time lagged conversions
https://better.engineering/convoys/
MIT License
258 stars 42 forks source link

prevent regression.py from producing garbage output in jupyter notebooks #94

Closed AlephNotation closed 5 years ago

AlephNotation commented 5 years ago

PR for #93

Check if user is calling GeneralizedGamma within a Jupyter Notebook and suppress sys.stdout.flush() if true. Still need to think about how to replicate the carriage return so we can see the updating as the model fits.

Current output:
image

PR output: image

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-1.2%) to 94.07% when pulling cc4c99b490b83f9073dff870df427da39c84d645 on AlephNotation:notebook-stdout-garbage-fix into 72c428cba9cf8ced4f54668fdeb6612c4865596b on better:master.

coveralls commented 5 years ago

Coverage Status

Coverage decreased (-1.2%) to 94.07% when pulling cc4c99b490b83f9073dff870df427da39c84d645 on AlephNotation:notebook-stdout-garbage-fix into 72c428cba9cf8ced4f54668fdeb6612c4865596b on better:master.

erikbern commented 5 years ago

Thanks! I actually think a better solution would be to not print anything to stdout by default, and take an extra parameter verbose which is False by default. I generally think help functions should be side-effect free (including any I/O). I made a bad choice w this when I built it...

erikbern commented 5 years ago

should be fixed in #114