Skip to content

Conversation

@rgeorgi
Copy link
Contributor

@rgeorgi rgeorgi commented Nov 19, 2025

I also wanted the feature referenced in #175 and added:

  • --drop-output-type - when used with --keep-output, drops outputs of the specified type
  • --keep-output-type - overrides --keep-output and only keeps outputs of the specified type

Also supports a colon to specify the name field, so --drop-output-type stream:stderr will strip all outputs of type stream with name stderr.

Also added a test notebook, unit tests, and updated the readme.

Common output types are stream (for stderr/stdin, e.g. print statements) error (for exceptions in running the cell), and execute_output for evaluated expressions. I'm sure widgets and things like matplotlib have many other types, so this list is not constrained.

Copy link
Owner

@kynan kynan left a comment

Choose a reason for hiding this comment

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

Thanks, this looks sensible on the whole! A couple of suggestions, some of which are nits :)

Copy link
Contributor Author

@rgeorgi rgeorgi left a comment

Choose a reason for hiding this comment

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

Thanks for the feedback! Adding changes.

cell['outputs'] = [output for output in cell['outputs'] if get_size(output) <= max_size]
if not keep_output_this_cell or keep_output_types:
cell['outputs'] = [output for output in cell['outputs']
if get_size(output) <= max_size
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, not sure; my instinct is the main use case for keeping an output type would be to preserve graphs/images/whatever in all cases, but that's just a guess based on a teammate's use case. Think I added a line to the Readme, but will confirm.

1. Reflowing Readme to 80 cols, and adding notes on usage
2. Reworking output type filter as method
3. Cleaning up some leftover debug
Copy link
Owner

@kynan kynan left a comment

Choose a reason for hiding this comment

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

Thanks, I think this is looking good, only a few cosmetic changes remaining :)

rgeorgi and others added 6 commits December 1, 2025 12:36
Co-authored-by: Florian Rathgeber <[email protected]>
Co-authored-by: Florian Rathgeber <[email protected]>
Co-authored-by: Florian Rathgeber <[email protected]>
Co-authored-by: Florian Rathgeber <[email protected]>
Co-authored-by: Florian Rathgeber <[email protected]>
@rgeorgi
Copy link
Contributor Author

rgeorgi commented Dec 1, 2025

Believe this addresses the remaining changes

@rgeorgi rgeorgi requested a review from kynan December 1, 2025 20:41
@rgeorgi rgeorgi requested a review from kynan December 13, 2025 18:13
@kynan kynan self-assigned this Jan 4, 2026
@kynan kynan added this to the 0.8.3 milestone Jan 4, 2026
Copy link
Owner

@kynan kynan left a comment

Choose a reason for hiding this comment

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

Thanks! I think this is good to merge now. Apologies for the delay!

@kynan kynan merged commit ffb9718 into kynan:main Jan 4, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants