diff --git a/docs/modules/array2d.md b/docs/modules/array2d.md new file mode 100644 index 00000000..eb78eaf6 --- /dev/null +++ b/docs/modules/array2d.md @@ -0,0 +1,19 @@ +--- +icon: package +label: array2d +--- + +Efficient general-purpose 2D array. + +https://github.com/pocketpy/pocketpy/blob/main/include/typings/array2d.pyi + +## Example + +```python +from array2d import array2d + +a = array2d(3, 4, default=0) + +a[1, 2] = 5 +print(a[1, 2]) # 5 +``` \ No newline at end of file diff --git a/docs/modules/line_profiler.md b/docs/modules/line_profiler.md new file mode 100644 index 00000000..302456a1 --- /dev/null +++ b/docs/modules/line_profiler.md @@ -0,0 +1,39 @@ +--- +icon: package +label: line_profiler +--- + +Line-by-line profiler for Python. + +## Example + +```python +from line_profiler import LineProfiler + +def my_func(): + a = 0 + for i in range(1000000): + a += i + return a + +lp = LineProfiler() + +lp.add_function(my_func) + +lp.runcall(my_func) + +lp.print_stats() +``` + +```txt +Total time: 0.243s +File: 84_line_profiler.py +Function: my_func at line 3 +Line # Hits Time Per Hit % Time Line Contents +============================================================== + 3 def my_func(): + 4 1 0 0 0.0 a = 0 + 5 1000001 69 0 28.4 for i in range(1000000): + 6 1000001 174 0 71.6 a += i + 7 1 0 0 0.0 return a +``` \ No newline at end of file diff --git a/docs/retype.yml b/docs/retype.yml index bb716186..53741ea6 100644 --- a/docs/retype.yml +++ b/docs/retype.yml @@ -3,7 +3,7 @@ output: .retype url: https://pocketpy.dev branding: title: pocketpy - label: v1.4.0 + label: v1.4.1 logo: "./static/logo.png" favicon: "./static/logo.png" meta: