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

ENH: make minimal traceback reporting optional #91

Merged
merged 1 commit into from
Sep 26, 2020

Conversation

tacaswell
Copy link
Member

Because sometimes you do want to see the full tracebacks.

@codecov-commenter
Copy link

codecov-commenter commented Jul 1, 2020

Codecov Report

Merging #91 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #91   +/-   ##
=======================================
  Coverage   66.66%   66.66%           
=======================================
  Files           1        1           
  Lines           3        3           
=======================================
  Hits            2        2           
  Misses          1        1           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a689bd6...7e1d1a8. Read the comment docs.

Copy link
Member

@mrakitin mrakitin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Have a couple of minor suggestions.

@@ -92,7 +93,9 @@ def configure_base(
True by default. Console output and exception stack traces will be
written to IPython log file when IPython logging is enabled.
publish_documents_to_kafka: boolean, optional
False by default. If True publish bluesky documents to a Kafka message broker.
False by default. If True publish bluesky documents to a Kafka message broker
tb_minimize : boolean, optional
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tb_minimize : boolean, optional
tb_minimize: boolean, optional

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

numpydoc says there should be a space before the :.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, it's conflicting with what we discovered recently with @danielballan. Dan, do you remember where we saw issues with the latest Sphinx?

# always configure %xmode minimal
# so short tracebacks are printed to the console
get_ipython().magic("xmode minimal")
# always
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it left after moving comments around?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops.

@klauer
Copy link
Contributor

klauer commented Jul 1, 2020

It'd be nice if there were an exception stashing mechanism that worked like:

In [6]: %xmode minimal
Exception reporting mode: Minimal

In [7]: def test():
   ...:     raise Exception('oops')
   ...:

In [8]: test()
Exception: oops
(To see the full exception, run `%xstashed 4`)

In [9]: %xstashed 4
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
<ipython-input-11-fbd55f77ab7c> in <module>
----> 1 test()
        global test = <function test at 0x10fa3a9e0>

<ipython-input-7-5f7df1f0ec85> in test()
      1 def test():
----> 2     raise Exception('oops')
        global Exception = undefined
      3

Exception: oops

Of course %debug could be used so long as you're only interested in the last raised exception.
At least with the above, even old exceptions could be reviewed interactively.
</hijack>

@tacaswell
Copy link
Member Author

@klauer That request should probably go to IPython

@danielballan
Copy link
Contributor

@danielballan
Copy link
Contributor

Ah, not exactly. I somewhat misinterpreted @klauer’s comment on my initial reading. Nonetheless that might be interesting.

@klauer
Copy link
Contributor

klauer commented Jul 6, 2020

Just throwing it out there 🤷‍♂️

Copy link
Member

@mrakitin mrakitin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed for the queueserver work.

@mrakitin mrakitin merged commit 79ea5b8 into NSLS-II:master Sep 26, 2020
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

Successfully merging this pull request may close these issues.

None yet

5 participants