Appearance
Science Workspaces
Science Workspaces provide a persistent notebook-style environment for organizing GhostScience computations. Each workspace contains ordered cells, supports branching for experimentation, and can optionally link to a Federated Clean Room for multi-org computation.
Creating a Workspace
Create a workspace via the API or SDK:
python
from ghostscience import GhostScienceClient
client = GhostScienceClient(api_key="gst_...")
ws = client.create_workspace(name="Drug interaction PK/PD model")Each workspace starts with a main branch and no cells.
Cells
Workspaces contain ordered cells of different types:
| Cell Type | Description |
|---|---|
computation | Python code executed in the PhD sandbox |
markdown | Documentation and notes (not executed) |
Adding Cells
python
client.upsert_cell(
workspace_id=ws["id"],
cell_id="cell-1",
cell_type="computation",
content="import sympy as sp\nx = sp.Symbol('x')\nsp.integrate(x**2, x)",
)If cell_id is omitted, one is generated automatically. Upserting an existing cell ID updates the cell in place.
Running Cells
python
result = client.run_cell(workspace_id=ws["id"], cell_id="cell-1")
print(result["output"]["stdout"])Computation cells execute in the PhD sandbox. Output includes stdout, stderr, exit_code, execution_time_ms, and backend. Markdown cells are skipped.
Cell Dependencies
Cells track dependencies via depends_on (a list of cell IDs). When an upstream cell changes, downstream cells are marked is_stale: true so you know they need re-execution.
Branching
Create branches to explore alternative approaches without affecting the main workspace:
python
client.create_branch(
workspace_id=ws["id"],
name="experiment-adam-optimizer",
parent_branch="main",
)
branches = client.list_branches(workspace_id=ws["id"])Branches share the same cells table but provide a named reference point for experimentation.
Clean Room Mode
A workspace can be linked to a Federated Clean Room for multi-org computation:
python
ws = client.create_workspace(
name="M&A Revenue Overlap",
clean_room_mode=True,
clean_room_id="cr-abc123",
participating_org_ids=["org-1", "org-2"],
)When clean_room_mode is enabled and more than one organization participates, the workspace operates under clean room governance: attestation, escrow, and dual-approval release apply to all computation cells.
Access Control
- Owner -- the user who created the workspace has full access
- Organization -- other users in the same org can view and edit
- Cross-org -- clean room workspaces are visible to all participating orgs
Related
- GhostScience -- PhD computing engine overview
- Clean Room -- federated multi-org computation
- Workspace API Reference -- REST endpoint documentation
- SDK Reference -- Python client library
- Examples -- script 22 covers the workspace lifecycle