Expand spectral tensor diagnostics #126
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main, master] | |
| pull_request: | |
| branches: [main, master] | |
| jobs: | |
| smoke-minimal: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Install minimal pinned dependencies | |
| run: | | |
| python -m pip install -e . --no-deps | |
| python -m pip install matplotlib==3.10.8 networkx==3.6.1 numpy==2.4.3 pytest==9.0.2 quimb==1.13.0 | |
| - name: Run headless example | |
| run: python scripts/verify.py smoke | |
| - name: Pytest | |
| run: python scripts/verify.py tests | |
| wheel-smoke: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| python-version: ["3.12", "3.13"] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "pip" | |
| - name: Install build tool | |
| run: python -m pip install build==1.4.2 | |
| - name: Build package artifacts | |
| run: python scripts/verify.py package | |
| - name: Create wheel test venv | |
| run: python -m venv .wheel-venv | |
| - name: Create sdist test venv | |
| run: python -m venv .sdist-venv | |
| - name: Install wheel (Linux) | |
| if: runner.os != 'Windows' | |
| run: .wheel-venv/bin/python -m pip install dist/*.whl | |
| - name: Install wheel (Windows) | |
| if: runner.os == 'Windows' | |
| run: .wheel-venv\Scripts\python -m pip install (Get-ChildItem dist\*.whl | Select-Object -First 1).FullName | |
| - name: Smoke import and render (Linux) | |
| if: runner.os != 'Windows' | |
| run: | | |
| .wheel-venv/bin/python -c "import matplotlib; matplotlib.use('Agg'); import tensor_network_viz; from tensor_network_viz import PlotConfig, pair_tensor, show_tensor_network; trace=[pair_tensor('A', 'x', 'r0', 'ab,b->a')]; fig, _ = show_tensor_network(trace, engine='einsum', view='2d', config=PlotConfig(tensor_label_refinement='never'), show=False); assert fig is not None" | |
| - name: Smoke import and render (Windows) | |
| if: runner.os == 'Windows' | |
| run: .wheel-venv\Scripts\python -c "import matplotlib; matplotlib.use('Agg'); import tensor_network_viz; from tensor_network_viz import PlotConfig, pair_tensor, show_tensor_network; trace=[pair_tensor('A', 'x', 'r0', 'ab,b->a')]; fig, _ = show_tensor_network(trace, engine='einsum', view='2d', config=PlotConfig(tensor_label_refinement='never'), show=False); assert fig is not None" | |
| - name: Install sdist (Linux) | |
| if: runner.os != 'Windows' | |
| run: .sdist-venv/bin/python -m pip install dist/*.tar.gz | |
| - name: Install sdist (Windows) | |
| if: runner.os == 'Windows' | |
| run: .sdist-venv\Scripts\python -m pip install (Get-ChildItem dist\*.tar.gz | Select-Object -First 1).FullName | |
| - name: Smoke sdist import and render (Linux) | |
| if: runner.os != 'Windows' | |
| run: | | |
| .sdist-venv/bin/python -c "import matplotlib; matplotlib.use('Agg'); import tensor_network_viz; from tensor_network_viz import PlotConfig, pair_tensor, show_tensor_network; trace=[pair_tensor('A', 'x', 'r0', 'ab,b->a')]; fig, _ = show_tensor_network(trace, engine='einsum', view='2d', config=PlotConfig(tensor_label_refinement='never'), show=False); assert fig is not None" | |
| - name: Smoke sdist import and render (Windows) | |
| if: runner.os == 'Windows' | |
| run: .sdist-venv\Scripts\python -c "import matplotlib; matplotlib.use('Agg'); import tensor_network_viz; from tensor_network_viz import PlotConfig, pair_tensor, show_tensor_network; trace=[pair_tensor('A', 'x', 'r0', 'ab,b->a')]; fig, _ = show_tensor_network(trace, engine='einsum', view='2d', config=PlotConfig(tensor_label_refinement='never'), show=False); assert fig is not None" | |
| lint-and-test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| python-version: ["3.11", "3.12"] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: "pip" | |
| - name: Install PyTorch (CPU) | |
| run: python -m pip install torch --index-url https://download.pytorch.org/whl/cpu | |
| - name: Install pinned dev requirements | |
| run: python -m pip install -r requirements.dev.txt | |
| - name: Quality | |
| run: python scripts/verify.py quality | |
| - name: Smoke example | |
| run: python scripts/verify.py smoke | |
| - name: Pytest | |
| run: python scripts/verify.py tests |