From f20822ce1ea4a87f47c7f47eb4d2cc82366fb745 Mon Sep 17 00:00:00 2001 From: stepanzh Date: Sun, 4 Aug 2024 17:30:31 +0300 Subject: [PATCH] =?UTF-8?q?fix(julia-version):=20=D0=BE=D0=B1=D0=BD=D0=BE?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8?= =?UTF-8?q?=D1=8F=20Julia=20=D0=B4=D0=BE=201.10?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit modified: Dockerfile Установка с juliaup. modified: book/**/*.md Обновлены версии ядра для исполнения кода. new file: book/change-kernel.py Скрипт для обновления ядер исполнения кода. new file: julia-requirements-exact-for-reference.txt new file: python-requirements-exact-for-reference.txt Снэпшоты точных версий пакетов Python и Julia для сборки книги. Closes #78 --- Dockerfile | 25 +++--- book/autodiff/compgraph.md | 6 +- book/autodiff/complexstep.md | 6 +- book/autodiff/dualnumbers.md | 7 +- book/change-kernel.py | 94 +++++++++++++++++++++ book/integration/adaptive.md | 6 +- book/integration/newton_cotes.md | 6 +- book/interpolation/cubic_spline.md | 6 +- book/interpolation/ex.md | 10 +-- book/interpolation/polynomial.md | 6 +- book/interpolation/pwlinear.md | 6 +- book/intro/cond.md | 6 +- book/intro/float.md | 6 +- book/julia/index.md | 9 +- book/nlroot/bisection_regula_falsi.md | 6 +- book/nlroot/ex.md | 6 +- book/nlroot/itp.md | 6 +- book/nlroot/newton_secant.md | 6 +- book/nlroot/ridders.md | 6 +- book/nlroot/simpleiter.md | 6 +- book/ode/adaptive_rungekutta.md | 6 +- book/ode/euler.md | 6 +- book/ode/rungekutta.md | 6 +- book/syslinear/decompose_overview.md | 6 +- book/syslinear/lu.md | 6 +- book/syslinear/plu.md | 6 +- book/sysnonlinear/newton.md | 6 +- book/sysnonlinear/quasinewton.md | 6 +- julia-requirements-exact-for-reference.txt | 10 +++ python-requirements-exact-for-reference.txt | 94 +++++++++++++++++++++ 30 files changed, 289 insertions(+), 98 deletions(-) create mode 100644 book/change-kernel.py create mode 100644 julia-requirements-exact-for-reference.txt create mode 100644 python-requirements-exact-for-reference.txt diff --git a/Dockerfile b/Dockerfile index c4cf8f4..b8b8bc8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,31 +17,30 @@ RUN < (автоматически) +# jupytext_version: 1.16.4 --> (автоматически) +# kernelspec: +# display_name: Julia 1.10.4 --> (автоматически) +# language: julia +# name: julia-1.10 --> JUPYTER_KERNELSPEC_FOR_JULIA +# --- +# +# Степан Захаров stepanzh@gmail.com +# 2024 + + +import os +import subprocess + +# Название ядра jupyter, созданного IJulia +JUPYTER_KERNELSPEC_FOR_JULIA = 'julia-1.10' +BOOK_LOCATION_INSIDE_CONTAINER = '/root/book/' + + +def show_container_warning(): + print('Обнаружен запуск из-под пользовательской машины') + print('Запустите этот скрипт из docker-контейнера') + + + + +# Проверка на то, что скрипт исполняется в контейнере + +# Пытаемся прочесть содержание /run/systemd/container +# На моём компе в контейнере прописано 'docker' +_container_file = '/run/systemd/container' +if not os.path.exists(_container_file): + show_container_warning() + exit(1) + +_container_file_content = '' +with open(_container_file) as io: + _container_file_content = io.read() + +if not _container_file_content.startswith('docker'): + show_container_warning() + exit(1) + + + + +root = BOOK_LOCATION_INSIDE_CONTAINER +files_for_update = [] + +# Фильтруем файлы с расширением .md и содержащие jupytext +# настройки для исполнения кода +for (dirpath, dirnames, filenames) in os.walk(root): + for filename in filenames: + filepath = os.path.join(dirpath, filename) + _, suffix = os.path.splitext(filepath) + + if suffix != '.md': + continue + + with open(filepath) as io: + content = io.read() + if content.startswith('---\njupytext'): + files_for_update.append(filepath) + + +print('Следующие файлы будут обновлены') +for x in files_for_update: + print('', x) + +# Здесь полагаемся на встроенную утилиту jupyter-book myst init. + +for x in files_for_update: + subprocess.run([ + 'jupyter-book', + 'myst', + 'init', + '--kernel', + JUPYTER_KERNELSPEC_FOR_JULIA, + x, + ]) diff --git a/book/integration/adaptive.md b/book/integration/adaptive.md index 2f455d9..72e2704 100644 --- a/book/integration/adaptive.md +++ b/book/integration/adaptive.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/integration/newton_cotes.md b/book/integration/newton_cotes.md index 60b259e..74222db 100644 --- a/book/integration/newton_cotes.md +++ b/book/integration/newton_cotes.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/interpolation/cubic_spline.md b/book/interpolation/cubic_spline.md index ae5bed0..74fcf18 100644 --- a/book/interpolation/cubic_spline.md +++ b/book/interpolation/cubic_spline.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/interpolation/ex.md b/book/interpolation/ex.md index 615c662..3845867 100644 --- a/book/interpolation/ex.md +++ b/book/interpolation/ex.md @@ -5,15 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 -myst: - substitutions: - url_omega22_table: "pdf" - url_feta_table: "pdf" + name: julia-1.10 --- ```{eval-rst} diff --git a/book/interpolation/polynomial.md b/book/interpolation/polynomial.md index 40b5a5f..33a3046 100644 --- a/book/interpolation/polynomial.md +++ b/book/interpolation/polynomial.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/interpolation/pwlinear.md b/book/interpolation/pwlinear.md index 4c9a38b..91be1de 100644 --- a/book/interpolation/pwlinear.md +++ b/book/interpolation/pwlinear.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/intro/cond.md b/book/intro/cond.md index 96c9a84..672dc2e 100644 --- a/book/intro/cond.md +++ b/book/intro/cond.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/intro/float.md b/book/intro/float.md index d500b12..6a3b477 100644 --- a/book/intro/float.md +++ b/book/intro/float.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/julia/index.md b/book/julia/index.md index ff5dd0a..a8eac4b 100644 --- a/book/julia/index.md +++ b/book/julia/index.md @@ -5,14 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 -myst: - substitutions: - julia_logo: "" + name: julia-1.10 --- ```{eval-rst} diff --git a/book/nlroot/bisection_regula_falsi.md b/book/nlroot/bisection_regula_falsi.md index 147e6f8..758872b 100644 --- a/book/nlroot/bisection_regula_falsi.md +++ b/book/nlroot/bisection_regula_falsi.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{code-cell} diff --git a/book/nlroot/ex.md b/book/nlroot/ex.md index 51aaeb4..0beccb2 100644 --- a/book/nlroot/ex.md +++ b/book/nlroot/ex.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/nlroot/itp.md b/book/nlroot/itp.md index d3f6db4..0db4d21 100644 --- a/book/nlroot/itp.md +++ b/book/nlroot/itp.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/nlroot/newton_secant.md b/book/nlroot/newton_secant.md index fdd58b7..9204035 100644 --- a/book/nlroot/newton_secant.md +++ b/book/nlroot/newton_secant.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/nlroot/ridders.md b/book/nlroot/ridders.md index bf44843..a363583 100644 --- a/book/nlroot/ridders.md +++ b/book/nlroot/ridders.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/nlroot/simpleiter.md b/book/nlroot/simpleiter.md index 1023d7a..2f32193 100644 --- a/book/nlroot/simpleiter.md +++ b/book/nlroot/simpleiter.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/ode/adaptive_rungekutta.md b/book/ode/adaptive_rungekutta.md index cc0bd0a..74235c4 100644 --- a/book/ode/adaptive_rungekutta.md +++ b/book/ode/adaptive_rungekutta.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/ode/euler.md b/book/ode/euler.md index 8a4b0ff..f3054a2 100644 --- a/book/ode/euler.md +++ b/book/ode/euler.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/ode/rungekutta.md b/book/ode/rungekutta.md index 940bfff..584e59b 100644 --- a/book/ode/rungekutta.md +++ b/book/ode/rungekutta.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/syslinear/decompose_overview.md b/book/syslinear/decompose_overview.md index a9a4d0b..0623535 100644 --- a/book/syslinear/decompose_overview.md +++ b/book/syslinear/decompose_overview.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/syslinear/lu.md b/book/syslinear/lu.md index a14a43e..de58712 100644 --- a/book/syslinear/lu.md +++ b/book/syslinear/lu.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/syslinear/plu.md b/book/syslinear/plu.md index f19e01e..3af2978 100644 --- a/book/syslinear/plu.md +++ b/book/syslinear/plu.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/sysnonlinear/newton.md b/book/sysnonlinear/newton.md index f147fe5..249e808 100644 --- a/book/sysnonlinear/newton.md +++ b/book/sysnonlinear/newton.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/book/sysnonlinear/quasinewton.md b/book/sysnonlinear/quasinewton.md index 4d6e775..1f560c7 100644 --- a/book/sysnonlinear/quasinewton.md +++ b/book/sysnonlinear/quasinewton.md @@ -5,11 +5,11 @@ jupytext: extension: .md format_name: myst format_version: 0.13 - jupytext_version: 1.16.0 + jupytext_version: 1.16.4 kernelspec: - display_name: Julia 1.9.4 + display_name: Julia 1.10.4 language: julia - name: julia-1.9 + name: julia-1.10 --- ```{eval-rst} diff --git a/julia-requirements-exact-for-reference.txt b/julia-requirements-exact-for-reference.txt new file mode 100644 index 0000000..20d6cd3 --- /dev/null +++ b/julia-requirements-exact-for-reference.txt @@ -0,0 +1,10 @@ +(@v1.10) pkg> st +Status `~/.julia/environments/v1.10/Project.toml` + [6e4b80f9] BenchmarkTools v1.5.0 + [f6369f11] ForwardDiff v0.10.36 + [7073ff75] IJulia v1.25.0 + [b964fa9f] LaTeXStrings v1.3.1 + [eff96d63] Measurements v2.11.0 + [91a5bcdd] Plots v1.40.5 + [08abe8d2] PrettyTables v2.3.2 + [1986cc42] Unitful v1.21.0 diff --git a/python-requirements-exact-for-reference.txt b/python-requirements-exact-for-reference.txt new file mode 100644 index 0000000..e108984 --- /dev/null +++ b/python-requirements-exact-for-reference.txt @@ -0,0 +1,94 @@ +accessible-pygments==0.0.5 +alabaster==0.7.16 +asttokens==2.4.1 +attrs==24.1.0 +Babel==2.15.0 +beautifulsoup4==4.12.3 +certifi==2024.7.4 +charset-normalizer==3.3.2 +click==8.1.7 +comm==0.2.2 +debugpy==1.8.3 +decorator==5.1.1 +docutils==0.18.1 +exceptiongroup==1.2.2 +executing==2.0.1 +fastjsonschema==2.20.0 +greenlet==3.0.3 +idna==3.7 +imagesize==1.4.1 +importlib_metadata==8.2.0 +ipykernel==6.29.5 +ipython==8.26.0 +jedi==0.19.1 +Jinja2==3.1.4 +jsonschema==4.23.0 +jsonschema-specifications==2023.12.1 +jupyter-book==0.15.1 +jupyter-cache==0.6.1 +jupyter_client==8.6.2 +jupyter_core==5.7.2 +jupytext==1.16.4 +latexcodec==3.0.0 +linkify-it-py==2.0.3 +markdown-it-py==2.2.0 +MarkupSafe==2.1.5 +matplotlib-inline==0.1.7 +mdit-py-plugins==0.3.5 +mdurl==0.1.2 +myst-nb==0.17.2 +myst-parser==0.18.1 +nbclient==0.7.4 +nbformat==5.10.4 +nest-asyncio==1.6.0 +packaging==24.1 +parso==0.8.4 +pexpect==4.9.0 +platformdirs==4.2.2 +prompt_toolkit==3.0.47 +psutil==6.0.0 +ptyprocess==0.7.0 +pure_eval==0.2.3 +pybtex==0.24.0 +pybtex-docutils==1.0.3 +pydata-sphinx-theme==0.15.4 +Pygments==2.18.0 +python-dateutil==2.9.0.post0 +PyYAML==6.0.1 +pyzmq==26.1.0 +referencing==0.35.1 +requests==2.32.3 +rpds-py==0.19.1 +six==1.16.0 +snowballstemmer==2.2.0 +soupsieve==2.5 +Sphinx==5.0.2 +sphinx-book-theme==1.0.1 +sphinx-comments==0.0.3 +sphinx-copybutton==0.5.2 +sphinx-jupyterbook-latex==0.5.2 +sphinx-multitoc-numbering==0.1.3 +sphinx-thebe==0.2.1 +sphinx-togglebutton==0.3.2 +sphinx_design==0.3.0 +sphinx_external_toc==0.3.1 +sphinxcontrib-applehelp==2.0.0 +sphinxcontrib-bibtex==2.5.0 +sphinxcontrib-devhelp==2.0.0 +sphinxcontrib-htmlhelp==2.1.0 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-mermaid==0.9.2 +sphinxcontrib-proof==1.6.0 +sphinxcontrib-qthelp==2.0.0 +sphinxcontrib-serializinghtml==2.0.0 +SQLAlchemy==2.0.31 +stack-data==0.6.3 +tabulate==0.9.0 +tomli==2.0.1 +tornado==6.4.1 +traitlets==5.14.3 +typing_extensions==4.12.2 +uc-micro-py==1.0.3 +urllib3==2.2.2 +wcwidth==0.2.13 +zipp==3.19.2