Skip to content
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

[Misc] Remove more deprecated APIs #3774

Merged

Conversation

izackwu
Copy link
Contributor

@izackwu izackwu commented Dec 11, 2021

Related issue = close #3590

This PR further removes more deprecated APIs:

  • ti.complex_kernel
  • ti.complex_kernel_grad
  • ti.outer_product(a, b)
  • ti.cross(a, b
  • ti.dot(a, b)
  • ti.normalized(a)
  • use_unified_memory
  • ti.determinant(a)
  • ti.tr(a)
  • a.inversed()
  • to_numpy(as_vector)

Also, for other related repos:

After this PR, there should be almost no deprecated APIs in the codebase:

❯ rg "deprecated" python
# This is for testing only, and it raises RuntimeError immediately to alert users, so it's okay to keep it.
python/taichi/main.py
658:            'ti test is deprecated. Please run `python tests/run_tests.py` instead.'

# This is a quite recent change, and according to its original code review comments, we need to keep it
# See https://github.com/taichi-dev/taichi/pull/2774/files#r693818926
python/taichi/__init__.py
22:deprecated_names = {'SOA': 'Layout.SOA', 'AOS': 'Layout.AOS'}
24:    for name, alter in deprecated_names.items():
29:        if attr in deprecated_names:
31:                f'ti.{attr} is deprecated. Please use ti.{deprecated_names[attr]} instead.',
34:            exec(f'{attr} = {deprecated_names[attr]}')

# This is nothing :)
python/taichi/tools/__init__.py
16:    'deprecated',

# This is `deprecated` function definition, maybe we will need it in the future
# to mark other functions as outdated
python/taichi/tools/util.py
81:def deprecated(old, new, warning_type=DeprecationWarning):
82:    """Mark an API as deprecated.
91:        >>> @deprecated('ti.sqr(x)', 'x**2')
102:            msg = f'{old} is deprecated. Please use {new} instead.'

@netlify
Copy link

netlify bot commented Dec 11, 2021

✔️ Deploy Preview for jovial-fermat-aa59dc canceled.

🔨 Explore the source changes: 4484eb0

🔍 Inspect the deploy log: https://app.netlify.com/sites/jovial-fermat-aa59dc/deploys/61b45e1d1d001300087ffad1

Copy link
Contributor

@strongoier strongoier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks!

@strongoier strongoier merged commit 07d8193 into taichi-dev:master Dec 12, 2021
@izackwu izackwu deleted the zackwu/remove-deprecated-apis-extra branch December 12, 2021 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove deprecated APIs
2 participants