Skip to content

Release 1.10.1 #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
62 changes: 62 additions & 0 deletions docs/releases/jijmodeling-1.10.1.ipynb
Original file line number Diff line number Diff line change
@@ -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
}
1 change: 1 addition & 0 deletions en/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
62 changes: 62 additions & 0 deletions en/releases/jijmodeling-1.10.1.ipynb
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading