Skip to content

Update panel/dashboard README and examples; view safeguards in API - #32

Merged
dsblank merged 2 commits into
mainfrom
dsb/panel-docs
Oct 29, 2026
Merged

dsblank merged 2 commits into
mainfrom
dsb/panel-docs

Conversation

@dsblank

@dsblank dsblank commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Why

README-panel-and-dashboard-enhancements.md and examples/ predated what we learned while building and live-testing the panel tools:

  • create_dashboard(panels=[...]) doesn't place panels. It stores the library panels' association, but the dashboard opens empty: placing a library panel needs a panel instance, which only the Comet UI creates. The README's Typical Workflow relied on it.
  • create_view doesn't make duplicates on comet.com; it refuses the name. The README said it adds a second view, and recommended the private api._client.upsert_view.
  • Several examples were broken or stale: 03's --all always fails after the first run (experiment view names are unique across projects), 05 used _client.upsert_view, 06 missed inline Python and JavaScript panels, and the log-scale charts in 02/03 drew linear axes because global_config overrode them.

What

README (README-panel-and-dashboard-enhancements.md):

  • A "to do this / use" table at the top, including the panel CLI tools.
  • create_dashboard / update_dashboard: a note that associating panels doesn't lay them out; the way to place Python code is python_panel(code=...) in a view.
  • Library panels: they can be uploaded but not placed with an API key; documented get_panels, get_panel, get_panel_code, download_panel_zip.
  • Option values table (transform_y, outliers, aggregations, bar plot_type, group_by_aggregation); merged the duplicate bar_panel rows; fuller global_config / locked note.
  • Gotchas: update_view for in-place updates, experiment view name uniqueness, the builder/scope check, and API(cache=False) for read-modify-write code.
  • A rewritten Typical Workflow (a built-in chart and a Python panel on one dashboard, updated in place); the examples table now lists 07.

Examples: the fixed versions from comet-python-client's examples/panels_and_views, ported to cometx.views and cometx's API, plus 07_code_panels.py. examples/README.md updated to match.

cometx.API, the same on any comet_ml version:

  • create_view raises a ValueError for a name already in use, pointing to update_view.
  • create_view / update_view and the new create_experiment_view / update_experiment_view reject a layout built for the other scope, which Comet would save but show with no panels.
  • update_experiment_view replaces an experiment view in place (released comet_ml 3.58.8 has no APIExperiment.update_view).

Testing

  • 498 unit tests pass with both released comet_ml 3.58.8 and the dev branch; new tests/unit/test_api_views.py.
  • Every example run live on comet.com with released comet_ml 3.58.8, including reruns (update in place) and 03 with a name used in another project (the new error); 02, 03 and 07 spot-checked on the dev branch.
  • The README's Typical Workflow snippet run as written on 3.58.8: one dashboard, panel code updated in place.

🤖 Generated with Claude Code

README-panel-and-dashboard-enhancements.md:
- create_dashboard(panels=[...]) associates library panels but doesn't
  put them on the dashboard (it opens empty); say so, and show
  python_panel(code=...) in a view as the way to place Python code.
- Replace the create_view gotcha (comet.com refuses duplicate names) and
  the private _client.upsert_view advice with update_view.
- Document option values, global_config overrides, experiment view name
  uniqueness, the library getters, and API(cache=False) for
  read-modify-write code; merge the duplicate bar_panel rows.
- Rewrite the Typical Workflow, which relied on create_dashboard placing
  panels.

examples/: the fixed versions from comet-python-client's
examples/panels_and_views, using cometx.views and cometx's API: 03 drops
--all and updates in place, 04 is safe to rerun, 05 uses update_view, 06
harvests inline Python and JavaScript panels, the log-scale charts are
locked, and 07_code_panels.py is new.

cometx.API, the same on any comet_ml version:
- create_view raises ValueError for a name already in use.
- create_view/update_view and the new create_experiment_view /
  update_experiment_view reject a layout built for the other scope, which
  would save but show no panels.
- update_experiment_view replaces an experiment view in place, using
  comet_ml's own where available.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@baz-reviewer

baz-reviewer Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review this PR on Baz

Baz Summary

Harden cometx.API view creation and update flows by enforcing project/experiment layout scopes, translating duplicate-name errors, and supporting in-place experiment updates across comet_ml versions. Refresh the panel/dashboard README and examples to document correct dashboard composition, code-panel usage, rerunnable updates, library-panel limitations, and corrected chart configurations.

graph LR
main_examples_02_build_project_dashboard_py_("main (examples/02_build_project_dashboard.py)"):::modified
API_create_view_("API.create_view"):::added
API_update_view_("API.update_view"):::modified
main_examples_03_build_experiment_view_py_("main (examples/03_build_experiment_view.py)"):::modified
API_create_experiment_view_("API.create_experiment_view"):::added
API_update_experiment_view_("API.update_experiment_view"):::added
main_examples_06_harvest_panels_py_("main (examples/06_harvest_panels.py)"):::modified
main_examples_07_code_panels_py_("main (examples/07_code_panels.py)"):::added
main_examples_02_build_project_dashboard_py_ -- "Creates dashboard layout, panels, filters, and experiment table." --> API_create_view_
main_examples_02_build_project_dashboard_py_ -- "Replaces matching dashboard using template_id, preventing duplicate views." --> API_update_view_
main_examples_03_build_experiment_view_py_ -- "Creates shared experiment layout with accuracy and locked loss panels." --> API_create_experiment_view_
main_examples_03_build_experiment_view_py_ -- "Updates matching experiment view while preserving its template_id." --> API_update_experiment_view_
main_examples_06_harvest_panels_py_ -- "Creates gallery containing harvested custom, Python, and JavaScript panels." --> API_create_view_
main_examples_06_harvest_panels_py_ -- "Replaces existing gallery using template_id and rebuilt panel definitions." --> API_update_view_
main_examples_07_code_panels_py_ -- "Sends Python and optional JavaScript panel code in new dashboard." --> API_create_view_
main_examples_07_code_panels_py_ -- "Replaces matching code-panel dashboard while retaining its template_id." --> API_update_view_
classDef added stroke:#15AA7A
classDef removed stroke:#CD5270
classDef modified stroke:#EDAC4C
linkStyle default stroke:#CBD5E1,font-size:13px
Loading

Topics

TopicDetails
View API safeguards Harden project and experiment view lifecycle operations by validating layout scope, providing actionable duplicate-name errors, and adding compatible in-place experiment updates through update_experiment_view.
Modified files (2)
  • cometx/api.py
  • tests/unit/test_api_views.py
Latest Contributors(2)
UserCommitDate
doug@comet.comUpdate panel/dashboard...October 28, 2026
doug.blank@gmail.comAdd cometx panel-studi...October 28, 2026
Dashboard examples Modernize dashboard and panel workflows by documenting layout and library-panel limitations, adding code-panel examples, making scripts rerunnable with updates, and correcting stale or broken example behavior.
Modified files (10)
  • README-panel-and-dashboard-enhancements.md
  • examples/00_seed_demo_project.py
  • examples/01_inspect_views.py
  • examples/02_build_project_dashboard.py
  • examples/03_build_experiment_view.py
  • examples/04_migrate_views.py
  • examples/05_standardize_workspace.py
  • examples/06_harvest_panels.py
  • examples/07_code_panels.py
  • examples/README.md
Latest Contributors(2)
UserCommitDate
doug@comet.comUpdate panel/dashboard...October 28, 2026
doug.blank@gmail.comAdd cometx panel-studi...October 28, 2026


Merger  Activate to get a short verdict whether this PR is good to go or not

Skills  Activate Skill Maintainer to keep your skills up to date

Planner  This PR would have been improved with Baz Planner - Try it now

Comment thread examples/04_migrate_views.py Resolved
When an experiment view's name and its "NAME (SOURCE-PROJECT)" rename are
both used in other projects, the view is reported as skipped and the
migration continues with the remaining views.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dsblank
dsblank merged commit 2be3a4d into main Oct 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant