Skip to content

Commit 74a33dc

Browse files
jeremymanningclaude
andcommitted
Add %%clusterfy IPython magic command with interactive widget interface
This major enhancement provides a powerful configuration management interface for Jupyter notebooks: ## New Features - **%%clusterfy Magic Command**: Creates interactive widget for cluster configuration - **Configuration Widget**: Full-featured GUI with dropdowns, buttons, and forms - **Default Configurations**: Built-in templates for major cloud providers - **Save/Load Functionality**: Import/export configurations as YAML or JSON - **Auto-Registration**: Magic command loads automatically when importing clustrix ## Widget Capabilities - Define and name cluster configurations with intuitive interface - Switch between configurations with dropdown selector - Apply configurations to current session with one click - Comprehensive form fields for all cluster types (local, SSH, SLURM, Kubernetes) - Smart field visibility based on cluster type selection - Status messages and error handling ## Configuration Management - Create, edit, and delete configurations - Save configurations to files for sharing and version control - Load configurations from existing files - Built-in validation and error checking ## Default Templates Include - Local development environment - AWS GPU instances (small/large) - GCP CPU instances - Azure GPU instances - SLURM HPC clusters - Kubernetes clusters ## Technical Implementation - Graceful fallback when IPython/ipywidgets not available - Comprehensive test suite (19 tests, all passing) - Clean separation of UI and logic components - Type-safe configuration handling ## Usage ```python import clustrix # Auto-loads magic command ``` ``` %%clusterfy # Interactive widget appears ``` 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 639ff99 commit 74a33dc

File tree

5 files changed

+1187
-3
lines changed

5 files changed

+1187
-3
lines changed

clustrix/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,16 @@
3535
"CostEstimate",
3636
"CostReport",
3737
]
38+
39+
# Auto-register IPython magic command if in notebook environment
40+
try:
41+
from IPython import get_ipython
42+
43+
ipython = get_ipython()
44+
if ipython is not None:
45+
from .notebook_magic import load_ipython_extension
46+
47+
load_ipython_extension(ipython)
48+
except (ImportError, AttributeError):
49+
# Not in IPython/Jupyter environment
50+
pass

0 commit comments

Comments
 (0)