ipython / ipython/ipynb

importing .ipynb notebooks in Sagemath 9.4

未關閉
#55 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Jupyter Notebook
星號
258
分支
71
PR 合併指標
30 天內沒有已合併 PR

描述

Following https://stackoverflow.com/questions/44116194/import-a-function-from-another-ipynb-file
Python/Sagemath9.4/Jupyter error?
Using jupyter with kernel selections:sagemath9.4, python3
I found that the import works if the file pyt.ipynb is written with the Jupyter kernel Python3 selected, but can't be read if it's written from Sagemath9.4 kernel.
Is there a more correct way or is it a bug?
File pyt.ipynb to be imported

def factorial(n):
if n == 0:
return 1
else:
return n * factorial(n-1)
File for importing

from ipynb.fs.full.pyt import *
testing = factorial(5)
testing
Here is the diff output, comparing the python3 save and the sagemath9.4 save
diff pyt.ipynb pyt-python.ipynb

< "display_name": "SageMath 9.4",
< "language": "sage",
< "name": "sagemath"

'> "display_name": "Python 3",
'> "language": "python",
'> "name": "python3"

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

Reproduce the import using pyt.ipynb saved with the Sagemath9.4 and Python3 kernels, following the shown `from ipynb.fs.full.pyt import *` example. Compare the notebook metadata and determine whether the importer should support the SageMath kernel format; completion should include a verified outcome for that case.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
jupyter-notebook, python
領域
tooling
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
需要釐清
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。