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

Remove unused numpy utility functions #2595

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ What's New in astroid 4.0.0?
============================
Release date: TBA

* Removed internal functions ``infer_numpy_member``, ``name_looks_like_numpy_member``, and
``attribute_looks_like_numpy_member`` from ``astroid.brain.brain_numpy_utils``.

* Fix crashes with large positive and negative list multipliers.

Closes #2521
Expand Down
28 changes: 0 additions & 28 deletions astroid/brain/brain_numpy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ def infer_numpy_attribute(
return extracted_node.infer(context=context)


# TODO: Deprecate and remove this function
def infer_numpy_member(src, node, context: InferenceContext | None = None):
node = extract_node(src)
return node.infer(context=context)


def _is_a_numpy_module(node: Name) -> bool:
"""
Returns True if the node is a representation of a numpy module.
Expand Down Expand Up @@ -96,25 +90,3 @@ def attribute_name_looks_like_numpy_member(
and isinstance(node.expr, Name)
and _is_a_numpy_module(node.expr)
)


# TODO: Deprecate and remove this function
def name_looks_like_numpy_member(member_name: str, node: Name) -> bool:
"""
Returns True if the Name is a member of numpy whose
name is member_name.
"""
return node.name == member_name and node.root().name.startswith("numpy")


# TODO: Deprecate and remove this function
def attribute_looks_like_numpy_member(member_name: str, node: Attribute) -> bool:
"""
Returns True if the Attribute is a member of numpy whose
name is member_name.
"""
return (
node.attrname == member_name
and isinstance(node.expr, Name)
and _is_a_numpy_module(node.expr)
)
Loading