dgen-py 0.1.2__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.

Potentially problematic release.


This version of dgen-py might be problematic. Click here for more details.

Files changed (44) hide show
  1. dgen_py-0.1.2/.github/workflows/ci.yml +63 -0
  2. dgen_py-0.1.2/.github/workflows/publish-pypi.yml +77 -0
  3. dgen_py-0.1.2/.gitignore +56 -0
  4. dgen_py-0.1.2/.python-version +1 -0
  5. dgen_py-0.1.2/CHANGELOG.md +33 -0
  6. dgen_py-0.1.2/Cargo.lock +1136 -0
  7. dgen_py-0.1.2/Cargo.toml +55 -0
  8. dgen_py-0.1.2/LICENSE +39 -0
  9. dgen_py-0.1.2/PKG-INFO +271 -0
  10. dgen_py-0.1.2/PROJECT_SUMMARY.md +221 -0
  11. dgen_py-0.1.2/README.md +241 -0
  12. dgen_py-0.1.2/build_pyo3.sh +32 -0
  13. dgen_py-0.1.2/docs/ARCHITECTURE.md +519 -0
  14. dgen_py-0.1.2/docs/CPU_NUMA_CONTROL.md +281 -0
  15. dgen_py-0.1.2/docs/DEVELOPMENT.md +221 -0
  16. dgen_py-0.1.2/docs/NUMA_IMPLEMENTATION.md +193 -0
  17. dgen_py-0.1.2/docs/PERFORMANCE.md +241 -0
  18. dgen_py-0.1.2/docs/PUBLISHING.md +234 -0
  19. dgen_py-0.1.2/examples/cpu_control.rs +138 -0
  20. dgen_py-0.1.2/install_wheel.sh +25 -0
  21. dgen_py-0.1.2/pyproject.toml +43 -0
  22. dgen_py-0.1.2/python/dgen_py/__init__.py +167 -0
  23. dgen_py-0.1.2/python/dgen_py/__init__.pyi +61 -0
  24. dgen_py-0.1.2/python/dgen_py/docs/PERFORMANCE.md +241 -0
  25. dgen_py-0.1.2/python/dgen_py/examples/README.md +201 -0
  26. dgen_py-0.1.2/python/dgen_py/examples/benchmark_cpu_numa.py +299 -0
  27. dgen_py-0.1.2/python/dgen_py/examples/benchmark_vs_numpy.py +146 -0
  28. dgen_py-0.1.2/python/dgen_py/examples/demo.py +107 -0
  29. dgen_py-0.1.2/python/dgen_py/examples/quick_perf_test.py +107 -0
  30. dgen_py-0.1.2/python/dgen_py/examples/zero_copy_demo.py +97 -0
  31. dgen_py-0.1.2/python/examples/README.md +201 -0
  32. dgen_py-0.1.2/python/examples/benchmark_cpu_numa.py +300 -0
  33. dgen_py-0.1.2/python/examples/benchmark_vs_numpy.py +146 -0
  34. dgen_py-0.1.2/python/examples/demo.py +107 -0
  35. dgen_py-0.1.2/python/examples/quick_perf_test.py +107 -0
  36. dgen_py-0.1.2/python/examples/zero_copy_demo.py +97 -0
  37. dgen_py-0.1.2/python/tests/test_basic.py +144 -0
  38. dgen_py-0.1.2/scripts/setup_github_repo.sh +87 -0
  39. dgen_py-0.1.2/src/constants.rs +20 -0
  40. dgen_py-0.1.2/src/generator.rs +697 -0
  41. dgen_py-0.1.2/src/lib.rs +43 -0
  42. dgen_py-0.1.2/src/numa.rs +257 -0
  43. dgen_py-0.1.2/src/python_api.rs +492 -0
  44. dgen_py-0.1.2/uv.lock +452 -0
@@ -0,0 +1,63 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master]
6
+ pull_request:
7
+ branches: [main, master]
8
+
9
+ jobs:
10
+ test:
11
+ name: Test on ${{ matrix.os }}
12
+ runs-on: ${{ matrix.os }}
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ os: [ubuntu-latest]
17
+ python-version: ['3.10', '3.11', '3.12']
18
+
19
+ steps:
20
+ - uses: actions/checkout@v4
21
+
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+
26
+ - name: Install Rust
27
+ uses: dtolnay/rust-toolchain@stable
28
+ with:
29
+ toolchain: '1.90'
30
+
31
+ - name: Build (Rust)
32
+ run: cargo build --release
33
+
34
+ - name: Test (Rust)
35
+ run: cargo test --release
36
+
37
+ - name: Build (Python)
38
+ run: |
39
+ pip install maturin
40
+ maturin build --release --out dist
41
+ pip install dist/*.whl
42
+
43
+ - name: Test (Python)
44
+ run: |
45
+ python -c "import dgen_py; data = dgen_py.generate_data(1024); print(f'✓ Generated {len(data)} bytes')"
46
+ python -c "import dgen_py; info = dgen_py.get_system_info(); print(f'✓ System info: {info}')"
47
+
48
+ lint:
49
+ name: Lint
50
+ runs-on: ubuntu-latest
51
+ steps:
52
+ - uses: actions/checkout@v4
53
+
54
+ - name: Install Rust
55
+ uses: dtolnay/rust-toolchain@stable
56
+ with:
57
+ components: rustfmt, clippy
58
+
59
+ - name: Check formatting
60
+ run: cargo fmt --all -- --check
61
+
62
+ - name: Clippy
63
+ run: cargo clippy --all-targets --all-features -- -D warnings
@@ -0,0 +1,77 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch: # Allow manual trigger
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ linux:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ matrix:
16
+ target: [x86_64]
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: '3.12'
23
+
24
+ - name: Build wheels
25
+ uses: PyO3/maturin-action@v1
26
+ with:
27
+ target: ${{ matrix.target }}
28
+ args: --release --out dist --find-interpreter
29
+ sccache: 'true'
30
+ manylinux: auto
31
+
32
+ - name: Upload wheels
33
+ uses: actions/upload-artifact@v4
34
+ with:
35
+ name: wheels-linux-${{ matrix.target }}
36
+ path: dist
37
+
38
+ sdist:
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+
43
+ - name: Build sdist
44
+ uses: PyO3/maturin-action@v1
45
+ with:
46
+ command: sdist
47
+ args: --out dist
48
+
49
+ - name: Upload sdist
50
+ uses: actions/upload-artifact@v4
51
+ with:
52
+ name: wheels-sdist
53
+ path: dist
54
+
55
+ release:
56
+ name: Release to PyPI
57
+ runs-on: ubuntu-latest
58
+ needs: [linux, sdist]
59
+ environment:
60
+ name: pypi
61
+ url: https://pypi.org/project/dgen-py
62
+ permissions:
63
+ id-token: write # Required for trusted publishing
64
+ steps:
65
+ - uses: actions/download-artifact@v4
66
+ with:
67
+ pattern: wheels-*
68
+ path: dist
69
+ merge-multiple: true
70
+
71
+ - name: Publish to PyPI
72
+ uses: PyO3/maturin-action@v1
73
+ with:
74
+ command: upload
75
+ args: --non-interactive --skip-existing dist/*
76
+ env:
77
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
@@ -0,0 +1,56 @@
1
+ # Rust
2
+ target/
3
+ Cargo.lock
4
+ **/*.rs.bk
5
+
6
+ # Python
7
+ __pycache__/
8
+ *.py[cod]
9
+ *$py.class
10
+ *.so
11
+ .Python
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+ .venv/
29
+ venv/
30
+ ENV/
31
+ env/
32
+
33
+ # PyO3/Maturin
34
+ *.whl
35
+ .maturin/
36
+
37
+ # IDE
38
+ .vscode/
39
+ .idea/
40
+ *.swp
41
+ *.swo
42
+ *~
43
+
44
+ # OS
45
+ .DS_Store
46
+ Thumbs.db
47
+
48
+ # Tests
49
+ .pytest_cache/
50
+ .coverage
51
+ htmlcov/
52
+ .tox/
53
+
54
+ # Benchmarks
55
+ criterion/
56
+ benches/results/
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,33 @@
1
+ # Changelog
2
+
3
+ All notable changes to dgen-rs/dgen-py will be documented in this file.
4
+
5
+ ## [Unreleased]
6
+
7
+ ### Added
8
+ - Initial implementation of high-performance data generation
9
+ - Xoshiro256++ RNG for fast keystream generation
10
+ - Controllable deduplication ratios (1:1 to N:1)
11
+ - Controllable compression ratios (1:1 to N:1)
12
+ - NUMA topology detection via /sys filesystem (Linux)
13
+ - NUMA-aware parallel generation (optional)
14
+ - Zero-copy Python bindings via PyO3
15
+ - Simple API: `generate_data()` / `generate_buffer()`
16
+ - Zero-copy API: `fill_buffer()` / `generate_into_buffer()`
17
+ - Streaming API: `Generator` class
18
+ - Python buffer protocol support (bytearray, memoryview, numpy)
19
+ - Comprehensive documentation and examples
20
+
21
+ ### Performance
22
+ - 5-15 GB/s per core (incompressible data)
23
+ - 1-4 GB/s per core (compressible data)
24
+ - Near-linear multi-core scaling with rayon
25
+
26
+ ### Credits
27
+ - Algorithm ported from s3dlio/src/data_gen_alt.rs
28
+ - NUMA detection from kv-cache-bench
29
+ - Built with PyO3 and Maturin
30
+
31
+ ## [0.1.0] - 2026-01-08
32
+
33
+ Initial release.