Issue: #
This PR addresses a Taichi warning in comet.py by explicitly casting i to an integer in the ti.deactivate function. The warning appeared as follows:
TaichiWarning While compiling substep_c76_0, File “taichi/examples/simulation/comet.py”, line 55, in substep: ti.deactivate(x.snode.parent(), [i]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Field index 0 not int32, casting into int32 implicitly
Changes Made
Updated ti.deactivate(x.snode.parent(), [i]) to ti.deactivate(x.snode.parent(), [int(i)]) in comet.py.
Rationale
Explicitly casting i to int prevents Taichi from implicitly casting and suppresses the TaichiWarning. This change improves code clarity and ensures compatibility with the expected data type for the function.
Testing
Confirmed that the warning is no longer displayed when running comet.py.
Functionality of comet.py remains intact after this change.
Issue: # This PR addresses a Taichi warning in
comet.py
by explicitly castingi
to an integer in theti.deactivate
function. The warning appeared as follows:TaichiWarning While compiling substep_c76_0, File “taichi/examples/simulation/comet.py”, line 55, in substep: ti.deactivate(x.snode.parent(), [i]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Field index 0 not int32, casting into int32 implicitly
Changes Made
ti.deactivate(x.snode.parent(), [i])
toti.deactivate(x.snode.parent(), [int(i)])
incomet.py
.Rationale
Explicitly casting
i
toint
prevents Taichi from implicitly casting and suppresses the TaichiWarning. This change improves code clarity and ensures compatibility with the expected data type for the function.Testing
comet.py
.comet.py
remains intact after this change.