Skip to content

test(layout): add CPU/GPU tests for circle_layout with partition_by#831

Merged
lmeyerov merged 7 commits into
masterfrom
test/gib-circle-partition-coverage
Nov 14, 2025
Merged

test(layout): add CPU/GPU tests for circle_layout with partition_by#831
lmeyerov merged 7 commits into
masterfrom
test/gib-circle-partition-coverage

Conversation

@lmeyerov

@lmeyerov lmeyerov commented Nov 12, 2025

Copy link
Copy Markdown
Contributor

Summary

Adds comprehensive test coverage for both the low-level circle_layout code path and the high-level group_in_a_box_layout integration that was fixed in #830.

Changes

Low-Level Tests (Direct circle_layout)

  • test_circle_layout_with_partition_pd: Tests circle_layout with partition_by parameter on pandas (CPU)
  • test_circle_layout_with_partition_cudf: Tests circle_layout with partition_by parameter on cuDF (GPU)

High-Level Tests (Full GIB Integration)

  • test_gib_pd_with_partitions: Tests group_in_a_box_layout with multiple communities on pandas (CPU)
  • test_gib_cudf_with_partitions: Tests group_in_a_box_layout with multiple communities on cuDF (GPU)

Why These Tests Matter

The original bug in #829 (transform('size') failing on older cuDF) wasn't caught because:

  1. Existing tests only called group_in_a_box_layout() without multiple communities
  2. The specific code path at circle.py:248-254 wasn't being exercised with partition_by

These new tests provide dual coverage:

Low-Level Coverage (circle_layout)

✅ Direct testing of the fixed code path (circle.py:248-254)
✅ Validates partition_by parameter with bounding boxes
✅ Ensures groupby.size() + map() works correctly

High-Level Coverage (group_in_a_box_layout)

✅ Tests the full user workflow with community detection
✅ Exercises the complete integration from gib → partitioning → circle_layout
✅ Would have caught the original NotImplementedError in user scenarios

Test Results

$ PYTHONPATH=. pytest graphistry/tests/layout/test_gib.py -v
======================== test session starts =========================
graphistry/tests/layout/test_gib.py::Test_gib::test_circle_layout_with_partition_pd PASSED
graphistry/tests/layout/test_gib.py::Test_gib::test_circle_layout_with_partition_cudf SKIPPED (need TEST_CUDF=1)
graphistry/tests/layout/test_gib.py::Test_gib::test_gib_pd PASSED
graphistry/tests/layout/test_gib.py::Test_gib::test_gib_pd_with_partitions PASSED
graphistry/tests/layout/test_gib.py::Test_gib::test_gib_cudf SKIPPED (need TEST_CUDF=1)
graphistry/tests/layout/test_gib.py::Test_gib::test_gib_cudf_with_partitions SKIPPED (need TEST_CUDF=1)
=================== 3 passed, 3 skipped in 0.87s ====================

6 Total Tests:

  • 2 original tests (existing coverage)
  • 2 circle_layout tests (low-level/direct)
  • 2 gib integration tests (high-level/end-to-end)

All 3 pandas tests pass locally ✅
GPU tests will validate in CI 🚀

Related

🤖 Generated with Claude Code

lmeyerov and others added 2 commits November 12, 2025 09:42
- Add test_circle_layout_with_partition_pd for pandas (CPU) testing
- Add test_circle_layout_with_partition_cudf for cuDF (GPU) testing
- Tests specifically exercise the code path fixed in #830 (circle.py:248-254)
- Would have caught the original transform('size') NotImplementedError
- Validates that partition-based circle layouts generate valid x/y coordinates
- All 4 tests in test_gib.py now pass (2 existing + 2 new)

Follow-up to #829 and #830 to prevent regressions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add test_gib_pd_with_partitions for pandas (CPU) full integration
- Add test_gib_cudf_with_partitions for cuDF (GPU) full integration
- Tests exercise complete group_in_a_box_layout workflow with partitioning
- Creates graphs with multiple communities to trigger partition-based layouts
- Complements circle_layout direct tests with full end-to-end user workflow
- Ensures the fixed code path (circle.py:248-254) is tested via the high-level API

Now have comprehensive coverage:
- Low-level: circle_layout with partition_by (direct test)
- High-level: group_in_a_box_layout with communities (integration test)
- Both: CPU (pandas) and GPU (cuDF) engines

All 3 pandas tests pass locally, 3 GPU tests will validate in CI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
lmeyerov and others added 2 commits November 12, 2025 11:32
- Change from 'group: GPU Runners - Public' to 't4-runner' label
- Uses dedicated T4 runner with 16GB VRAM
- Should have better availability and faster start times

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Change to gpu_public label (Tesla T4, 16GB VRAM)
- Note: Runner restricted to master and gpu-public branches only
- Tests validated locally in GPU container (all 6 pass)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@lmeyerov lmeyerov added gpu-ci and removed gpu-ci labels Nov 12, 2025
lmeyerov and others added 2 commits November 12, 2025 13:48
- Revert from 'runs-on: gpu_public' back to 'runs-on: group: GPU Runners - Public'
- This was the working configuration before commits 555b390 and da472d9
- Last successful GPU CI run (July 17) used the runner group syntax
- Direct runner labels (t4-runner, gpu_public) not being picked up

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The runner UI explicitly states:
"Add runs-on: gpu_public to your workflow's YAML to send jobs to this runner."

Reverting from group syntax back to label syntax.

Runner details from UI:
- Name: gpu_public
- Runner group: GPU Runners - Public
- Status: Ready
- Hardware: 1x NVIDIA Tesla T4, 16GB VRAM
- Usage: 0/8 active jobs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@lmeyerov
lmeyerov force-pushed the test/gib-circle-partition-coverage branch from 6663c61 to 2dc661c Compare November 12, 2025 23:52
Added entry for comprehensive test coverage of circle_layout() and
group_in_a_box_layout() with partition support across CPU/GPU engines.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@lmeyerov
lmeyerov merged commit 18adb3b into master Nov 14, 2025
69 checks passed
@lmeyerov
lmeyerov deleted the test/gib-circle-partition-coverage branch November 14, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant