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

Suggestion: append info about code block number in filename #716

Open
aroberge opened this issue Jul 11, 2021 · 0 comments
Open

Suggestion: append info about code block number in filename #716

aroberge opened this issue Jul 11, 2021 · 0 comments

Comments

@aroberge
Copy link

When using IPython, the "filename" contains the number information of the code block that contains it; this is something of the form <ipython-input-N-...> where N is the code block number.
image

When actual temporary files are used in the ipykernel, the names created on

def get_file_name(code):
lose that information.
My suggestion would be to append _number to the filename where number is the code block number. So, instead of path/to/filename.py one would have path/to/filename_number.py. This would enable a human reader to identify which code block is involved in the traceback.

Additionally, while it is currently possible to programmatically obtain the information and having a "filename" much more understable, as demonstrated in the image below, there can be some ambiguity if the exact same content appears in two code blocks, one of which appearing in a traceback (as shown in the second traceback in the image below).

Adding the _number would remove this ambiguity.
image

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