Closed SiddhantSadangi closed 2 years ago
I'm not a PyCharm user so I don't know how PyCharm interacts with Git. Are you using Git in PyCharm or on the command line?
PyCharm, but don't think that would make any difference as commands are sent to the command line anyway
It would make a difference if PyCharm appends this metadata after its interaction with Git, in which case there's nothing nbstripout
could do. I'll try to reproduce this.
Turns out only PyCharm Professional supports notebooks in edit mode, so I can't reproduce this.
PyCharm appends this metadata as soon as a notebook is opened in edit mode. To reproduce, can you open a notebook as text and manually append this to it? Or I can attach a notebook with this appended
If you could attach a test case that would be really helpful.
Attaching three versions of the same notebook. The first is the original - clean with no metadata and output, second is after running in pycharm (you can see the pycharm metadata attributes added on openings the notebook in a text editor); third is after stripping out the output using nbstripout --extra-keys "metadata.pycharm" 3_output_stripped.ipynb
.. the output has been stripped, but the pycharm tags haven't
To remove the PyCharm tag, use the nbstripout argument --extra-keys="cell.metadata.pycharm"
. (Tested on @SiddhantSadangi 's notebooks.zip.)
@kentavv - thank you. Confirming that this works
PyCharm adds the below metadata to markdown cells whenever a notebook is opened in its renderer:
This is not stripped by nbstripout even when using the
nbstripout --extra-keys "metadata.pycharm"
orgit config --system filter.nbstripout.extrakeys 'metadata.pycharm'
options