Report API Quickstart
📝 W&B Report API
Programmatically create, manage, and customize Reports by defining configurations, panel layouts, and runsets with the wandb-workspaces W&B library. Load and modify Reports with URLs, filter and group runs using expressions, and customize run appearances using Report templates.
wandb-workspaces is a Python library for programmatically creating and customizing W&B Workspaces and Reports.
In this tutorial you will see how to use wandb-workspaces to create and customize W&B Reports.
Create, save, and load reports
- NOTE: Reports are not saved automatically to reduce clutter. Explicitly save the report by calling
report.save()
Add content via blocks
- Use blocks to add content like text, images, code, and more
- See
wr.blocksfor all available blocks
Add charts and more via Panel Grid
PanelGridis a special type of block that holdsrunsetsandpanelsrunsetsorganize data logged to W&Bpanelsvisualize runset data. For a full set of panels, seewr.panels
Add data lineage with Artifact blocks
- There are equivalent weave panels as well
Customize run colors
- Pass in a
dict[run_name, color]
My report is too wide/narrow
- Change the report's width to the right size for you.
How do I resize panels?
- Pass a
dict[dim, int]topanel.layout dimis a dimension, which can bex,y(the coordiantes of the top left corner)w,h(the size of the panel)- You can pass any or all dimensions at once
- The space between two dots in a panel grid is 2.
What blocks are available?
- See
wr.blocksfor a list of blocks. - In an IDE or notebook, you can also do
wr.blocks.<tab>to get autocomplete.
What panels are available?
- See
wr.panelsfor a list of panels - In an IDE or notebook, you can also do
wr.panels.<tab>to get autocomplete. - Panels have a lot of settings. Inspect the panel to see what you can do!
How can I link related reports together?
- Suppose have have two reports like below:
Combine blocks into a new report
I tried mutating an object in list but it didn't work!
tl;dr: It should always work if you assign a value to the attribute instead of mutating. If you really need to mutate, do it before assignment.
This can happen in a few places that contain lists of wandb objects, e.g.:
report.blockspanel_grid.panelspanel_grid.runsets
Good: Assign b
Bad: Mutate b without reassigning
Good: Mutate b and then reassign it