Skip to content

⚠️ DO NOT MERGE ⚠️ — 🤖 Store execution outputs in Outputs #1903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

agoose77
Copy link
Contributor

@agoose77 agoose77 commented Mar 7, 2025

This PR changes our internal representation of cell outputs so that they are children of the Outputs node.

It accompanies #1900, and closes #1674

Notable Changes

  • Address individual output children with labels outputs-${N}
  • Add outputs node with identifier ${block.identifier}-outputs
  • New Outputs parent node

Tasks

  • Check that .docx exports still export matplotlib figures
  • Check that outputs can still be embedded
  • Check that individual output nodes can be embedded
  • Check that individual outputs are still minified
  • Check that JATS exports still export matplotlib figures

Copy link

changeset-bot bot commented Mar 7, 2025

🦋 Changeset detected

Latest commit: 56d0d49

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
mystmd Minor
myst-directives Patch
myst-transforms Patch
myst-spec-ext Patch
myst-execute Patch
myst-cli Minor
myst-common Patch
myst-config Patch
myst-frontmatter Patch
myst-parser Patch
myst-roles Patch
myst-to-html Patch
myst-migrate Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@agoose77 agoose77 force-pushed the agoose77/feat-future-ast-outputs branch 3 times, most recently from cec055e to 6870f57 Compare March 7, 2025 11:05
Copy link
Member

@rowanc1 rowanc1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments as I am looking now.

@rowanc1
Copy link
Member

rowanc1 commented Mar 7, 2025

Thoughts on a testing plan for this:

  • thebe can attach to the right place, there are likely going to be changes in the theme due to this
  • contents are still minified and downloaded correctly (e.g. images are a network request, etc.)
  • docx, typst, latex, JATS still export matplotlib images and latex
  • mystmd docs work for the embed and interactive components
  • bokeh example, holoviews, plotly, sympy
  • placeholders work

const outputsNode = select('outputs', block) as GenericNode | undefined;
if (outputsNode !== undefined && !outputsNode.identifier) {
// Label outputs node
outputsNode.identifier = `${block.identifier}-output`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that these ID changes may need to be taken into account in the upgrade/downgrade script for thebe to continue working.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep an eye on that

@@ -270,12 +273,14 @@ describe('propagateBlockDataToCode', () => {
result = mdast.children[0].children[0].visibility;
break;
case 'output':
if (!has_output && target == 'output') {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

target is known to be output here.

@agoose77 agoose77 force-pushed the agoose77/feat-future-ast-outputs branch from 2060521 to 5857844 Compare April 1, 2025 10:20
agoose77 added 3 commits April 1, 2025 11:27
We don't need to delete nodes without children: they
will simply vanish when lifted
@agoose77 agoose77 marked this pull request as ready for review April 2, 2025 10:36
@agoose77 agoose77 changed the title 🤖 Store execution outputs in Outputs [[⚠️ Do Not Merge ⚠️]] 🤖 Store execution outputs in Outputs Apr 2, 2025
@agoose77 agoose77 force-pushed the agoose77/feat-future-ast-outputs branch from 826b957 to 455e0d8 Compare April 2, 2025 12:49
@agoose77 agoose77 changed the title [[⚠️ Do Not Merge ⚠️]] 🤖 Store execution outputs in Outputs ⚠️ DO NOT MERGE ⚠️ 🤖 Store execution outputs in Outputs Apr 3, 2025
@agoose77 agoose77 changed the title ⚠️ DO NOT MERGE ⚠️ 🤖 Store execution outputs in Outputs ⚠️ DO NOT MERGE ⚠️ — 🤖 Store execution outputs in Outputs Apr 10, 2025
@agoose77 agoose77 added the blocked Waiting for another task to be compled label May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Waiting for another task to be compled
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for representing per-output sub-ASTs in MyST AST
2 participants