Skip to content
Open

Yaml #13

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
Binary file added .DS_Store
Binary file not shown.
9 changes: 5 additions & 4 deletions .github/workflows/verification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,13 @@ jobs:
run: |
sudo apt install -y python3 python3-pip
python3 -m pip install --upgrade pip
python3 -m pip install conan pydump pysigfetch
python3 -m pip install conan pydump
go install github.com/goplus/hdq/chore/pysigfetch@v0.8.1
- name: Pre setup Python and Conan
if: startsWith(matrix.os, 'macos')
run: |
python3 -m pip install --upgrade pip --break-system-packages
python3 -m pip install conan pydump pysigfetch --break-system-packages
python3 -m pip install conan pydump --break-system-packages
go install github.com/goplus/hdq/chore/pysigfetch@v0.8.1
- name: Set up Conan
run: |
conan profile detect
Expand Down Expand Up @@ -138,4 +139,4 @@ jobs:
- name: Run demotest process
env:
LLPKG_PATH: ${{ env.LLPKG_PATH }}
run: llpkgstore demotest
run: llpkgstore demotest
10 changes: 10 additions & 0 deletions math4/_demo/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module test_math3

go 1.24.5

replace github.com/goplus/llpkg/math => ../

require (
github.com/goplus/lib v0.2.0
github.com/goplus/llpkg/math v0.0.0-00010101000000-000000000000
)
2 changes: 2 additions & 0 deletions math4/_demo/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github.com/goplus/lib v0.2.0 h1:AjqkN1XK5H23wZMMlpaUYAMCDAdSBQ2NMFrLtSh7W4g=
github.com/goplus/lib v0.2.0/go.mod h1:SgJv3oPqLLHCu0gcL46ejOP3x7/2ry2Jtxu7ta32kp0=
29 changes: 29 additions & 0 deletions math4/_demo/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package main

import (
"github.com/goplus/lib/py"
"github.com/goplus/lib/py/std"
"github.com/goplus/llpkg/math"
)

func main() {
// 初始化 Python
py.Initialize()
defer py.Finalize()

// 测试 math.Sqrt
result1 := math.Sqrt(py.Float(4.0))
std.Print(py.Str("sqrt(4) = "), result1)

// 测试 math.Cos
result2 := math.Cos(py.Float(0.0))
std.Print(py.Str("cos(0) = "), result2)

// 测试 math.Pow
result3 := math.Pow(py.Float(2.0), py.Float(3.0))
std.Print(py.Str("2^3 = "), result3)

// 测试 math.Sin
result4 := math.Sin(py.Float(1.57)) // 接近 pi/2
std.Print(py.Str("sin(1.57) = "), result4)
}
5 changes: 5 additions & 0 deletions math4/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module github.com/goplus/llpkg/math

go 1.23

require github.com/goplus/lib v0.2.0
16 changes: 16 additions & 0 deletions math4/llpkg.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"type": "python",
"upstream": {
"installer": {
"name": "pip",
"config": {
"python_version": "3.12",
"index_url": "https://pypi.org/simple/"
}
},
"package": {
"name": "math",
"version": "builtin"
}
}
}
123 changes: 123 additions & 0 deletions math4/llpyg.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"name": "math",
"module": "math",
"python": true,
"symMap": {
"abs": "Abs",
"acos": "Acos",
"acosh": "Acosh",
"all": "All",
"any": "Any",
"asin": "Asin",
"asinh": "Asinh",
"atan": "Atan",
"atan2": "Atan2",
"atanh": "Atanh",
"bin": "Bin",
"bool": "Bool",
"cbrt": "Cbrt",
"ceil": "Ceil",
"chr": "Chr",
"comb": "Comb",
"copysign": "Copysign",
"cos": "Cos",
"cosh": "Cosh",
"degrees": "Degrees",
"dict": "Dict",
"dir": "Dir",
"dist": "Dist",
"enumerate": "Enumerate",
"erf": "Erf",
"erfc": "Erfc",
"exp": "Exp",
"exp2": "Exp2",
"expm1": "Expm1",
"fabs": "Fabs",
"factorial": "Factorial",
"filter": "Filter",
"float": "Float",
"floor": "Floor",
"fmod": "Fmod",
"format": "Format",
"frexp": "Frexp",
"frozenset": "FrozenSet",
"fsum": "Fsum",
"gamma": "Gamma",
"gcd": "Gcd",
"getattr": "GetAttr",
"hasattr": "HasAttr",
"hash": "Hash",
"help": "Help",
"hex": "Hex",
"id": "ID",
"input": "Input",
"int": "Int",
"isinstance": "IsInstance",
"issubclass": "IsSubclass",
"iter": "Iter",
"len": "Len",
"list": "List",
"locals": "Locals",
"log10": "Log10",
"log2": "Log2",
"map": "Map",
"max": "Max",
"min": "Min",
"modf": "Modf",
"next": "Next",
"nextafter": "Nextafter",
"oct": "Oct",
"open": "Open",
"ord": "Ord",
"perm": "Perm",
"pow": "Pow",
"print": "Print",
"prod": "Prod",
"radians": "Radians",
"range": "Range",
"remainder": "Remainder",
"repr": "Repr",
"reversed": "Reversed",
"round": "Round",
"set": "Set",
"setattr": "SetAttr",
"sin": "Sin",
"sinh": "Sinh",
"sorted": "Sorted",
"sqrt": "Sqrt",
"str": "Str",
"sum": "Sum",
"sumprod": "Sumprod",
"tan": "Tan",
"tanh": "Tanh",
"trunc": "Trunc",
"tuple": "Tuple",
"type": "Type",
"ulp": "Ulp",
"vars": "Vars",
"zip": "Zip"
},
"deps": [
"py"
],
"include": [
"math"
],
"exclude": [
"__builtins__",
"__cached__",
"__doc__",
"__file__",
"__loader__",
"__name__",
"__package__",
"__spec__"
],
"constants": {
"e": "E",
"inf": "Inf",
"nan": "NaN",
"pi": "Pi",
"tau": "Tau"
}
}
Loading