Skip to content

Commit ffbe794

Browse files
Merge pull request #156 from PengPengPeng717/916n1
Release-as: numpy/v0.1.6
2 parents b5a1501 + f616dca commit ffbe794

6 files changed

Lines changed: 27351 additions & 0 deletions

File tree

py/numpy/_demo/basic_test/main.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
6+
"numpy"
7+
8+
"github.com/goplus/lib/py"
9+
"github.com/goplus/lib/py/std"
10+
)
11+
12+
func main() {
13+
fmt.Println("=== NumPy Basic Test Demo ===")
14+
15+
// 测试1: 创建数组
16+
fmt.Println("\n1. 创建数组测试:")
17+
18+
// 创建一个简单的数组
19+
arr1 := py.List(1.0, 2.0, 3.0, 4.0, 5.0)
20+
arr2 := py.List(2.0, 4.0, 6.0, 8.0, 10.0)
21+
22+
// 使用numpy进行数组运算
23+
arr3 := numpy.Add(arr1, arr2)
24+
std.Print(py.Str("result:"), arr3)
25+
26+
fmt.Println("\n=== 测试完成 ===")
27+
}

py/numpy/go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module github.com/PengPengPeng717/llpkg/py/numpy
2+
3+
go 1.24.5
4+
5+
require github.com/goplus/lib v0.3.0

py/numpy/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.com/goplus/lib v0.3.0 h1:y0ZGb5Q/RikW1oMMB4Di7XIZIpuzh/7mlrR8HNbxXCA=
2+
github.com/goplus/lib v0.3.0/go.mod h1:SgJv3oPqLLHCu0gcL46ejOP3x7/2ry2Jtxu7ta32kp0=

py/numpy/llpkg.cfg

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"type": "python",
3+
"upstream": {
4+
"installer": {
5+
"name": "pip"
6+
},
7+
"package": {
8+
"name": "numpy",
9+
"version": "1.26.4"
10+
}
11+
},
12+
"llpyg": {
13+
"output_dir": "./test",
14+
"mod_name": "github.com/PengPengPeng717/llpkg/py/numpy",
15+
"mod_depth": 1
16+
}
17+
}

py/numpy/llpyg.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "numpy",
3+
"libName": "numpy",
4+
"modules": [
5+
"numpy"
6+
]
7+
}

0 commit comments

Comments
 (0)