Skip to content

Commit

Permalink
Fix implicit casting warning in comet.py
Browse files Browse the repository at this point in the history
Explicitly cast index `i` to int in `ti.deactivate` to prevent TaichiWarning
  • Loading branch information
bluevisor authored Nov 10, 2024
1 parent e9f19b8 commit 43e744f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/taichi/examples/simulation/comet.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def substep():
color[i] *= ti.exp(-dt * color_decay)

if not all(-0.1 <= x[i] <= 1.1):
ti.deactivate(x.snode.parent(), [i])
ti.deactivate(x.snode.parent(), [int(i)])


@ti.kernel
Expand Down

0 comments on commit 43e744f

Please sign in to comment.