Skip to content

Commit

Permalink
Remove unused numpy utility functions (#2595)
Browse files Browse the repository at this point in the history
Follow-up to c7ea1e9.
  • Loading branch information
correctmost authored Oct 2, 2024
1 parent d174ca2 commit be00359
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
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)
)

0 comments on commit be00359

Please sign in to comment.