Repository navigation
feat: add negotiated notebook media exports - #79
Merged
Merged
Conversation
There was a problem hiding this comment.
3 issues found across 46 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/reference/representations.md">
<violation number="1" location="docs/reference/representations.md:26">
P3: This row limits `media` to figures and charts, but `represent()` also exports values implementing IPython MIME methods or marimo’s `_mime_()`. Include displayable values so users can discover this supported input class.</violation>
</file>
<file name="packages/python/src/marimo_export/_execution/plan.py">
<violation number="1" location="packages/python/src/marimo_export/_execution/plan.py:739">
P2: This import shadows a notebook definition named `_marimo_export_select`, so selecting that value passes the helper function to `select_value` instead. Use an alias that cannot match `selector.root` and update the generated call accordingly.</violation>
</file>
<file name="docs/reference/python-api.md">
<violation number="1" location="docs/reference/python-api.md:27">
P2: This row tells users that the `[charts]` extra covers "chart media", but the new `media` exporter distributes over `("altair", "matplotlib", "vl-convert-python")` (see `exporters/_definitions.py`) while the `charts` extra only installs `altair` and `vl-convert-python` (and `[all]` also omits `matplotlib`). A user whose `ExportSpec` uses the `media` exporter on a matplotlib figure will follow this doc to install `[charts]`, then hit the ImportError from `_optional.py` because matplotlib is never installed by any extra. Either add `matplotlib` to the `charts`/`all` extras in `packages/python/pyproject.toml`, or narrow the wording on this row.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Bound accept lists while reading them, export JSON scalars from display methods, and call _repr_mimebundle_() without include and exclude when its signature does not take them. media() reports invalid accept values as SpecError, mounted images shrink to narrower containers, and altair.png stays available as the chart PNG shorthand over represent().
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.
Notebook exports can now select nested values through one shared selector grammar and render figures, charts, and displayable values in the media format a consumer requests.
The new
mediaexporter negotiates PDF, SVG, PNG, and other display methods while preserving deterministic rendering metadata such as image display dimensions. Browser image mounts use those dimensions to keep high-density images at their intended figure size. The selector and representation rules are shared by live resolution and prepared exports, with updated examples and reference documentation.