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

Allow setting cell name #652

Merged
merged 1 commit into from
Apr 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ipykernel/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ def get_tmp_hash_seed():
return hash_seed

def get_file_name(code):
name = murmur2_x86(code, get_tmp_hash_seed())
return get_tmp_directory() + '/' + str(name) + '.py'
cell_name = os.environ.get("IPYKERNEL_CELL_NAME")
if cell_name is None:
name = murmur2_x86(code, get_tmp_hash_seed())
cell_name = get_tmp_directory() + '/' + str(name) + '.py'
return cell_name

class XCachingCompiler(CachingCompiler):

Expand Down