Skip to content

Commit 18d64b0

Browse files
committed
Merge branch 'develop' into konn/genarray
2 parents 58d9126 + 4d18503 commit 18d64b0

4 files changed

Lines changed: 382 additions & 4 deletions

File tree

docs/en/releases/unreleased.ipynb

Lines changed: 146 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/ja/releases/unreleased.ipynb

Lines changed: 145 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

markdowns/en/releases/unreleased.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,52 @@ problem
4444

4545
+++
4646

47-
### Bugfix 1
47+
### Bugfixes in random instance data generation
48+
49+
We fixed the following two bugs in random instance data generation:
50+
51+
#### Placeholders that depend on `NamedExpr` were not handled correctly
52+
53+
We fixed a bug where placeholders whose shape (length) or key set depends on `NamedExpr` were not handled correctly.
54+
For example, consider the following problem:
55+
56+
```{code-cell} ipython3
57+
import jijmodeling as jm
58+
59+
60+
@jm.Problem.define("My Problem")
61+
def problem(problem: jm.DecoratedProblem):
62+
a = problem.Float(ndim=1)
63+
N = problem.NamedExpr(a.len_at(0))
64+
b = problem.Natural(shape=(N, None))
65+
M = problem.NamedExpr(b.len_at(1))
66+
problem += jm.sum(a[i] * b[i, j] for i in N for j in M)
67+
68+
69+
problem
70+
```
71+
72+
In previous versions, calling `generate_random_dataset()` on this `problem` raised an exception. Starting with this release, the data is generated correctly.
73+
74+
```{code-cell} ipython3
75+
problem.generate_random_dataset(seed=17)
76+
```
77+
78+
#### Fixed a bug where generation failed when unused placeholders were present
79+
80+
Data generation failed when there were unused placeholders not included in `used_placeholder()`.
81+
For example, in the following code, `N` is defined but never used, and previous versions raised a runtime exception.
82+
83+
```{code-cell} ipython3
84+
import jijmodeling as jm
85+
86+
problem = jm.Problem("My Problem")
87+
N = problem.Natural("N")
88+
89+
problem.generate_random_dataset(seed=17)
90+
```
91+
92+
Starting with this release, data is generated successfully in cases like the example above.
4893

4994

5095
## Other Changes

0 commit comments

Comments
 (0)