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

BUG: Fix keep-output command line argument in profiling script #1315

Merged
merged 1 commit into from
Jan 28, 2025
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
10 changes: 5 additions & 5 deletions src/porepy/applications/profiling/run_profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def run_model_with_tracer(args, model) -> None:
refinement.
- min_duration (int): Minimum duration in microseconds for a function to be
recorded by VizTracer.
- keep_output (bool): Whether to keep the output file after viewing it.
- clear_output (bool): Whether to clear the output file after viewing it.
model: The model to be run and profiled.

Raises:
Expand Down Expand Up @@ -249,7 +249,7 @@ def run_model_with_tracer(args, model) -> None:
results_path = pathlib.Path(__file__).parent / save_file
tracer.save(str(results_path))
subprocess.run(["vizviewer", "--port", "9002", results_path])
if not args.keep_output:
if args.clear_output:
results_path.unlink()


Expand Down Expand Up @@ -288,10 +288,10 @@ def run_model_with_tracer(args, model) -> None:
+ " named after the chosen physics, geometry, and grid refinement.",
)
parser.add_argument(
"--keep_output",
"--clear_output",
action="store_true",
default=True,
help="Keep viztracer output after running.",
help="Clear viztracer output after running. By default, the log files are"
+ " kept.",
)
parser.add_argument(
"--min_duration",
Expand Down
Loading