Description
I like to use NBExtensions Execute Time extension.
When using jupytext, a cell will be converted to .py
as:
# + {"ExecuteTime": {"start_time": "2018-10-17T10:31:56.157308Z", "end_time": "2018-10-17T10:31:56.160823Z"}}
print("I'm a cell!")
It can be seen that it has a ExecuteTime
metadata.
Would it be possible for the jupytext
user to specify which metadata to keep track of and which to ignore?
In my case I don't need this info in the .py
and, in fact, I don't want it because it adds noise to git diff
...
But maybe other users would like to keep it in the scripts.
Please let me know your thoughts.
@mwouts comment from the discussion started on #101 :
As for your comment on metadata, I like very much the idea of filtering cell metadata. As a start we could skip the 'ExecuteTime' cell metadata for everyone (there are already a few cell metadata that jupytext does not include, cf. https://github.com/mwouts/jupytext/blob/master/jupytext/cell_metadata.py#L32). Unless you think it is important that for every notebook, one can tell which cell metadata to include/exclude? Please let me know your preference.
Regarding your comment @mwouts , I don't see a need to specify which metadata to ignore on a per notebook basis.
- (most effort aproach) Ideally, jupytext would have some sort of config option (maybe on the jupyter config file that it already uses currently?). And the user could specify there which metadatas to exclude besides the default ones on https://github.com/mwouts/jupytext/blob/master/jupytext/cell_metadata.py#L32
- (less effort aproach) just add the ExecuteTime to the list on https://github.com/mwouts/jupytext/blob/master/jupytext/cell_metadata.py#L32. Personally I don't see any use for this metadata on the scripts. But maybe other users will?