Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 2 additions & 25 deletions scalene/scalene_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,7 @@
from typing import (
Any,
Callable,
Dict,
Generator,
List,
Optional,
Set,
Tuple,
Union,
cast,
)

Expand Down Expand Up @@ -104,7 +98,6 @@
add_stack,
compute_frames_to_record,
enter_function_meta,
flamegraph_format,
generate_html,
get_fully_qualified_name,
on_stack,
Expand Down Expand Up @@ -152,8 +145,6 @@ class Scalene:
__last_profiled = [Filename("NADA"), LineNumber(0), ByteCodeIndex(0)]
__orig_python = sys.executable # will be rewritten later

__last_profiled_invalidated = False
__gui_dir = "scalene-gui"
__profile_filename = Filename("profile.json")
__profiler_html = Filename("profile.html")
__error_message = "Error in program being profiled"
Expand Down Expand Up @@ -239,8 +230,6 @@ class Scalene:

__last_cpu_interval = 0.0

__done = False

def __init__(
self,
arguments: argparse.Namespace,
Expand Down Expand Up @@ -370,7 +359,7 @@ def __init__(
@staticmethod
def last_profiled_tuple() -> tuple[Filename, LineNumber, ByteCodeIndex]:
"""Helper function to type last profiled information."""
return cast(Tuple[Filename, LineNumber, ByteCodeIndex], Scalene.__last_profiled)
return cast(tuple[Filename, LineNumber, ByteCodeIndex], Scalene.__last_profiled)

if sys.platform != "win32":
__orig_setitimer = signal.setitimer
Expand Down Expand Up @@ -593,7 +582,7 @@ def malloc_signal_handler(
# If so, increment.

invalidated = pywhere.get_last_profiled_invalidated()
(fname, lineno, lasti) = Scalene.last_profiled_tuple()
(fname, lineno, _lasti) = Scalene.last_profiled_tuple()
if not invalidated and this_frame and not (on_stack(this_frame, fname, lineno)):
Scalene.update_profiled()
pywhere.set_last_profiled_invalidated_false()
Expand Down Expand Up @@ -780,11 +769,6 @@ def output_profile(program_args: list[str] | None = None) -> bool:
)
return did_output

@staticmethod
def print_stacks() -> None:
for f in Scalene.__stats.stacks:
print(f, Scalene.__stats.stacks[f])

@staticmethod
def _set_in_jupyter() -> None:
"""Tell Scalene that it is running inside a Jupyter notebook."""
Expand Down Expand Up @@ -1182,7 +1166,6 @@ def start() -> None:
Scalene.__stats.start_clock()
Scalene.enable_signals()
Scalene.__start_time = time.monotonic_ns()
Scalene.__done = False

# Start neuron monitor if using Neuron accelerator
if (
Expand All @@ -1199,7 +1182,6 @@ def start() -> None:
@staticmethod
def stop() -> None:
"""Complete profiling."""
Scalene.__done = True
if Scalene.__args.memory:
from scalene import pywhere # type: ignore

Expand Down Expand Up @@ -1238,11 +1220,6 @@ def stop() -> None:
Scalene.__output.html = False
Scalene.__output.output_file = Scalene.__profile_filename

@staticmethod
def is_done() -> bool:
"""Return true if Scalene has stopped profiling."""
return Scalene.__done

@staticmethod
def _start_signal_handler(
_signum: SignumType,
Expand Down
38 changes: 0 additions & 38 deletions tests/test_coverup_103.py

This file was deleted.

23 changes: 0 additions & 23 deletions tests/test_coverup_95.py

This file was deleted.

Loading