mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 03:20:18 +00:00
update docs
This commit is contained in:
parent
d166766ebf
commit
6eb2fa3ba1
19
docs/modules/array2d.md
Normal file
19
docs/modules/array2d.md
Normal file
@ -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
|
||||||
|
```
|
39
docs/modules/line_profiler.md
Normal file
39
docs/modules/line_profiler.md
Normal file
@ -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
|
||||||
|
```
|
@ -3,7 +3,7 @@ output: .retype
|
|||||||
url: https://pocketpy.dev
|
url: https://pocketpy.dev
|
||||||
branding:
|
branding:
|
||||||
title: pocketpy
|
title: pocketpy
|
||||||
label: v1.4.0
|
label: v1.4.1
|
||||||
logo: "./static/logo.png"
|
logo: "./static/logo.png"
|
||||||
favicon: "./static/logo.png"
|
favicon: "./static/logo.png"
|
||||||
meta:
|
meta:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user