AnswerDotAI / AnswerDotAI/nbdev

Consider add option to clean `kernelspec` in notebook meta?

Aperta
#1,239 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Jupyter Notebook
Stelle
5.3k
Fork
513
Merge medio
2g 30m
PR unite (30g)
8

Descrizione

Hi all,

I am new to nbdev and thanks for creating this amazing tool!

I found the `kernelspec` in notebook meta data in preserved when running `nbdev_clean`. Please refer to https://github.com/fastai/nbdev/blob/b2f0810a4edd8ee79180b0a1c6a41e6966226ea4/nbdev/clean.py#L91

However, I found this metadata shouldn't be record by git in my case. For example, here is what I get from `git diff xxxx.ipynb`:
```
... some unrelated output...

@@ -79,9 +43,21 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3.9.5 ('base')",
+ "display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.9.13"
}
},
"nbformat": 4,
```
We should save these metadata, for example, the detailed python version.

Will you consider and option to remove it?
Thanks for your help.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Leggi nbdev/clean.py intorno alla riga 91 e verifica come nbdev_clean gestisce i metadati del notebook. Chiarisci se l'opzione debba rimuovere solo kernelspec mantenendo language_info, quindi verifica il comportamento scelto rispetto al diff Git del notebook mostrato nell'issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
jupyter-notebook, python
Ambito
tooling
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.