lincc-frameworks / lincc-frameworks/hyrax
Make Stack Traces work in Trace mode
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 41
- Forks
- 7
- Avg merge
- 5d 1h
- Merged PRs (30d)
- 8
Description
Modify the trace mode initialization code to handle the case where we throw during the processing of the trace data. This should not only return to a non-shimmed state (as it does today) but should also return something useful to the user.
The basic idea is that we make a globally accessible function call that after a crash will give the notebook user the (incomplete) trace result object that would have been returned from their verb. This function might be the current `get_trace` but the initialization and destruction of the TraceResult object in normal and crash cases will have to be worked out, since that is the current global accessor, and it needs to return None when no trace is in flight. It might be cleaner to have a separate function and global for "we crashed, here is the trace" or we might be able to get by with some state information stored on the TraceResult object.
Once we have that global access, we need to note the exception from the crashing hyrax code with some instructions for accessing the data trace. We should probably use the `e.note()` api in Python and do so on the verb decorator's general crash handler in the trace subsystem.
The desired end state is that if the user issues a verb ( like `h.train(trace=3)`) and the invocation crashes, they will get both the python traceback in their notebook just as they normally would, plus an additional note that tells them what to run in their next notebook cell to retrieve and interrogate the TraceResult object that was built up during the crashing run.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the trace mode initialization and destruction paths around the global get_trace accessor, then inspect the verb decorator's general crash handler and Python's e.note() API. Reproduce a failing h.train(trace=3) invocation and make the incomplete TraceResult retrievable afterward while preserving the normal Python traceback and returning None when no trace is in flight.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100