You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: markdowns/en/releases/unreleased.md
+46-1Lines changed: 46 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,52 @@ kernelspec:
27
27
28
28
+++
29
29
30
-
### Bugfix 1
30
+
### Bugfixes in random instance data generation
31
+
32
+
We fixed the following two bugs in random instance data generation:
33
+
34
+
#### Placeholders that depend on `NamedExpr` were not handled correctly
35
+
36
+
We fixed a bug where placeholders whose shape (length) or key set depends on `NamedExpr` were not handled correctly.
37
+
For example, consider the following problem:
38
+
39
+
```{code-cell} ipython3
40
+
import jijmodeling as jm
41
+
42
+
43
+
@jm.Problem.define("My Problem")
44
+
def problem(problem: jm.DecoratedProblem):
45
+
a = problem.Float(ndim=1)
46
+
N = problem.NamedExpr(a.len_at(0))
47
+
b = problem.Natural(shape=(N, None))
48
+
M = problem.NamedExpr(b.len_at(1))
49
+
problem += jm.sum(a[i] * b[i, j] for i in N for j in M)
50
+
51
+
52
+
problem
53
+
```
54
+
55
+
In previous versions, calling `generate_random_dataset()` on this `problem` raised an exception. Starting with this release, the data is generated correctly.
56
+
57
+
```{code-cell} ipython3
58
+
problem.generate_random_dataset(seed=17)
59
+
```
60
+
61
+
#### Fixed a bug where generation failed when unused placeholders were present
62
+
63
+
Data generation failed when there were unused placeholders not included in `used_placeholder()`.
64
+
For example, in the following code, `N` is defined but never used, and previous versions raised a runtime exception.
65
+
66
+
```{code-cell} ipython3
67
+
import jijmodeling as jm
68
+
69
+
problem = jm.Problem("My Problem")
70
+
N = problem.Natural("N")
71
+
72
+
problem.generate_random_dataset(seed=17)
73
+
```
74
+
75
+
Starting with this release, data is generated successfully in cases like the example above.
0 commit comments