sedes 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sedes-0.1.0/.github/workflows/pypi_publish.yml +151 -0
- sedes-0.1.0/.github/workflows/rust-quality.yml +48 -0
- sedes-0.1.0/.gitignore +15 -0
- sedes-0.1.0/Cargo.lock +670 -0
- sedes-0.1.0/Cargo.toml +55 -0
- sedes-0.1.0/PKG-INFO +10 -0
- sedes-0.1.0/README.md +1 -0
- sedes-0.1.0/build.rs +117 -0
- sedes-0.1.0/main.py +6 -0
- sedes-0.1.0/plot_verification.py +260 -0
- sedes-0.1.0/pyproject.toml +22 -0
- sedes-0.1.0/python/sedes/__init__.py +41 -0
- sedes-0.1.0/python/sedes/_main.py +14 -0
- sedes-0.1.0/python/sedes/circuit.py +534 -0
- sedes-0.1.0/python/sedes/parser.py +225 -0
- sedes-0.1.0/python/sedes/plotting.py +249 -0
- sedes-0.1.0/python/sedes/results.py +294 -0
- sedes-0.1.0/src/bin/ngspice_worker.rs +14 -0
- sedes-0.1.0/src/bindings.rs +22 -0
- sedes-0.1.0/src/bindings_pregenerated.rs +139 -0
- sedes-0.1.0/src/error.rs +37 -0
- sedes-0.1.0/src/lib.rs +30 -0
- sedes-0.1.0/src/lut.rs +555 -0
- sedes-0.1.0/src/main.rs +671 -0
- sedes-0.1.0/src/pool.rs +533 -0
- sedes-0.1.0/src/protocol.rs +113 -0
- sedes-0.1.0/src/python.rs +671 -0
- sedes-0.1.0/src/worker.rs +836 -0
- sedes-0.1.0/test_expanded.py +258 -0
- sedes-0.1.0/test_python.py +224 -0
- sedes-0.1.0/uv.lock +166 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- master
|
|
8
|
+
tags:
|
|
9
|
+
- '*'
|
|
10
|
+
pull_request:
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
linux:
|
|
18
|
+
if: startsWith(github.ref, 'refs/tags/v') # Only run on tags
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: '3.13'
|
|
25
|
+
- name: Cache ngspice build
|
|
26
|
+
uses: actions/cache@v4
|
|
27
|
+
with:
|
|
28
|
+
path: ngspice-install
|
|
29
|
+
key: ngspice-46-manylinux_2_28-x86_64
|
|
30
|
+
- name: Build wheels
|
|
31
|
+
uses: PyO3/maturin-action@v1
|
|
32
|
+
with:
|
|
33
|
+
target: x86_64
|
|
34
|
+
args: --release --out dist
|
|
35
|
+
sccache: 'true'
|
|
36
|
+
manylinux: manylinux_2_28
|
|
37
|
+
before-script-linux: |
|
|
38
|
+
set -euo pipefail
|
|
39
|
+
# ngspice-devel is not in EPEL 8, so build from source.
|
|
40
|
+
# No clang needed: bindings are pre-generated and committed.
|
|
41
|
+
# The install is cached in ./ngspice-install/ (the only filesystem
|
|
42
|
+
# shared between the host runner and this Docker container).
|
|
43
|
+
INSTALL_DIR="$PWD/ngspice-install"
|
|
44
|
+
if [ ! -f "$INSTALL_DIR/lib/libngspice.so" ] && \
|
|
45
|
+
[ ! -f "$INSTALL_DIR/lib64/libngspice.so" ]; then
|
|
46
|
+
echo "Cache miss — building ngspice from source"
|
|
47
|
+
dnf install -y gcc gcc-c++ make autoconf automake libtool \
|
|
48
|
+
bison flex readline-devel libffi-devel wget tar
|
|
49
|
+
wget https://sourceforge.net/projects/ngspice/files/ng-spice-rework/46/ngspice-46.tar.gz
|
|
50
|
+
tar xf ngspice-46.tar.gz
|
|
51
|
+
cd ngspice-46
|
|
52
|
+
./configure --disable-debug --with-ngshared \
|
|
53
|
+
--prefix="$INSTALL_DIR"
|
|
54
|
+
make -j$(nproc)
|
|
55
|
+
make install
|
|
56
|
+
echo "--- installed files under $INSTALL_DIR ---"
|
|
57
|
+
find "$INSTALL_DIR" || echo "(empty)"
|
|
58
|
+
cd ..
|
|
59
|
+
else
|
|
60
|
+
echo "Cache hit — using cached ngspice"
|
|
61
|
+
fi
|
|
62
|
+
cp -rp "$INSTALL_DIR/." /usr/local/
|
|
63
|
+
ldconfig
|
|
64
|
+
NGSPICE_LIB=$(find /usr/local -name 'libngspice.so' 2>/dev/null | head -1 || true)
|
|
65
|
+
if [ -z "$NGSPICE_LIB" ]; then
|
|
66
|
+
echo "ERROR: libngspice.so not found after install:" >&2
|
|
67
|
+
find "$INSTALL_DIR" -name 'libngspice*' >&2 || true
|
|
68
|
+
exit 1
|
|
69
|
+
fi
|
|
70
|
+
NGSPICE_LIB_DIR=$(dirname "$NGSPICE_LIB")
|
|
71
|
+
echo "ngspice lib dir: $NGSPICE_LIB_DIR"
|
|
72
|
+
mkdir -p .cargo
|
|
73
|
+
printf '\n[env]\nNGSPICE_LIB_DIR = { value = "%s", force = true }\n' "$NGSPICE_LIB_DIR" \
|
|
74
|
+
>> .cargo/config.toml
|
|
75
|
+
- name: Upload wheels
|
|
76
|
+
uses: actions/upload-artifact@v4
|
|
77
|
+
with:
|
|
78
|
+
name: wheels-linux-x86_64
|
|
79
|
+
path: dist
|
|
80
|
+
|
|
81
|
+
macos:
|
|
82
|
+
if: startsWith(github.ref, 'refs/tags/v') # Only run on tags
|
|
83
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
84
|
+
strategy:
|
|
85
|
+
matrix:
|
|
86
|
+
platform:
|
|
87
|
+
- runner: macos-15-intel
|
|
88
|
+
target: x86_64
|
|
89
|
+
- runner: macos-latest
|
|
90
|
+
target: aarch64
|
|
91
|
+
steps:
|
|
92
|
+
- uses: actions/checkout@v4
|
|
93
|
+
- uses: actions/setup-python@v5
|
|
94
|
+
with:
|
|
95
|
+
python-version: '3.13'
|
|
96
|
+
- name: Install ngspice
|
|
97
|
+
run: brew install ngspice
|
|
98
|
+
- name: Set ngspice paths
|
|
99
|
+
# `brew --prefix` resolves to /usr/local on Intel and /opt/homebrew on ARM.
|
|
100
|
+
# Only NGSPICE_LIB_DIR is needed; setting NGSPICE_INCLUDE_DIR would
|
|
101
|
+
# trigger bindgen regeneration in build.rs, which is not needed here.
|
|
102
|
+
run: echo "NGSPICE_LIB_DIR=$(brew --prefix)/lib" >> $GITHUB_ENV
|
|
103
|
+
- name: Build wheels
|
|
104
|
+
uses: PyO3/maturin-action@v1
|
|
105
|
+
with:
|
|
106
|
+
target: ${{ matrix.platform.target }}
|
|
107
|
+
args: --release --out dist
|
|
108
|
+
sccache: 'true'
|
|
109
|
+
- name: Upload wheels
|
|
110
|
+
uses: actions/upload-artifact@v4
|
|
111
|
+
with:
|
|
112
|
+
name: wheels-macos-${{ matrix.platform.target }}
|
|
113
|
+
path: dist
|
|
114
|
+
|
|
115
|
+
sdist:
|
|
116
|
+
runs-on: ubuntu-latest
|
|
117
|
+
if: startsWith(github.ref, 'refs/tags/v') # Only run on tags
|
|
118
|
+
steps:
|
|
119
|
+
- uses: actions/checkout@v4
|
|
120
|
+
- name: Build sdist
|
|
121
|
+
uses: PyO3/maturin-action@v1
|
|
122
|
+
with:
|
|
123
|
+
command: sdist
|
|
124
|
+
args: --out dist
|
|
125
|
+
- name: Upload sdist
|
|
126
|
+
uses: actions/upload-artifact@v4
|
|
127
|
+
with:
|
|
128
|
+
name: wheels-sdist
|
|
129
|
+
path: dist
|
|
130
|
+
|
|
131
|
+
publish:
|
|
132
|
+
name: Publish to PyPI
|
|
133
|
+
runs-on: ubuntu-latest
|
|
134
|
+
if: startsWith(github.ref, 'refs/tags/v') # Only run on tags
|
|
135
|
+
needs: [linux, macos, sdist]
|
|
136
|
+
environment:
|
|
137
|
+
name: pypi
|
|
138
|
+
url: https://pypi.org/project/sedes/
|
|
139
|
+
permissions:
|
|
140
|
+
id-token: write
|
|
141
|
+
steps:
|
|
142
|
+
- name: Download all the dists
|
|
143
|
+
uses: actions/download-artifact@v4
|
|
144
|
+
with:
|
|
145
|
+
pattern: wheels-*
|
|
146
|
+
merge-multiple: true
|
|
147
|
+
path: dist/
|
|
148
|
+
- name: Publish distribution to PyPI
|
|
149
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
150
|
+
with:
|
|
151
|
+
packages-dir: dist/
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: Rust Quality Checks
|
|
2
|
+
permissions:
|
|
3
|
+
contents: read
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
NGSPICE_INCLUDE_DIR: /usr/include/ngspice
|
|
12
|
+
NGSPICE_LIB_DIR: /usr/lib/x86_64-linux-gnu
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
# -----------------------------------------------------------------
|
|
16
|
+
# QUALITY CHECKS (Runs on every commit/PR)
|
|
17
|
+
# -----------------------------------------------------------------
|
|
18
|
+
check-quality:
|
|
19
|
+
name: Check Quality (Fmt, Clippy, Test, Doc)
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout code
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Install Rust
|
|
26
|
+
uses: dtolnay/rust-toolchain@stable
|
|
27
|
+
with:
|
|
28
|
+
components: rustfmt, clippy
|
|
29
|
+
|
|
30
|
+
- name: Rust Cache
|
|
31
|
+
uses: Swatinem/rust-cache@v2
|
|
32
|
+
|
|
33
|
+
- name: Install ngspice
|
|
34
|
+
run: sudo apt-get update && sudo apt-get install -y libngspice0-dev
|
|
35
|
+
|
|
36
|
+
- name: Check Formatting
|
|
37
|
+
run: cargo fmt --all -- --check
|
|
38
|
+
|
|
39
|
+
- name: Run Clippy (Linting)
|
|
40
|
+
run: cargo clippy -- -D warnings
|
|
41
|
+
|
|
42
|
+
- name: Run Tests
|
|
43
|
+
run: cargo test --verbose
|
|
44
|
+
|
|
45
|
+
- name: Check Documentation
|
|
46
|
+
env:
|
|
47
|
+
RUSTDOCFLAGS: "-D warnings"
|
|
48
|
+
run: cargo doc --no-deps --document-private-items
|