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

Change file naming rules: replace with _ #69

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/
cellvars/
depyf_output/
simple_output/
temp_output/
test_irregular/

# Translations
*.mo
Expand Down
6 changes: 3 additions & 3 deletions depyf/explain/patched_lazy_format_graph_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ def patched_lazy_format_graph_code(name, gm, maybe_id=None, **kwargs):
from depyf.explain.utils import get_current_compiled_fn_name, write_code_to_file_template
from depyf.utils import get_code_owner
func_name = get_current_compiled_fn_name()
file_name = name if name != func_name else "Captured Graph"
file_name = func_name + " " + file_name
file_name = str(name).replace(" ", "_") if name != func_name else "Captured_Graph"
file_name = func_name + "_" + file_name
import inspect
import os

Expand Down Expand Up @@ -35,7 +35,7 @@ def patched_lazy_format_graph_code(name, gm, maybe_id=None, **kwargs):
src = simple_code + commented_src
if filepath is not None:
new_filepath = write_code_to_file_template(
src, os.path.dirname(filepath) + "/" + file_name + " " + "%s" + ".py")
src, os.path.dirname(filepath) + "/" + file_name + "_" + "%s" + ".py")
scope = fn.__globals__
exec(compile(src, filename=new_filepath, mode="exec"), scope)
fn.__code__ = scope[fn.__name__].__code__
Expand Down
2 changes: 1 addition & 1 deletion depyf/explain/patched_load_by_key_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ def patched_load_by_key_path(

func_name = get_current_compiled_fn_name()
new_filepath = write_code_to_file_template(src, os.path.join(
dump_src_dir, func_name + " kernel " + "%s" + ".py"))
dump_src_dir, func_name + "_kernel_" + "%s" + ".py"))
path = new_filepath
return unpatched_load_by_key_path(key, path, linemap, attrs)
Loading