Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Lang] Remove deprecated funcs in __init__.py (#7941)
Issue: # <!-- copilot:all --> ### <samp>π€ Generated by Copilot at 1f974a4</samp> ### Summary πποΈπ <!-- 1. π - This emoji represents a change that renames or replaces an existing API with a new one, such as the first two changes in the list. It implies that the change is part of a refactoring or an update to the codebase. 2. ποΈ - This emoji represents a change that removes or deletes unused or deprecated code, such as the third and fourth changes in the list. It implies that the change is part of a cleanup or a simplification of the codebase. 3. π - This emoji represents a change that adds or introduces new features or functionality, such as the last five changes in the list. It implies that the change is part of a enhancement or a improvement of the codebase. --> This pull request removes or updates the usage of several deprecated APIs in Taichi, such as `ti.any_arr`, `ti.block_dim`, `ti.clear_all_gradients`, and `ti.TetMesh`. The goal is to simplify the code, improve the user experience, and prepare for the upcoming release of Taichi v1.6.0. The changes affect various files in `python/taichi`, `tests/python`, and `tests/cpp/aot/python_scripts`. > _Oh we're the brave Taichi crew, and we've got some work to do_ > _We're clearing out the old code, and bringing in the new_ > _So heave away, me lads and lasses, heave away with me_ > _We'll use `ti.ad` and `ti.loop_config`, and sail the Python sea_ ### Walkthrough * Remove unused and deprecated imports, names, and statements in `python/taichi/__init__.py` ([link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-e0e39c57bc92c0e1da4c831f8820a4082a3cc26a9b88962bee72964dfa26a74aL1-L2), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-e0e39c57bc92c0e1da4c831f8820a4082a3cc26a9b88962bee72964dfa26a74aL21-R22), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-e0e39c57bc92c0e1da4c831f8820a4082a3cc26a9b88962bee72964dfa26a74aL101)) * Replace `ti.clear_all_gradients` with `ti.ad.clear_all_gradients` in examples and tests to use the new name for the function that clears all gradients in the autodiff system ([link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-12fc3a7ebde836d97c869694e52b5a407b49988c10e240c8fad33126013012acL63-R63), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-ee690f3a522eafc173aab6fe21fb1c6c4d96eaa8cd6f5aecd441079412e29635L28-R28), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-ee690f3a522eafc173aab6fe21fb1c6c4d96eaa8cd6f5aecd441079412e29635L38-R38), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-bf4b076e3a4f80273a1a730e55a004dcfcea49e3f22378c12636a35c0b707f1eL48-R48), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-bf4b076e3a4f80273a1a730e55a004dcfcea49e3f22378c12636a35c0b707f1eL93-R93)) * Replace `ti.any_arr` with `ti.types.ndarray` in argument annotations of kernels in `tests/cpp/aot/python_scripts` to use the new name for the type that represents a Taichi ndarray ([link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-4f9548204019161643336c9ebb271a758919885419bd440be93ea851fb62973aL30-R30), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-4f9548204019161643336c9ebb271a758919885419bd440be93ea851fb62973aL37-R42), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-4f9548204019161643336c9ebb271a758919885419bd440be93ea851fb62973aL62-R62), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-4f9548204019161643336c9ebb271a758919885419bd440be93ea851fb62973aL79-R84), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-4f9548204019161643336c9ebb271a758919885419bd440be93ea851fb62973aL108-R108), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-b2b340803f06d4337ecaf4f14abf66755d888946b08939b1f1e88e64d293b40aL70-R72), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-b2b340803f06d4337ecaf4f14abf66755d888946b08939b1f1e88e64d293b40aL87-R90), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-b2b340803f06d4337ecaf4f14abf66755d888946b08939b1f1e88e64d293b40aL99-R99), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-b2b340803f06d4337ecaf4f14abf66755d888946b08939b1f1e88e64d293b40aL110-R115), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-b2b340803f06d4337ecaf4f14abf66755d888946b08939b1f1e88e64d293b40aL142-R142), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-b2b340803f06d4337ecaf4f14abf66755d888946b08939b1f1e88e64d293b40aL149-R151), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-b2b340803f06d4337ecaf4f14abf66755d888946b08939b1f1e88e64d293b40aL167-R169)) * Replace `ti.block_dim` with `ti.loop_config(block_dim=...)` in kernels in `tests/python` to use the new API for configuring loop parallelization and block dimension ([link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-2ea5f113062438816406fbdb85d44d0b44fde412eed818ea1c06c9584c887277L57-R57), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-2ea5f113062438816406fbdb85d44d0b44fde412eed818ea1c06c9584c887277L170-R170), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-2ea5f113062438816406fbdb85d44d0b44fde412eed818ea1c06c9584c887277L187-R187), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-2ea5f113062438816406fbdb85d44d0b44fde412eed818ea1c06c9584c887277L205-R205), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-2ea5f113062438816406fbdb85d44d0b44fde412eed818ea1c06c9584c887277L219-R219), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-2ea5f113062438816406fbdb85d44d0b44fde412eed818ea1c06c9584c887277L242-R242), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-938cc2e845889f8797de5f5de2d2a6f35fc43679c3c41d8bbbae46810c4ae518L174-R174)) * Replace `ti.TetMesh` with `ti.lang.mesh._TetMesh` in `tests/python/test_mesh.py` to use the new name for the class that represents a tetrahedral mesh ([link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-a5d38fced7102d9278d61f209491478ba617cfc016e6dc37840da62cfef36f09L14-R14), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-a5d38fced7102d9278d61f209491478ba617cfc016e6dc37840da62cfef36f09L30-R30), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-a5d38fced7102d9278d61f209491478ba617cfc016e6dc37840da62cfef36f09L109-R109), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-a5d38fced7102d9278d61f209491478ba617cfc016e6dc37840da62cfef36f09L144-R144), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-a5d38fced7102d9278d61f209491478ba617cfc016e6dc37840da62cfef36f09L166-R166), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-a5d38fced7102d9278d61f209491478ba617cfc016e6dc37840da62cfef36f09L187-R187), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-a5d38fced7102d9278d61f209491478ba617cfc016e6dc37840da62cfef36f09L222-R222), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-a5d38fced7102d9278d61f209491478ba617cfc016e6dc37840da62cfef36f09L258-R258), [link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-a5d38fced7102d9278d61f209491478ba617cfc016e6dc37840da62cfef36f09L277-R277)) * Remove the test case for `ti.SOA` in `tests/python/test_deprecation.py` to match the removal of the deprecated name in `python/taichi/__init__.py` ([link](https://github.com/taichi-dev/taichi/pull/7941/files?diff=unified&w=0#diff-8981be068a363e39524dc2e29d28d4c13a097d0037fc3a1176b249ce5bf35ef8L80-L88))
- Loading branch information