MCPcopy Create free account
hub / github.com/PyTables/PyTables / _get_variable_names

Function _get_variable_names

tables/conditions.py:436–448  ·  view source on GitHub ↗

Return the list of variable names in the Numexpr `expression`.

(
    expression: ne.expressions.ExpressionNode,
)

Source from the content-addressed store, hash-verified

434
435
436def _get_variable_names(
437 expression: ne.expressions.ExpressionNode,
438) -> list[str]:
439 """Return the list of variable names in the Numexpr `expression`."""
440 names = []
441 stack = [expression]
442 while stack:
443 node = stack.pop()
444 if node.astType == "variable":
445 names.append(node.value)
446 elif hasattr(node, "children"):
447 stack.extend(node.children)
448 return list(set(names)) # remove repeated names
449
450
451def compile_condition(

Callers 1

compile_conditionFunction · 0.85

Calls 2

popMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected