You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kernprof.py
__doc__
Updated with the latest `kernprof --help` output, and with a
narrower window so that the lines aren't too long
__doc__
RepeatedTimer.__doc__
Added linter-friendly `noqa` comment for long lines in
docstrings meant for `sphinx` consumption
RepeatedTimer.start()
main()
Wrapped certain long lines of code
main()
- Removed note on boolean options in parser description
- Removed parenthetical remark "boolean option" in option help
texts
- Removed redundant instantiation of `RepeatedTimer`
- Refactored chained if-elif-else when executing code in
non-autoprofiling mode
-V, --version show program's version number and exit
79
-
--config CONFIG Path to the TOML file, from the `tool.line_profiler.kernprof` table of which to load defaults for the options. (Default: 'pyproject.toml')
80
-
--no-config Disable the loading of configuration files other than the default one
89
+
--config CONFIG Path to the TOML file, from the `tool.line_profiler.kernprof`
90
+
table of which to load defaults for the options. (Default:
91
+
'pyproject.toml')
92
+
--no-config Disable the loading of configuration files other than the
93
+
default one
81
94
82
95
profiling options:
83
-
-l, --line-by-line Use the line-by-line profiler instead of cProfile. Implies `--builtin`. (Boolean option; default: False)
84
-
-b, --builtin Put `profile` in the builtins. Use `profile.enable()`/`.disable()` to toggle profiling, `@profile` to decorate functions, or `with profile:` to profile
85
-
a section of code. (Boolean option; default: False)
86
-
-s, --setup SETUP Path to the Python source file containing setup code to execute before the code to profile. (Default: N/A)
96
+
--line-by-line [Y[es] | N[o] | T[rue] | F[alse] | on | off | 1 | 0]
97
+
Use the line-by-line profiler instead of cProfile. Implies
98
+
`--builtin`. (Default: False; short form: -l)
99
+
--builtin [Y[es] | N[o] | T[rue] | F[alse] | on | off | 1 | 0]
100
+
Put `profile` in the builtins. Use
101
+
`profile.enable()`/`.disable()` to toggle profiling,
102
+
`@profile` to decorate functions, or `with profile:` to
103
+
profile a section of code. (Default: False; short form: -b)
104
+
-s, --setup SETUP Path to the Python source file containing setup code to
105
+
execute before the code to profile. (Default: N/A)
87
106
-p, --prof-mod PROF_MOD
88
-
List of modules, functions and/or classes to profile specified by their name or path. List is comma separated, adding the current script path profiles
89
-
the full script. Multiple copies of this flag can be supplied and the list is extended (e.g. `-p this.module,another.module -p some.func`). Only works
90
-
with line profiling (`-l`/`--line-by-line`). (Default: N/A)
91
-
--prof-imports If the script/module profiled is in `--prof-mod`, autoprofile all its imports. Only works with line profiling (`-l`/`--line-by-line`). (Boolean option;
92
-
default: False)
107
+
List of modules, functions and/or classes to profile specified
108
+
by their name or path. List is comma separated, adding the
109
+
current script path profiles the full script. Multiple copies
110
+
of this flag can be supplied and the list is extended (e.g.
111
+
`-p this.module,another.module -p some.func`). Only works with
112
+
line profiling (`-l`/`--line-by-line`). (Default: N/A)
113
+
--prof-imports [Y[es] | N[o] | T[rue] | F[alse] | on | off | 1 | 0]
114
+
If the script/module profiled is in `--prof-mod`, autoprofile
115
+
all its imports. Only works with line profiling (`-l`/`--line-
116
+
by-line`). (Default: False)
93
117
94
118
output options:
95
119
-o, --outfile OUTFILE
96
-
Save stats to OUTFILE. (Default: '<script_or_module_name>.lprof' in line-profiling mode (`-l`/`--line-by-line`); '<script_or_module_name>.prof'
120
+
Save stats to OUTFILE. (Default:
121
+
'<script_or_module_name>.lprof' in line-profiling mode
0 commit comments