Repository navigation
Add cometx panel-studio for local Python panel development - #30
Merged
Merged
Conversation
`cometx panel-studio [FILE]` opens a browser editor for writing and testing a Comet Python panel locally: pick a workspace, project and experiments in the sidebar, edit or browse to a panel file, press Run, and the panel runs the way it does on comet.com, against real experiments. Upload puts it on a project dashboard (replacing a same-named panel, or adding it to a "Panel Studio" section) or in the workspace's Panel library. It runs panels like Comet's Python panel server does: each panel is a Streamlit page served by a second Streamlit server, built with the engine's own code, vendored from comet-ml/code-panels at b57eab54 into cometx/panel_engine.py and cometx/panel_pip_utils.py with each change marked. The page's preamble gives comet_ml the panel context (workspace, project, experiment keys, colors), so the real comet_ml.ui and API().get_panel_* calls work, as do print and the %pip/%include magics. Like a dashboard, the first 25 experiments are selected to start. cometx.views is synced with comet_ml.views: panel option values the UI silently ignored are mapped or rejected, bar_panel gains group_by, and python_panel(code=...) and javascript_panel store code in the view. API.update_view replaces a project view in place, using comet_ml's own where the installed version has one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
| Topic | Details | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Views and dashboard API | Enhance dashboard view construction and persistence by validating UI option values, adding grouped bar charts and inline Python or JavaScript panels, preserving compatible schemas, and updating existing project views in place.Modified files (3)
Latest Contributors(2)
| |||||||||
| Documentation and release | Document the new panel-development workflow, upload behavior, view-builder capabilities, compatibility model, operational options, security considerations, and release licensing implications for vendored panel-server code.Modified files (3)
Latest Contributors(2)
| |||||||||
| Panel Studio workflow | Deliver a browser-based panel-studio command that starts coordinated Streamlit editor and panel servers, injects Comet-compatible context, supports local file browsing and persistence, runs panel code with %pip and %include handling, and uploads panels to dashboards or the workspace library.Modified files (9)
Latest Contributors(2)
|
Covers starting the studio, the sidebar and what the panel sees, editing and files, running and uploading panels, writing panels, how it matches comet.com, command-line options, troubleshooting and security notes. The README's panel-studio section links to it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two ported view tests called View.layout_scope(), which released comet_ml doesn't have yet; the tests' own assertions already check where the sections are stored, so those calls are dropped. Released comet_ml caches views/get-all and code-panel/get-all, so the upload dialog could read a dashboard or the Panel library as it was before the last upload, then create a duplicate or drop a panel just added. Uploads now use an API with caching off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…leanup - Require plotly, which Comet's default panel template imports, and streamlit>=1.41.0, the first release with every Streamlit feature the studio uses (st.dialog, st.context, tertiary buttons). - Upload is disabled while the new-dashboard name is blank. - The vendored pip argument parser listed --trusted-host as a flag without a value, so its host was taken for a package name; it now keeps the value (change marked in the vendored file). - The studio's temp folder, whose pages hold the API key, is deleted when the studio stops. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
cometx panel-studio [FILE]opens an editor in the browser for writing and testing a Comet Python panel on your own machine, then uploading it./clientlib/is added for you), API key, workspace, project (sortable by recently updated or name, with an "Open in Comet" link), and the experiments the panel sees (sortable too; the first 25 are selected, like a dashboard's first table page).How it runs panels "as on comet.com"
Comet's Python panel server turns each panel into a Streamlit page whose preamble puts the panel context into
st.session_state["comet_config_override"].comet_mlreads it from there, keyed by a page file namedpage_*. The studio does the same: a second Streamlit server serves the panel pages, built with the engine's own code, so the realcomet_ml.ui,API().get_panel_*,print, and the%pip install/%includemagics all work unchanged. Ports move up automatically if 8501/8502 are taken.Also in this PR
cometx.viewssynced withcomet_ml.views(comet-python-client#2769): option values the UI silently ignores (e.g.transform_y="log",plot_type="BOX","average","hide") are mapped to the UI's values or rejected;bar_panel(group_by=...);python_panel(code=...)andjavascript_panelstore code in the view.API.update_viewreplaces a project view in place (usescomet_ml's own when present).panel-studioand the updated views.For reviewers: vendored code and licensing
cometx/panel_engine.pyandcometx/panel_pip_utils.pyare vendored fromcomet-ml/code-panelsatb57eab54(python-panel-engine/compute_engine_server/__main__.pyandcomet-pip-utils/.../pip_utils.py), with every change markedcometx:. Their headers say "All rights reserved" / "can not be copied and/or distributed without the express permission of Comet ML Inc.", while cometx is MIT on PyPI. This needs a sign-off (or a license change on those files) before release.Also note: like Comet's panel server, each panel page holds the API key in plain text, here in a private (0700) temp directory that is deleted when the studio stops.
Testing
tests/unit/test_panel_studio.py(panel config, page writing, magic commands, dashboard layout edits, uploads, URL handling, file listing, sorting) andtests/unit/test_views.py(ported from comet_ml).AppTestagainst comet.com; uploads tested live on staging (new dashboard, replace in place, add to an existing dashboard without disturbing it, Panel library create/update).🤖 Generated with Claude Code