From e248df2a02ca1e01203c52d268af914cfdd7ad96 Mon Sep 17 00:00:00 2001 From: KangWon LEE Date: Thu, 5 Jun 2025 10:25:22 +0900 Subject: [PATCH 01/13] ci : trigger testing ipynb files with `fork` --- .github/workflows/conda_env_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/conda_env_test.yml b/.github/workflows/conda_env_test.yml index c3a4e1c..e4d3188 100644 --- a/.github/workflows/conda_env_test.yml +++ b/.github/workflows/conda_env_test.yml @@ -3,6 +3,7 @@ name: CI on: push: pull_request: + fork: workflow_dispatch: jobs: From 87ce4e9a9627060811131ba820b7d64ce932b197 Mon Sep 17 00:00:00 2001 From: KangWon LEE Date: Thu, 5 Jun 2025 10:34:28 +0900 Subject: [PATCH 02/13] ci : try `uv` with `pip` style dependency spec --- .github/workflows/check_links.yml | 16 +++++---- .github/workflows/conda_env_test.yml | 52 ++++++++++++++++++---------- 2 files changed, 44 insertions(+), 24 deletions(-) diff --git a/.github/workflows/check_links.yml b/.github/workflows/check_links.yml index d89bef7..470be91 100644 --- a/.github/workflows/check_links.yml +++ b/.github/workflows/check_links.yml @@ -1,6 +1,6 @@ name: Check Links -on: +on: schedule: - cron: '45 01 30 * *' pull_request: @@ -18,12 +18,16 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: '3.11' + + - name: Set up uv + uses: astral-sh/setup-uv@v5 + + - name: Create virtual environment + run: uv venv - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install pytest pytest-xdist requests jupyter lxml numpy matplotlib scipy sympy + run: uv pip install pytest pytest-xdist requests jupyter lxml numpy matplotlib scipy sympy - name: Check links - run: python -m pytest -n auto ./tests/test_check_links_in_ipynb.py ./utils/tests/ + run: uv run pytest -n auto ./tests/test_check_links_in_ipynb.py ./utils/tests/ diff --git a/.github/workflows/conda_env_test.yml b/.github/workflows/conda_env_test.yml index e4d3188..c48f1c9 100644 --- a/.github/workflows/conda_env_test.yml +++ b/.github/workflows/conda_env_test.yml @@ -1,11 +1,19 @@ name: CI -on: +on: + schedule: + - cron: '45 01 30 * *' + push: + pull_request: + branches: [main] + fork: + workflow_dispatch: + jobs: badges: name: Add Google Colab Badges @@ -20,45 +28,53 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.x' + python-version: '3.11' + + - name: Set up uv + uses: astral-sh/setup-uv@v5 + + - name: Create virtual environment + run: uv venv - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install bs4 jupyter lxml + run: uv pip install beautifulsoup4 jupyter lxml - name: Add/Update badges - run: python ./utils/add_colab_main_buttons.py + run: uv run python ./utils/add_colab_main_buttons.py - name: Commit & push uses: stefanzweifel/git-auto-commit-action@v5 with: - commit_message: "Add Google Colab badges" + commit_message: "Clean ipynb ${{ github.sha }}" test_ipynb: needs: badges - name: Test ipynb with Anaconda ${{ matrix.anaconda }} + name: Test ipynb on Python ${{ matrix.python-version }} runs-on: ubuntu-latest strategy: matrix: - anaconda: ["2021.11", "nightly"] + python-version: ["3.10", "3.11"] fail-fast: false timeout-minutes: 30 steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up Miniconda - uses: conda-incubator/setup-miniconda@v3 + - name: Set up Python + uses: actions/setup-python@v5 with: - auto-update-conda: true - miniconda-version: "latest" - environment-file: ./tests/environment.${{ matrix.anaconda }}.yml - activate-environment: test-environment + python-version: ${{ matrix.python-version }} + + - name: Set up uv + uses: astral-sh/setup-uv@v5 + + - name: Create virtual environment + run: uv venv + + - name: Install dependencies + run: uv pip install pytest pytest-xdist jupyter nbconvert numpy matplotlib scipy sympy - name: Run tests - shell: bash -l {0} env: TEST_IPYNB_IGNORE_FOLDER: tutorial - run: | - pytest --numprocesses=auto -k 'not (links or update_nmisp_py)' tests/ \ No newline at end of file + run: uv run pytest --numprocesses=auto -k 'not (links or update_nmisp_py)' tests/ From cf1e07f9fedecb85051c63babff77ce6bd3a21c8 Mon Sep 17 00:00:00 2001 From: KangWon LEE Date: Thu, 5 Jun 2025 10:34:54 +0900 Subject: [PATCH 03/13] chore : trailing whitespace --- .../24.working_with_bits_operators_results.md | 2 +- tests/check_links_in_ipynb.py | 2 +- tests/get_cpp_from_ipynb.py | 4 ++-- tests/test_check_links_in_ipynb.py | 8 ++++---- tests/test_gcpp_2nd_line_filename.py | 16 +++++++-------- tests/test_get_build_command_in_last_line.py | 20 +++++++++---------- tutorial/build_util/build_util.py | 2 +- tutorial/tests/check_links_in_ipynb.py | 2 +- tutorial/tests/environment.3.5.yml | 2 +- tutorial/tests/environment.3.6.yml | 2 +- tutorial/tests/get_cpp_from_ipynb.py | 4 ++-- tutorial/tests/test_check_links_in_ipynb.py | 8 ++++---- tutorial/tests/test_gcpp_2nd_line_filename.py | 16 +++++++-------- .../test_get_build_command_in_last_line.py | 20 +++++++++---------- utils/find_in_notebook_files.py | 4 ++-- utils/get_cpp_from_ipynb.py | 2 +- utils/recursively_convert_units.py | 4 ++-- utils/symbol_converter.py | 2 +- utils/tests/test_end_with_two_returns.py | 6 +++--- utils/tests/test_separate_print.py | 2 +- 20 files changed, 64 insertions(+), 64 deletions(-) diff --git a/50.under-the-hood/24.working_with_bits_operators_results.md b/50.under-the-hood/24.working_with_bits_operators_results.md index f1dda90..4598e6e 100644 --- a/50.under-the-hood/24.working_with_bits_operators_results.md +++ b/50.under-the-hood/24.working_with_bits_operators_results.md @@ -1,5 +1,5 @@ * Let's take a look at the assembly instructions. -``` +``` 24:bitwise_16bit_color.cpp **** uint32_t hex = 0; 565 .loc 6 24 0 566 00cf C745C400 movl $0, -60(%rbp) diff --git a/tests/check_links_in_ipynb.py b/tests/check_links_in_ipynb.py index 771c80c..f0535f2 100644 --- a/tests/check_links_in_ipynb.py +++ b/tests/check_links_in_ipynb.py @@ -72,5 +72,5 @@ def check_links_in_ipynb_cells_list(cells_list): # check simple urls check_link_in_cell(cell, rs) - # check urls linked to + # check urls linked to check_link_in_cell(cell, ri) diff --git a/tests/get_cpp_from_ipynb.py b/tests/get_cpp_from_ipynb.py index 2e601d5..27faf13 100644 --- a/tests/get_cpp_from_ipynb.py +++ b/tests/get_cpp_from_ipynb.py @@ -28,7 +28,7 @@ def is_markdown_cpp_src(ipynb_cell): src = ipynb_cell['source'].strip() # Multiline code block within ```'s - if (src.startswith('```') + if (src.startswith('```') and src.endswith('```')): # check C++ right after ``` @@ -100,7 +100,7 @@ def get_build_command_in_last_line(cpp_txt): if 4 < len(line.lower().split()): # Check words if ( - ('build' == line.lower().split()[1]) + ('build' == line.lower().split()[1]) and ('command' == line.lower().split()[2]) and (':' == line.lower().split()[3]) ): diff --git a/tests/test_check_links_in_ipynb.py b/tests/test_check_links_in_ipynb.py index af9bb06..c5bd91c 100644 --- a/tests/test_check_links_in_ipynb.py +++ b/tests/test_check_links_in_ipynb.py @@ -41,7 +41,7 @@ def test_check_links_in_ipynb_cells_list(): 'text': '[![CppCon moving pictures](https://i.ytimg.com/vi/PorfLSr3DDI/hqdefault.jpg)](https://www.youtube.com/user/CppCon/videos)\n\n', 'urls': { 'https://i.ytimg.com/vi/PorfLSr3DDI/hqdefault.jpg', - } + } }, { 'text': '* You could use following [command](https://stackoverflow.com/questions/8305866/how-to-analyze-a-programs-core-dump-file-with-gdb) to analyze.
\n``` sh\ngdb -c \n```', @@ -121,7 +121,7 @@ def test_get_re_markdown_simple_link(): 'text': '[![alt text](image_link)](link_here)\n\n', 'urls': { 'link_here', - } + } }, ] @@ -376,10 +376,10 @@ def test_check_link_in_cell(): "[ref0](https://en.wikipedia.org/wiki/New_and_delete_(C%2B%2B))\n", "\n" ]) - } + } r = cli.get_re_markdown_simple_link() - + # function under test # success case cli.check_link_in_cell(google_cell, r) diff --git a/tests/test_gcpp_2nd_line_filename.py b/tests/test_gcpp_2nd_line_filename.py index 74330e8..658c865 100644 --- a/tests/test_gcpp_2nd_line_filename.py +++ b/tests/test_gcpp_2nd_line_filename.py @@ -22,21 +22,21 @@ """ cpp_test_cases = [ - ('// ``` C++\n// Begin account_module.h\n#include \n\nvoid deposit (int32_t amount);\nvoid withdraw (int32_t amount);\nint32_t check();\n// End account_module.h\n// ```', + ('// ``` C++\n// Begin account_module.h\n#include \n\nvoid deposit (int32_t amount);\nvoid withdraw (int32_t amount);\nint32_t check();\n// End account_module.h\n// ```', 'account_module.h'), - ('// ``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.cpp\n// ```\n\n', + ('// ``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.cpp\n// ```\n\n', 'account_module.cpp'), - ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char * argv[]){\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(10000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n withdraw(3000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(5000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// ```\n\n', + ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char * argv[]){\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(10000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n withdraw(3000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(5000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// ```\n\n', 'account_module_user.cpp'), - ('// ``` C++\n// Begin account_module.h\n#include \n\nnamespace account {\n void deposit (int32_t amount);\n void withdraw (int32_t amount);\n int32_t check();\n}\n// End account_module.h\n// ```', + ('// ``` C++\n// Begin account_module.h\n#include \n\nnamespace account {\n void deposit (int32_t amount);\n void withdraw (int32_t amount);\n int32_t check();\n}\n// End account_module.h\n// ```', 'account_module.h'), - ('// ``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nnamespace account{\n int32_t balance;\n\n void deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n }\n\n void withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n }\n\n int32_t check(){\n return balance;\n }\n}\n// End account_module.cpp\n// ```\n\n', + ('// ``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nnamespace account{\n int32_t balance;\n\n void deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n }\n\n void withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n }\n\n int32_t check(){\n return balance;\n }\n}\n// End account_module.cpp\n// ```\n\n', 'account_module.cpp'), - ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(10000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::withdraw(3000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(5000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// ```\n\n', + ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(10000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::withdraw(3000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(5000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// ```\n\n', 'account_module_user.cpp'), - ('// ``` C++\n// Begin account_module.h\n#include \n#include \n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n std::cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n std::cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.h\n\n// ```', + ('// ``` C++\n// Begin account_module.h\n#include \n#include \n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n std::cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n std::cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.h\n\n// ```', 'account_module.h'), - ('// ```C++\n// Begin account_module_user.cpp\n#include \n#include \n\nnamespace account_a{\n #include "account_module.h"\n}\n\nnamespace account_b{\n #include "account_module.h"\n}\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(10000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::withdraw(3000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(5000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n remurn 0;\n}\n// End account_module_user.cpp\n// ```', + ('// ```C++\n// Begin account_module_user.cpp\n#include \n#include \n\nnamespace account_a{\n #include "account_module.h"\n}\n\nnamespace account_b{\n #include "account_module.h"\n}\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(10000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::withdraw(3000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(5000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n remurn 0;\n}\n// End account_module_user.cpp\n// ```', 'account_module_user.cpp'), ("""//``` void main (){ diff --git a/tests/test_get_build_command_in_last_line.py b/tests/test_get_build_command_in_last_line.py index 9324bde..38ba038 100644 --- a/tests/test_get_build_command_in_last_line.py +++ b/tests/test_get_build_command_in_last_line.py @@ -22,25 +22,25 @@ """ cpp_test_cases = [ - ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char * argv[]){\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(10000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n withdraw(3000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(5000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// Build command : g++ -Wall -g account_module.cpp account_module_user.cpp -o account_module_user\n// ```\n\n', + ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char * argv[]){\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(10000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n withdraw(3000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(5000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// Build command : g++ -Wall -g account_module.cpp account_module_user.cpp -o account_module_user\n// ```\n\n', 'g++ -Wall -g account_module.cpp account_module_user.cpp -o account_module_user'), - ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(10000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::withdraw(3000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(5000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// Build command : g++ -Wall -g account_module.cpp account_module_user.cpp -o account_module_user\n// ```\n\n', + ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(10000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::withdraw(3000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(5000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// Build command : g++ -Wall -g account_module.cpp account_module_user.cpp -o account_module_user\n// ```\n\n', 'g++ -Wall -g account_module.cpp account_module_user.cpp -o account_module_user'), - ('// ``` C++\n// Begin account_module.h\n#include \n\nvoid deposit (int32_t amount);\nvoid withdraw (int32_t amount);\nint32_t check();\n// End account_module.h\n// ```', + ('// ``` C++\n// Begin account_module.h\n#include \n\nvoid deposit (int32_t amount);\nvoid withdraw (int32_t amount);\nint32_t check();\n// End account_module.h\n// ```', ''), - ('// ``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.cpp\n// ```\n\n', + ('// ``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.cpp\n// ```\n\n', ''), - ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char * argv[]){\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(10000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n withdraw(3000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(5000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// ```\n\n', + ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char * argv[]){\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(10000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n withdraw(3000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(5000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// ```\n\n', ''), - ('// ``` C++\n// Begin account_module.h\n#include \n\nnamespace account {\n void deposit (int32_t amount);\n void withdraw (int32_t amount);\n int32_t check();\n}\n// End account_module.h\n// ```', + ('// ``` C++\n// Begin account_module.h\n#include \n\nnamespace account {\n void deposit (int32_t amount);\n void withdraw (int32_t amount);\n int32_t check();\n}\n// End account_module.h\n// ```', ''), - ('// ``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nnamespace account{\n int32_t balance;\n\n void deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n }\n\n void withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n }\n\n int32_t check(){\n return balance;\n }\n}\n// End account_module.cpp\n// ```\n\n', + ('// ``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nnamespace account{\n int32_t balance;\n\n void deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n }\n\n void withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n }\n\n int32_t check(){\n return balance;\n }\n}\n// End account_module.cpp\n// ```\n\n', ''), - ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(10000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::withdraw(3000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(5000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// ```\n\n', + ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(10000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::withdraw(3000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(5000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// ```\n\n', ''), - ('// ``` C++\n// Begin account_module.h\n#include \n#include \n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n std::cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n std::cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.h\n\n// ```', + ('// ``` C++\n// Begin account_module.h\n#include \n#include \n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n std::cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n std::cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.h\n\n// ```', ''), - ('// ```C++\n// Begin account_module_user.cpp\n#include \n#include \n\nnamespace account_a{\n #include "account_module.h"\n}\n\nnamespace account_b{\n #include "account_module.h"\n}\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(10000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::withdraw(3000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(5000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n remurn 0;\n}\n// End account_module_user.cpp\n// ```', + ('// ```C++\n// Begin account_module_user.cpp\n#include \n#include \n\nnamespace account_a{\n #include "account_module.h"\n}\n\nnamespace account_b{\n #include "account_module.h"\n}\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(10000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::withdraw(3000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(5000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n remurn 0;\n}\n// End account_module_user.cpp\n// ```', ''), ("""//``` void main (){ diff --git a/tutorial/build_util/build_util.py b/tutorial/build_util/build_util.py index 36268b5..14a2b43 100644 --- a/tutorial/build_util/build_util.py +++ b/tutorial/build_util/build_util.py @@ -34,7 +34,7 @@ def build_cpp(filename): """ # Detect OS type because OSX may need different options # https://stackoverflow.com/questions/3466166/how-to-check-if-running-in-cygwin-mac-or-linux/18790824 - + basename, ext = os.path.splitext(filename) if not ext: filename += '.cpp' diff --git a/tutorial/tests/check_links_in_ipynb.py b/tutorial/tests/check_links_in_ipynb.py index 349631f..5175a42 100644 --- a/tutorial/tests/check_links_in_ipynb.py +++ b/tutorial/tests/check_links_in_ipynb.py @@ -74,5 +74,5 @@ def check_links_in_ipynb_cells_list(cells_list): # check simple urls check_link_in_cell(cell, rs) - # check urls linked to + # check urls linked to check_link_in_cell(cell, ri) diff --git a/tutorial/tests/environment.3.5.yml b/tutorial/tests/environment.3.5.yml index 748e818..59fb422 100644 --- a/tutorial/tests/environment.3.5.yml +++ b/tutorial/tests/environment.3.5.yml @@ -7,7 +7,7 @@ channels: dependencies: - python=3.5 -# Anaconda 4.2 (2016.09) python 3.5 +# Anaconda 4.2 (2016.09) python 3.5 # https://docs.anaconda.com/anaconda/packages/old-pkg-lists/4.2.0/py35/ - cython=0.24.1 - jupyter=1.0.0 diff --git a/tutorial/tests/environment.3.6.yml b/tutorial/tests/environment.3.6.yml index 90fdfe6..303ac7a 100644 --- a/tutorial/tests/environment.3.6.yml +++ b/tutorial/tests/environment.3.6.yml @@ -6,7 +6,7 @@ channels: dependencies: - python=3.6 -# Anaconda 5.0.1 (2017.10) python 3.6 +# Anaconda 5.0.1 (2017.10) python 3.6 # https://docs.anaconda.com/anaconda/packages/old-pkg-lists/5.0.1/py3.6_win-64/ - cython=0.26.1 - jupyter=1.0.0 diff --git a/tutorial/tests/get_cpp_from_ipynb.py b/tutorial/tests/get_cpp_from_ipynb.py index 2e601d5..27faf13 100644 --- a/tutorial/tests/get_cpp_from_ipynb.py +++ b/tutorial/tests/get_cpp_from_ipynb.py @@ -28,7 +28,7 @@ def is_markdown_cpp_src(ipynb_cell): src = ipynb_cell['source'].strip() # Multiline code block within ```'s - if (src.startswith('```') + if (src.startswith('```') and src.endswith('```')): # check C++ right after ``` @@ -100,7 +100,7 @@ def get_build_command_in_last_line(cpp_txt): if 4 < len(line.lower().split()): # Check words if ( - ('build' == line.lower().split()[1]) + ('build' == line.lower().split()[1]) and ('command' == line.lower().split()[2]) and (':' == line.lower().split()[3]) ): diff --git a/tutorial/tests/test_check_links_in_ipynb.py b/tutorial/tests/test_check_links_in_ipynb.py index 6c9ab57..a8fbb7a 100644 --- a/tutorial/tests/test_check_links_in_ipynb.py +++ b/tutorial/tests/test_check_links_in_ipynb.py @@ -41,7 +41,7 @@ def test_check_links_in_ipynb_cells_list(): 'text': '[![CppCon moving pictures](https://i.ytimg.com/vi/PorfLSr3DDI/hqdefault.jpg)](https://www.youtube.com/user/CppCon/videos)\n\n', 'urls': { 'https://i.ytimg.com/vi/PorfLSr3DDI/hqdefault.jpg', - } + } }, { 'text': '* You could use following [command](https://stackoverflow.com/questions/8305866/how-to-analyze-a-programs-core-dump-file-with-gdb) to analyze.
\n``` sh\ngdb -c \n```', @@ -121,7 +121,7 @@ def test_get_re_markdown_simple_link(): 'text': '[![alt text](image_link)](link_here)\n\n', 'urls': { 'link_here', - } + } }, ] @@ -376,10 +376,10 @@ def test_check_link_in_cell(): "[ref0](https://en.wikipedia.org/wiki/New_and_delete_(C%2B%2B))\n", "\n" ]) - } + } r = cli.get_re_markdown_simple_link() - + # function under test # success case cli.check_link_in_cell(google_cell, r) diff --git a/tutorial/tests/test_gcpp_2nd_line_filename.py b/tutorial/tests/test_gcpp_2nd_line_filename.py index 74330e8..658c865 100644 --- a/tutorial/tests/test_gcpp_2nd_line_filename.py +++ b/tutorial/tests/test_gcpp_2nd_line_filename.py @@ -22,21 +22,21 @@ """ cpp_test_cases = [ - ('// ``` C++\n// Begin account_module.h\n#include \n\nvoid deposit (int32_t amount);\nvoid withdraw (int32_t amount);\nint32_t check();\n// End account_module.h\n// ```', + ('// ``` C++\n// Begin account_module.h\n#include \n\nvoid deposit (int32_t amount);\nvoid withdraw (int32_t amount);\nint32_t check();\n// End account_module.h\n// ```', 'account_module.h'), - ('// ``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.cpp\n// ```\n\n', + ('// ``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.cpp\n// ```\n\n', 'account_module.cpp'), - ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char * argv[]){\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(10000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n withdraw(3000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(5000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// ```\n\n', + ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char * argv[]){\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(10000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n withdraw(3000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(5000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// ```\n\n', 'account_module_user.cpp'), - ('// ``` C++\n// Begin account_module.h\n#include \n\nnamespace account {\n void deposit (int32_t amount);\n void withdraw (int32_t amount);\n int32_t check();\n}\n// End account_module.h\n// ```', + ('// ``` C++\n// Begin account_module.h\n#include \n\nnamespace account {\n void deposit (int32_t amount);\n void withdraw (int32_t amount);\n int32_t check();\n}\n// End account_module.h\n// ```', 'account_module.h'), - ('// ``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nnamespace account{\n int32_t balance;\n\n void deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n }\n\n void withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n }\n\n int32_t check(){\n return balance;\n }\n}\n// End account_module.cpp\n// ```\n\n', + ('// ``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nnamespace account{\n int32_t balance;\n\n void deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n }\n\n void withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n }\n\n int32_t check(){\n return balance;\n }\n}\n// End account_module.cpp\n// ```\n\n', 'account_module.cpp'), - ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(10000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::withdraw(3000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(5000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// ```\n\n', + ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(10000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::withdraw(3000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(5000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// ```\n\n', 'account_module_user.cpp'), - ('// ``` C++\n// Begin account_module.h\n#include \n#include \n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n std::cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n std::cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.h\n\n// ```', + ('// ``` C++\n// Begin account_module.h\n#include \n#include \n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n std::cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n std::cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.h\n\n// ```', 'account_module.h'), - ('// ```C++\n// Begin account_module_user.cpp\n#include \n#include \n\nnamespace account_a{\n #include "account_module.h"\n}\n\nnamespace account_b{\n #include "account_module.h"\n}\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(10000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::withdraw(3000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(5000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n remurn 0;\n}\n// End account_module_user.cpp\n// ```', + ('// ```C++\n// Begin account_module_user.cpp\n#include \n#include \n\nnamespace account_a{\n #include "account_module.h"\n}\n\nnamespace account_b{\n #include "account_module.h"\n}\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(10000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::withdraw(3000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(5000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n remurn 0;\n}\n// End account_module_user.cpp\n// ```', 'account_module_user.cpp'), ("""//``` void main (){ diff --git a/tutorial/tests/test_get_build_command_in_last_line.py b/tutorial/tests/test_get_build_command_in_last_line.py index 9324bde..38ba038 100644 --- a/tutorial/tests/test_get_build_command_in_last_line.py +++ b/tutorial/tests/test_get_build_command_in_last_line.py @@ -22,25 +22,25 @@ """ cpp_test_cases = [ - ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char * argv[]){\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(10000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n withdraw(3000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(5000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// Build command : g++ -Wall -g account_module.cpp account_module_user.cpp -o account_module_user\n// ```\n\n', + ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char * argv[]){\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(10000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n withdraw(3000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(5000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// Build command : g++ -Wall -g account_module.cpp account_module_user.cpp -o account_module_user\n// ```\n\n', 'g++ -Wall -g account_module.cpp account_module_user.cpp -o account_module_user'), - ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(10000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::withdraw(3000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(5000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// Build command : g++ -Wall -g account_module.cpp account_module_user.cpp -o account_module_user\n// ```\n\n', + ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(10000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::withdraw(3000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(5000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// Build command : g++ -Wall -g account_module.cpp account_module_user.cpp -o account_module_user\n// ```\n\n', 'g++ -Wall -g account_module.cpp account_module_user.cpp -o account_module_user'), - ('// ``` C++\n// Begin account_module.h\n#include \n\nvoid deposit (int32_t amount);\nvoid withdraw (int32_t amount);\nint32_t check();\n// End account_module.h\n// ```', + ('// ``` C++\n// Begin account_module.h\n#include \n\nvoid deposit (int32_t amount);\nvoid withdraw (int32_t amount);\nint32_t check();\n// End account_module.h\n// ```', ''), - ('// ``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.cpp\n// ```\n\n', + ('// ``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.cpp\n// ```\n\n', ''), - ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char * argv[]){\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(10000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n withdraw(3000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(5000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// ```\n\n', + ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char * argv[]){\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(10000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n withdraw(3000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n deposit(5000);\n\n cout << "account_module.check() = "<< check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// ```\n\n', ''), - ('// ``` C++\n// Begin account_module.h\n#include \n\nnamespace account {\n void deposit (int32_t amount);\n void withdraw (int32_t amount);\n int32_t check();\n}\n// End account_module.h\n// ```', + ('// ``` C++\n// Begin account_module.h\n#include \n\nnamespace account {\n void deposit (int32_t amount);\n void withdraw (int32_t amount);\n int32_t check();\n}\n// End account_module.h\n// ```', ''), - ('// ``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nnamespace account{\n int32_t balance;\n\n void deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n }\n\n void withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n }\n\n int32_t check(){\n return balance;\n }\n}\n// End account_module.cpp\n// ```\n\n', + ('// ``` C++\n// Begin account_module.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nnamespace account{\n int32_t balance;\n\n void deposit (int32_t amount){\n cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n }\n\n void withdraw (int32_t amount){\n cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n }\n\n int32_t check(){\n return balance;\n }\n}\n// End account_module.cpp\n// ```\n\n', ''), - ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(10000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::withdraw(3000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(5000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// ```\n\n', + ('\n// ``` C++\n// Begin account_module_user.cpp\n#include \n#include \n\n#include "account_module.h"\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(10000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::withdraw(3000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n account::deposit(5000);\n\n cout << "account_module.check() = "<< account::check() <<\'\\n\';\n\n return 0;\n}\n// End account_module_user.cpp\n// ```\n\n', ''), - ('// ``` C++\n// Begin account_module.h\n#include \n#include \n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n std::cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n std::cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.h\n\n// ```', + ('// ``` C++\n// Begin account_module.h\n#include \n#include \n\nint32_t balance;\n\n\nvoid deposit (int32_t amount){\n std::cout << "Deposit " << amount << \'\\n\';\n balance += amount;\n}\n\n\nvoid withdraw (int32_t amount){\n std::cout << "Depowithdrawsit " << amount << \'\\n\';\n balance += -amount;\n}\n\n\nint32_t check(){\n return balance;\n}\n// End account_module.h\n\n// ```', ''), - ('// ```C++\n// Begin account_module_user.cpp\n#include \n#include \n\nnamespace account_a{\n #include "account_module.h"\n}\n\nnamespace account_b{\n #include "account_module.h"\n}\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(10000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::withdraw(3000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(5000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n remurn 0;\n}\n// End account_module_user.cpp\n// ```', + ('// ```C++\n// Begin account_module_user.cpp\n#include \n#include \n\nnamespace account_a{\n #include "account_module.h"\n}\n\nnamespace account_b{\n #include "account_module.h"\n}\n\nusing namespace std;\n\nint32_t main(int32_t argn, char ** argv){\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(10000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::withdraw(3000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n account_a::deposit(5000);\n\n cout << "account_a::check() = "<< account_a::check() <<\'\\n\';\n cout << "account_b::check() = "<< account_b::check() <<\'\\n\';\n\n remurn 0;\n}\n// End account_module_user.cpp\n// ```', ''), ("""//``` void main (){ diff --git a/utils/find_in_notebook_files.py b/utils/find_in_notebook_files.py index 3bc23af..82625ff 100644 --- a/utils/find_in_notebook_files.py +++ b/utils/find_in_notebook_files.py @@ -118,7 +118,7 @@ def __init__(self, ipynb_full_path, replace_this, to_this, b_verbose=False, b_re """ super().__init__(ipynb_full_path) - # Find or replace + # Find or replace self.replace_this = replace_this self.to_this = to_this @@ -196,7 +196,7 @@ def write(self, ipynb_full_path): """ if self.b_replace and self.b_verbose and self.b_arm: if ( - (ipynb_full_path != self.ipynb_full_path) + (ipynb_full_path != self.ipynb_full_path) or (0 < self.count) ): # If same filename but no replacement count, do not overwrite diff --git a/utils/get_cpp_from_ipynb.py b/utils/get_cpp_from_ipynb.py index 4064187..a883c81 100644 --- a/utils/get_cpp_from_ipynb.py +++ b/utils/get_cpp_from_ipynb.py @@ -28,7 +28,7 @@ def is_markdown_cpp_src(ipynb_cell): src = ipynb_cell['source'].strip() # Multiline code block within ```'s - if (src.startswith('```') + if (src.startswith('```') and src.endswith('```')): # check C++ right after ``` diff --git a/utils/recursively_convert_units.py b/utils/recursively_convert_units.py index 83d45cf..35f62c5 100644 --- a/utils/recursively_convert_units.py +++ b/utils/recursively_convert_units.py @@ -2,7 +2,7 @@ import pathlib -ignore_path_list = {'__pycache__', '.ipynb_checkpoints', '.git', '.cache', '.idea', +ignore_path_list = {'__pycache__', '.ipynb_checkpoints', '.git', '.cache', '.idea', 'nbutils', 'tests', 'utils', '.github'} @@ -34,7 +34,7 @@ def gen_filename_ipynb(filename_list): """ for filename in filename_list: if is_ipynb(filename): - yield filename + yield filename def gen_ipynb(root): diff --git a/utils/symbol_converter.py b/utils/symbol_converter.py index 235a4be..533fc88 100644 --- a/utils/symbol_converter.py +++ b/utils/symbol_converter.py @@ -125,7 +125,7 @@ def process_line(self, source_line): """ SymbolConverter.process_line() - Find SymPy + Find SymPy """ symbol_names_location = self.find_symbol_name_location(source_line) diff --git a/utils/tests/test_end_with_two_returns.py b/utils/tests/test_end_with_two_returns.py index b64f07e..61c8407 100644 --- a/utils/tests/test_end_with_two_returns.py +++ b/utils/tests/test_end_with_two_returns.py @@ -23,9 +23,9 @@ class TestFile(unittest.TestCase): def setUp(self): self.fp = open( os.path.join( - os.path.dirname(__file__), + os.path.dirname(__file__), 'sample.ipynb' - ), + ), encoding = 'utf-8' ) @@ -35,7 +35,7 @@ def setUp(self): self.cell = self.nb['cells'][0] self.cell_src_strip = self.cell.source.strip() - + def tearDown(self): del self.cell_src_strip del self.cell diff --git a/utils/tests/test_separate_print.py b/utils/tests/test_separate_print.py index d2a4fbe..037a4b5 100644 --- a/utils/tests/test_separate_print.py +++ b/utils/tests/test_separate_print.py @@ -41,7 +41,7 @@ def sample_seperation_dict() -> dict: 'print("sy.pi**2 = %s" % sy.pi ** 2)' : 'sy.pi ** 2', 'print("sy.pi.evalf() = %s" % sy.pi.evalf())' : 'sy.pi.evalf()', 'print("sy.pi + sy.exp(1) = %s" % (sy.pi + sy.exp(1)))' : '(sy.pi + sy.exp(1))', - 'print("(sy.pi + sy.exp(1)).evalf() = %s" % ((sy.pi + sy.exp(1)).evalf()))' : '((sy.pi + sy.exp(1)).evalf())', + 'print("(sy.pi + sy.exp(1)).evalf() = %s" % ((sy.pi + sy.exp(1)).evalf()))' : '((sy.pi + sy.exp(1)).evalf())', 'print("sy.oo = %s" % sy.oo)' : 'sy.oo', 'print("sy.oo > 99999 = %s" % (sy.oo > 99999))' : '(sy.oo > 99999)', 'print("sy.sqrt(2) = %s" % (sy.sqrt(2).evalf(100)))' : '(sy.sqrt(2).evalf(100))', From 0dec29e2a3520d042d2f91aa00650cd961e6bc24 Mon Sep 17 00:00:00 2001 From: KangWon LEE Date: Thu, 5 Jun 2025 10:43:59 +0900 Subject: [PATCH 04/13] ci : ask `uv` to install `pandas` --- .github/workflows/conda_env_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conda_env_test.yml b/.github/workflows/conda_env_test.yml index c48f1c9..fa1c19a 100644 --- a/.github/workflows/conda_env_test.yml +++ b/.github/workflows/conda_env_test.yml @@ -72,7 +72,7 @@ jobs: run: uv venv - name: Install dependencies - run: uv pip install pytest pytest-xdist jupyter nbconvert numpy matplotlib scipy sympy + run: uv pip install pytest pytest-json-report pytest-xdist jupyter nbconvert numpy matplotlib pandas scipy sympy - name: Run tests env: From 53fa66e240b60ca9d03fcb861b102eb4d1f7462e Mon Sep 17 00:00:00 2001 From: KangWon LEE Date: Thu, 5 Jun 2025 10:48:55 +0900 Subject: [PATCH 05/13] fix : add `rhs` for `sympy.Eq()` --- utils/tests/sample.ipynb | 2 +- utils/tests/sample_with_output.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/tests/sample.ipynb b/utils/tests/sample.ipynb index 0fbd27d..702ab6d 100644 --- a/utils/tests/sample.ipynb +++ b/utils/tests/sample.ipynb @@ -343,7 +343,7 @@ }, "outputs": [], "source": [ - "fy_eq = sy.Eq(R_A_N + R_B_N + w0_N_m * L_AB_m)" + "fy_eq = sy.Eq(R_A_N + R_B_N + w0_N_m * L_AB_m, 0)" ] }, { diff --git a/utils/tests/sample_with_output.ipynb b/utils/tests/sample_with_output.ipynb index 9cab6af..29c7995 100644 --- a/utils/tests/sample_with_output.ipynb +++ b/utils/tests/sample_with_output.ipynb @@ -414,7 +414,7 @@ }, "outputs": [], "source": [ - "fy_eq = sy.Eq(R_A_N + R_B_N + w0_N_m * L_AB_m)" + "fy_eq = sy.Eq(R_A_N + R_B_N + w0_N_m * L_AB_m, 0)" ] }, { From 95398b8f0f310b6dd28f2f9def68cc7cc1748a68 Mon Sep 17 00:00:00 2001 From: KangWon LEE Date: Thu, 5 Jun 2025 11:09:09 +0900 Subject: [PATCH 06/13] ci : ask `uv` to install `Cython` --- .github/workflows/conda_env_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conda_env_test.yml b/.github/workflows/conda_env_test.yml index fa1c19a..53398cf 100644 --- a/.github/workflows/conda_env_test.yml +++ b/.github/workflows/conda_env_test.yml @@ -72,7 +72,7 @@ jobs: run: uv venv - name: Install dependencies - run: uv pip install pytest pytest-json-report pytest-xdist jupyter nbconvert numpy matplotlib pandas scipy sympy + run: uv pip install pytest pytest-json-report pytest-xdist Cython jupyter nbconvert numpy matplotlib pandas scipy sympy - name: Run tests env: From c168e5cd2b44a0c2a2e6335855aaf38556ae4030 Mon Sep 17 00:00:00 2001 From: KangWon LEE Date: Thu, 5 Jun 2025 11:14:12 +0900 Subject: [PATCH 07/13] fix : add `rhs` for `sympy.Eq()` --- utils/tests/sample.ipynb | 2 +- utils/tests/sample_with_output.ipynb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/tests/sample.ipynb b/utils/tests/sample.ipynb index 702ab6d..475c131 100644 --- a/utils/tests/sample.ipynb +++ b/utils/tests/sample.ipynb @@ -406,7 +406,7 @@ "metadata": {}, "outputs": [], "source": [ - "m_eq = sy.Eq(M_A_Nm - R_A_N * L_AB_m - sy.Rational(1, 2) * w0_N_m * L_AB_m ** 2)" + "m_eq = sy.Eq(M_A_Nm - R_A_N * L_AB_m - sy.Rational(1, 2) * w0_N_m * L_AB_m ** 2, 0)" ] }, { diff --git a/utils/tests/sample_with_output.ipynb b/utils/tests/sample_with_output.ipynb index 29c7995..a469403 100644 --- a/utils/tests/sample_with_output.ipynb +++ b/utils/tests/sample_with_output.ipynb @@ -526,7 +526,7 @@ "metadata": {}, "outputs": [], "source": [ - "m_eq = sy.Eq(M_A_Nm - R_A_N * L_AB_m - sy.Rational(1, 2) * w0_N_m * L_AB_m ** 2)" + "m_eq = sy.Eq(M_A_Nm - R_A_N * L_AB_m - sy.Rational(1, 2) * w0_N_m * L_AB_m ** 2, 0)" ] }, { From d12b6927ba7c638bf166fd3e701785ce54d643ce Mon Sep 17 00:00:00 2001 From: KangWon LEE Date: Thu, 5 Jun 2025 11:24:22 +0900 Subject: [PATCH 08/13] ci : create `uv` `venv` ask `uv` to install `3` for `nightly` --- .github/workflows/conda_env_test.yml | 21 +++++++++++---------- tests/requirements.2021.11.txt | 17 +++++++++++++++++ tests/requirements.2022.10.txt | 17 +++++++++++++++++ tests/requirements.nightly.txt | 17 +++++++++++++++++ 4 files changed, 62 insertions(+), 10 deletions(-) create mode 100644 tests/requirements.2021.11.txt create mode 100644 tests/requirements.2022.10.txt create mode 100644 tests/requirements.nightly.txt diff --git a/.github/workflows/conda_env_test.yml b/.github/workflows/conda_env_test.yml index 53398cf..46a97d8 100644 --- a/.github/workflows/conda_env_test.yml +++ b/.github/workflows/conda_env_test.yml @@ -49,32 +49,33 @@ jobs: test_ipynb: needs: badges - name: Test ipynb on Python ${{ matrix.python-version }} + name: Test ipynb on ${{ matrix.environment.name }} runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11"] + environment: + - {name: '2021.11', python-version: "3.9.4"} + - {name: 'nightly', python-version: "3"} fail-fast: false timeout-minutes: 30 steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Set up uv uses: astral-sh/setup-uv@v5 - name: Create virtual environment - run: uv venv + run: uv venv test-env-${{ matrix.environment.name }} --python ${{ matrix.environment.python-version }} - name: Install dependencies - run: uv pip install pytest pytest-json-report pytest-xdist Cython jupyter nbconvert numpy matplotlib pandas scipy sympy + run: | + source test-env-${{ matrix.environment.name }}/bin/activate + uv pip install -r tests/requirements.${{ matrix.environment.name }}.txt - name: Run tests env: TEST_IPYNB_IGNORE_FOLDER: tutorial - run: uv run pytest --numprocesses=auto -k 'not (links or update_nmisp_py)' tests/ + run: | + source test-env-${{ matrix.environment.name }}/bin/activate + uv run pytest --numprocesses=auto -k 'not (links or update_nmisp_py)' tests/ diff --git a/tests/requirements.2021.11.txt b/tests/requirements.2021.11.txt new file mode 100644 index 0000000..16c88cd --- /dev/null +++ b/tests/requirements.2021.11.txt @@ -0,0 +1,17 @@ +# python==3.9.4 +cython==0.29.24 +jupyter==1.0.0 +lxml==4.6.3 +matplotlib==3.4.3 +numpy==1.20.3 +pandas==1.3.4 +pandas-datareader==0.10.0 +pytest==6.2.4 +pytest-xdist==2.3.0 +requests==2.26.0 +scikit-learn==0.24.2 +scipy==1.7.1 +seaborn==0.11.2 +statsmodels==0.12.2 +sympy==1.9 +xlwt==1.3.0 diff --git a/tests/requirements.2022.10.txt b/tests/requirements.2022.10.txt new file mode 100644 index 0000000..c5ed159 --- /dev/null +++ b/tests/requirements.2022.10.txt @@ -0,0 +1,17 @@ +# python==3.10 +cython==0.29.32 +jupyter==1.0.0 +lxml==4.9.1 +matplotlib==3.5.2 +numpy==1.21.5 +pandas==1.4.4 +pandas-datareader==0.10.0 +pytest==7.1.2 +pytest-xdist==2.5.0 +requests==2.28.1 +scikit-learn==1.0.1 +scipy==1.9.1 +seaborn==0.11.2 +statsmodels==0.13.2 +sympy==1.10.1 +xlwt==1.3.0 diff --git a/tests/requirements.nightly.txt b/tests/requirements.nightly.txt new file mode 100644 index 0000000..69115ff --- /dev/null +++ b/tests/requirements.nightly.txt @@ -0,0 +1,17 @@ +# python +cython +jupyter +lxml +matplotlib +numpy +pandas +pandas-datareader +pytest +pytest-xdist +requests +scikit-learn +scipy +seaborn +statsmodels +sympy +xlwt From d918af3bf633d9cfabf924a725dcd69ebc7145ed Mon Sep 17 00:00:00 2001 From: KangWon LEE Date: Thu, 5 Jun 2025 11:36:21 +0900 Subject: [PATCH 09/13] ci : add OSX & Windows --- .github/workflows/conda_env_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/conda_env_test.yml b/.github/workflows/conda_env_test.yml index 46a97d8..b360615 100644 --- a/.github/workflows/conda_env_test.yml +++ b/.github/workflows/conda_env_test.yml @@ -56,6 +56,7 @@ jobs: environment: - {name: '2021.11', python-version: "3.9.4"} - {name: 'nightly', python-version: "3"} + os: [ubuntu-latest, macos-latest, windows-latest,] fail-fast: false timeout-minutes: 30 steps: From 54bcb7a62956b7a20df50a98389bb5817cf3c4e4 Mon Sep 17 00:00:00 2001 From: KangWon LEE Date: Thu, 5 Jun 2025 11:37:59 +0900 Subject: [PATCH 10/13] ci : indicate os in matrix --- .github/workflows/conda_env_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conda_env_test.yml b/.github/workflows/conda_env_test.yml index b360615..58f6a3b 100644 --- a/.github/workflows/conda_env_test.yml +++ b/.github/workflows/conda_env_test.yml @@ -49,7 +49,7 @@ jobs: test_ipynb: needs: badges - name: Test ipynb on ${{ matrix.environment.name }} + name: Test ipynb on ${{ matrix.environment.name }} of ${{ matrix.os }} runs-on: ubuntu-latest strategy: matrix: From dc3aa094460642818a795449687d018749dc5a84 Mon Sep 17 00:00:00 2001 From: KangWon LEE Date: Thu, 5 Jun 2025 11:39:10 +0900 Subject: [PATCH 11/13] ci : add 2022.10 with python 3.10 --- .github/workflows/conda_env_test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/conda_env_test.yml b/.github/workflows/conda_env_test.yml index 58f6a3b..74f9793 100644 --- a/.github/workflows/conda_env_test.yml +++ b/.github/workflows/conda_env_test.yml @@ -55,6 +55,7 @@ jobs: matrix: environment: - {name: '2021.11', python-version: "3.9.4"} + - {name: '2020.10', python-version: "3.10"} - {name: 'nightly', python-version: "3"} os: [ubuntu-latest, macos-latest, windows-latest,] fail-fast: false From d134f19bb094d55d7f1b2609e447ce8fff10a0bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Jun 2025 02:42:07 +0000 Subject: [PATCH 12/13] Bump numpy from 1.20.3 to 1.22.0 in /tests Bumps [numpy](https://github.com/numpy/numpy) from 1.20.3 to 1.22.0. - [Release notes](https://github.com/numpy/numpy/releases) - [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst) - [Commits](https://github.com/numpy/numpy/compare/v1.20.3...v1.22.0) --- updated-dependencies: - dependency-name: numpy dependency-version: 1.22.0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- tests/requirements.2021.11.txt | 2 +- tests/requirements.2022.10.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/requirements.2021.11.txt b/tests/requirements.2021.11.txt index 16c88cd..4fcd227 100644 --- a/tests/requirements.2021.11.txt +++ b/tests/requirements.2021.11.txt @@ -3,7 +3,7 @@ cython==0.29.24 jupyter==1.0.0 lxml==4.6.3 matplotlib==3.4.3 -numpy==1.20.3 +numpy==1.22.0 pandas==1.3.4 pandas-datareader==0.10.0 pytest==6.2.4 diff --git a/tests/requirements.2022.10.txt b/tests/requirements.2022.10.txt index c5ed159..d87354f 100644 --- a/tests/requirements.2022.10.txt +++ b/tests/requirements.2022.10.txt @@ -3,7 +3,7 @@ cython==0.29.32 jupyter==1.0.0 lxml==4.9.1 matplotlib==3.5.2 -numpy==1.21.5 +numpy==1.22.0 pandas==1.4.4 pandas-datareader==0.10.0 pytest==7.1.2 From ff94c63f34d49ff87a7ca3bd9f73aa97df1bbcbc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 5 Jun 2025 02:42:23 +0000 Subject: [PATCH 13/13] Clean ipynb e9d38c37462f5c740a57e65ba39c7b489e20124d --- 00.python-c-cpp/00.python.ipynb | 2 +- 00.python-c-cpp/10.c-cpp.ipynb | 2 +- 00.python-c-cpp/20.bash.ipynb | 2 +- 10.data-types-and-operators/00.git.ipynb | 2 +- 10.data-types-and-operators/10.types.ipynb | 2 +- 10.data-types-and-operators/20.operators.ipynb | 2 +- 20.control-flow/00.if.ipynb | 2 +- 20.control-flow/10.for-while.ipynb | 2 +- 20.control-flow/20.functions.ipynb | 2 +- 30.pointers-and-memory-management/00.pointers.ipynb | 2 +- 30.pointers-and-memory-management/10.calloc-free.ipynb | 2 +- .../20.python.list-reference.ipynb | 2 +- 40.object-oriented-programming/00.module-namespace.ipynb | 2 +- 40.object-oriented-programming/10.class.ipynb | 2 +- .../20.private-protected-public.ipynb | 2 +- 40.object-oriented-programming/30.state-space-in-class.ipynb | 2 +- 40.object-oriented-programming/40.dataclasses.dataclass.ipynb | 2 +- 50.under-the-hood/00.gdb.ipynb | 2 +- 50.under-the-hood/10.cython.ipynb | 2 +- 50.under-the-hood/22.working_with_bits_operators.ipynb | 2 +- 50.under-the-hood/28.working_with_bits_struct_union.ipynb | 2 +- tutorial/00.bash.ipynb | 2 +- tutorial/05.jupyter_notebook.ipynb | 2 +- tutorial/10.git.ipynb | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/00.python-c-cpp/00.python.ipynb b/00.python-c-cpp/00.python.ipynb index 5dd5e87..78bd443 100644 --- a/00.python-c-cpp/00.python.ipynb +++ b/00.python-c-cpp/00.python.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/00.python-c-cpp/10.c-cpp.ipynb b/00.python-c-cpp/10.c-cpp.ipynb index 561c5df..78d3076 100644 --- a/00.python-c-cpp/10.c-cpp.ipynb +++ b/00.python-c-cpp/10.c-cpp.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/00.python-c-cpp/20.bash.ipynb b/00.python-c-cpp/20.bash.ipynb index 3a5b268..185f4ab 100644 --- a/00.python-c-cpp/20.bash.ipynb +++ b/00.python-c-cpp/20.bash.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/10.data-types-and-operators/00.git.ipynb b/10.data-types-and-operators/00.git.ipynb index b784aae..48fa69f 100644 --- a/10.data-types-and-operators/00.git.ipynb +++ b/10.data-types-and-operators/00.git.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/10.data-types-and-operators/10.types.ipynb b/10.data-types-and-operators/10.types.ipynb index fc98633..ed4d672 100644 --- a/10.data-types-and-operators/10.types.ipynb +++ b/10.data-types-and-operators/10.types.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/10.data-types-and-operators/20.operators.ipynb b/10.data-types-and-operators/20.operators.ipynb index 1b895d9..78e5592 100644 --- a/10.data-types-and-operators/20.operators.ipynb +++ b/10.data-types-and-operators/20.operators.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/20.control-flow/00.if.ipynb b/20.control-flow/00.if.ipynb index 6abafc5..fbf02ba 100644 --- a/20.control-flow/00.if.ipynb +++ b/20.control-flow/00.if.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/20.control-flow/10.for-while.ipynb b/20.control-flow/10.for-while.ipynb index 9611705..08cffcf 100644 --- a/20.control-flow/10.for-while.ipynb +++ b/20.control-flow/10.for-while.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/20.control-flow/20.functions.ipynb b/20.control-flow/20.functions.ipynb index f331148..112f579 100644 --- a/20.control-flow/20.functions.ipynb +++ b/20.control-flow/20.functions.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/30.pointers-and-memory-management/00.pointers.ipynb b/30.pointers-and-memory-management/00.pointers.ipynb index ade1fbf..2ccbcfd 100644 --- a/30.pointers-and-memory-management/00.pointers.ipynb +++ b/30.pointers-and-memory-management/00.pointers.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/30.pointers-and-memory-management/10.calloc-free.ipynb b/30.pointers-and-memory-management/10.calloc-free.ipynb index 75094f6..640b5cc 100644 --- a/30.pointers-and-memory-management/10.calloc-free.ipynb +++ b/30.pointers-and-memory-management/10.calloc-free.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/30.pointers-and-memory-management/20.python.list-reference.ipynb b/30.pointers-and-memory-management/20.python.list-reference.ipynb index 938d058..b810d46 100644 --- a/30.pointers-and-memory-management/20.python.list-reference.ipynb +++ b/30.pointers-and-memory-management/20.python.list-reference.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/40.object-oriented-programming/00.module-namespace.ipynb b/40.object-oriented-programming/00.module-namespace.ipynb index 4d158ce..6756521 100644 --- a/40.object-oriented-programming/00.module-namespace.ipynb +++ b/40.object-oriented-programming/00.module-namespace.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/40.object-oriented-programming/10.class.ipynb b/40.object-oriented-programming/10.class.ipynb index 9f3ac11..4e05c60 100644 --- a/40.object-oriented-programming/10.class.ipynb +++ b/40.object-oriented-programming/10.class.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/40.object-oriented-programming/20.private-protected-public.ipynb b/40.object-oriented-programming/20.private-protected-public.ipynb index 750ac4b..d391b9c 100644 --- a/40.object-oriented-programming/20.private-protected-public.ipynb +++ b/40.object-oriented-programming/20.private-protected-public.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/40.object-oriented-programming/30.state-space-in-class.ipynb b/40.object-oriented-programming/30.state-space-in-class.ipynb index 107c75b..ed9c1e7 100644 --- a/40.object-oriented-programming/30.state-space-in-class.ipynb +++ b/40.object-oriented-programming/30.state-space-in-class.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/40.object-oriented-programming/40.dataclasses.dataclass.ipynb b/40.object-oriented-programming/40.dataclasses.dataclass.ipynb index a90e28d..7e4f8f9 100644 --- a/40.object-oriented-programming/40.dataclasses.dataclass.ipynb +++ b/40.object-oriented-programming/40.dataclasses.dataclass.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/50.under-the-hood/00.gdb.ipynb b/50.under-the-hood/00.gdb.ipynb index 7b9a835..1df0d5f 100644 --- a/50.under-the-hood/00.gdb.ipynb +++ b/50.under-the-hood/00.gdb.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/50.under-the-hood/10.cython.ipynb b/50.under-the-hood/10.cython.ipynb index 838398d..82caeb7 100644 --- a/50.under-the-hood/10.cython.ipynb +++ b/50.under-the-hood/10.cython.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/50.under-the-hood/22.working_with_bits_operators.ipynb b/50.under-the-hood/22.working_with_bits_operators.ipynb index 3e72906..5786a85 100644 --- a/50.under-the-hood/22.working_with_bits_operators.ipynb +++ b/50.under-the-hood/22.working_with_bits_operators.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/50.under-the-hood/28.working_with_bits_struct_union.ipynb b/50.under-the-hood/28.working_with_bits_struct_union.ipynb index 8748c0c..d38ed97 100644 --- a/50.under-the-hood/28.working_with_bits_struct_union.ipynb +++ b/50.under-the-hood/28.working_with_bits_struct_union.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/tutorial/00.bash.ipynb b/tutorial/00.bash.ipynb index 23913db..057f7ee 100644 --- a/tutorial/00.bash.ipynb +++ b/tutorial/00.bash.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/tutorial/05.jupyter_notebook.ipynb b/tutorial/05.jupyter_notebook.ipynb index db26380..6d1d811 100644 --- a/tutorial/05.jupyter_notebook.ipynb +++ b/tutorial/05.jupyter_notebook.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, { diff --git a/tutorial/10.git.ipynb b/tutorial/10.git.ipynb index b3747a4..5c8d858 100644 --- a/tutorial/10.git.ipynb +++ b/tutorial/10.git.ipynb @@ -7,7 +7,7 @@ "colab_type": "text" }, "source": [ - "\"Open\n" + "\"Open\n" ] }, {