From 60fb6ca6694ab1045070b25924968ff859aa1c27 Mon Sep 17 00:00:00 2001 From: shitaro Date: Fri, 13 Dec 2024 20:59:12 +0900 Subject: [PATCH] add release note --- docs/_toc.yml | 1 + docs/releases/jijmodeling-1.10.1.ipynb | 62 ++++++++++++++++++++++++++ en/_toc.yml | 1 + en/releases/jijmodeling-1.10.1.ipynb | 62 ++++++++++++++++++++++++++ pyproject.toml | 2 +- requirements.txt | 2 +- uv.lock | 2 +- 7 files changed, 129 insertions(+), 3 deletions(-) create mode 100644 docs/releases/jijmodeling-1.10.1.ipynb create mode 100644 en/releases/jijmodeling-1.10.1.ipynb diff --git a/docs/_toc.yml b/docs/_toc.yml index bb65f13..7e4d1bf 100644 --- a/docs/_toc.yml +++ b/docs/_toc.yml @@ -25,3 +25,4 @@ parts: - file: releases/jijmodeling-1.8.0 - file: releases/jijmodeling-1.9.0 - file: releases/jijmodeling-1.10.0 + - file: releases/jijmodeling-1.10.1 diff --git a/docs/releases/jijmodeling-1.10.1.ipynb b/docs/releases/jijmodeling-1.10.1.ipynb new file mode 100644 index 0000000..d60d554 --- /dev/null +++ b/docs/releases/jijmodeling-1.10.1.ipynb @@ -0,0 +1,62 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# JijModeling 1.10.1 Release Notes\n", + "\n", + "Fixed an issue where the interpreter would fail to evaluate summation and product expressions if they included conditional statements referencing another index variable within their indexing sets. In previous versions (<= 1.10.0), applying conditions to one index in a summation that depended on another index in the same summation scope would cause an `InterpreterError`. This has now been resolved, allowing conditions within complex multi-index summations to be evaluated correctly." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import jijmodeling as jm\n", + "\n", + "n = jm.Placeholder(\"n\")\n", + "m = jm.Placeholder(\"m\")\n", + "x = jm.BinaryVar(\"x\", shape=(n, m))\n", + "i = jm.Element(\"i\", belong_to=(0, n))\n", + "j = jm.Element(\"j\", belong_to=(0, m))\n", + "\n", + "problem = jm.Problem(\"problem\")\n", + "# Previously, the following summation would fail because it includes a condition\n", + "# on j that depends on i, both defined within the same summation scope.\n", + "problem += jm.sum([i, (j, j != i)], x[i, j])\n", + "\n", + "interpreter = jm.Interpreter({\"n\": 3, \"m\": 2})\n", + "try:\n", + " # Before 1.10.1, this would raise an InterpreterError.\n", + " # Now, it evaluates successfully.\n", + " interpreter.eval_problem(problem)\n", + "except jm.InterpreterError as e:\n", + " print(\"InterpreterError:\", e)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".venv", + "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.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/en/_toc.yml b/en/_toc.yml index 3564484..e56b1db 100644 --- a/en/_toc.yml +++ b/en/_toc.yml @@ -19,3 +19,4 @@ parts: - file: releases/jijmodeling-1.8.0 - file: releases/jijmodeling-1.9.0 - file: releases/jijmodeling-1.10.0 + - file: releases/jijmodeling-1.10.1 diff --git a/en/releases/jijmodeling-1.10.1.ipynb b/en/releases/jijmodeling-1.10.1.ipynb new file mode 100644 index 0000000..d60d554 --- /dev/null +++ b/en/releases/jijmodeling-1.10.1.ipynb @@ -0,0 +1,62 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# JijModeling 1.10.1 Release Notes\n", + "\n", + "Fixed an issue where the interpreter would fail to evaluate summation and product expressions if they included conditional statements referencing another index variable within their indexing sets. In previous versions (<= 1.10.0), applying conditions to one index in a summation that depended on another index in the same summation scope would cause an `InterpreterError`. This has now been resolved, allowing conditions within complex multi-index summations to be evaluated correctly." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import jijmodeling as jm\n", + "\n", + "n = jm.Placeholder(\"n\")\n", + "m = jm.Placeholder(\"m\")\n", + "x = jm.BinaryVar(\"x\", shape=(n, m))\n", + "i = jm.Element(\"i\", belong_to=(0, n))\n", + "j = jm.Element(\"j\", belong_to=(0, m))\n", + "\n", + "problem = jm.Problem(\"problem\")\n", + "# Previously, the following summation would fail because it includes a condition\n", + "# on j that depends on i, both defined within the same summation scope.\n", + "problem += jm.sum([i, (j, j != i)], x[i, j])\n", + "\n", + "interpreter = jm.Interpreter({\"n\": 3, \"m\": 2})\n", + "try:\n", + " # Before 1.10.1, this would raise an InterpreterError.\n", + " # Now, it evaluates successfully.\n", + " interpreter.eval_problem(problem)\n", + "except jm.InterpreterError as e:\n", + " print(\"InterpreterError:\", e)" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".venv", + "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.10.12" + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/pyproject.toml b/pyproject.toml index 400bd36..6630916 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "jijmodeling-tutorial" -version = "1.10.0" +version = "1.10.1" description = "Tutorial for JijModeling" readme = "README.md" requires-python = ">=3.9, <3.12" # jijmodeling does not support Python 3.12 yet diff --git a/requirements.txt b/requirements.txt index 544118f..9d84088 100644 --- a/requirements.txt +++ b/requirements.txt @@ -29,7 +29,7 @@ iniconfig==2.0.0 # via pytest jij-cimod==1.6.2 # via openjij -jijmodeling==1.10.0 +jijmodeling==1.10.1 # via # jijmodeling-tutorial (pyproject.toml) # jijmodeling-transpiler diff --git a/uv.lock b/uv.lock index 1c21e23..5e37e8e 100644 --- a/uv.lock +++ b/uv.lock @@ -646,7 +646,7 @@ wheels = [ [[package]] name = "jijmodeling-tutorial" -version = "1.10.0" +version = "1.10.1" source = { virtual = "." } dependencies = [ { name = "jijmodeling" },