-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Lang] Remove deprecated funcs in __init__.py #7941
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
β Deploy Preview for docsite-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
feisuzhu
approved these changes
May 9, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
feisuzhu
pushed a commit
that referenced
this pull request
May 10, 2023
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))
quadpixels
pushed a commit
to quadpixels/taichi
that referenced
this pull request
May 13, 2023
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))
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue: #
π€ Generated by Copilot at 1f974a4
Summary
πποΈπ
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
, andti.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 inpython/taichi
,tests/python
, andtests/cpp/aot/python_scripts
.Walkthrough
python/taichi/__init__.py
(link, link, link)ti.clear_all_gradients
withti.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, link, link, link, link)ti.any_arr
withti.types.ndarray
in argument annotations of kernels intests/cpp/aot/python_scripts
to use the new name for the type that represents a Taichi ndarray (link, link, link, link, link, link, link, link, link, link, link, link)ti.block_dim
withti.loop_config(block_dim=...)
in kernels intests/python
to use the new API for configuring loop parallelization and block dimension (link, link, link, link, link, link, link)ti.TetMesh
withti.lang.mesh._TetMesh
intests/python/test_mesh.py
to use the new name for the class that represents a tetrahedral mesh (link, link, link, link, link, link, link, link, link)ti.SOA
intests/python/test_deprecation.py
to match the removal of the deprecated name inpython/taichi/__init__.py
(link)