-
-
Notifications
You must be signed in to change notification settings - Fork 157
TYP: Clean up annotations for undocumented elements #1563
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,5 @@ | ||
| import ast | ||
| from typing import Any | ||
|
|
||
| from pandas.core.computation.ops import Term as Term | ||
| from pandas.core.computation.scope import Scope as Scope | ||
|
|
||
| class BaseExprVisitor(ast.NodeVisitor): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. delete this class. Only referenced in pytables to create other classes that are not documented |
||
|
|
@@ -19,47 +17,10 @@ class BaseExprVisitor(ast.NodeVisitor): | |
| parser = ... | ||
| preparser = ... | ||
| assigner = ... | ||
| def __init__(self, env, engine, parser, preparser=...) -> None: ... | ||
| def visit(self, node, **kwargs: Any): ... | ||
| def visit_Module(self, node, **kwargs: Any): ... | ||
| def visit_Expr(self, node, **kwargs: Any): ... | ||
| def visit_BinOp(self, node, **kwargs: Any): ... | ||
| def visit_Div(self, node, **kwargs: Any): ... | ||
| def visit_UnaryOp(self, node, **kwargs: Any): ... | ||
| def visit_Name(self, node, **kwargs: Any): ... | ||
| def visit_NameConstant(self, node, **kwargs: Any): ... | ||
| def visit_Num(self, node, **kwargs: Any): ... | ||
| def visit_Constant(self, node, **kwargs: Any): ... | ||
| def visit_Str(self, node, **kwargs: Any): ... | ||
| def visit_List(self, node, **kwargs: Any): ... | ||
| def visit_Index(self, node, **kwargs: Any): ... | ||
| def visit_Subscript(self, node, **kwargs: Any): ... | ||
| def visit_Slice(self, node, **kwargs: Any): ... | ||
| def visit_Assign(self, node, **kwargs: Any): ... | ||
| def visit_Attribute(self, node, **kwargs: Any): ... | ||
| def visit_Call(self, node, side=..., **kwargs: Any): ... | ||
| def translate_In(self, op): ... | ||
| def visit_Compare(self, node, **kwargs: Any): ... | ||
| def visit_BoolOp(self, node, **kwargs: Any): ... | ||
|
|
||
| class Expr: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need to keep this one because it is superclass of Now we don't document what |
||
| env: Scope | ||
| engine: str | ||
| parser: str | ||
| expr = ... | ||
| terms = ... | ||
| def __init__( | ||
| self, | ||
| expr, | ||
| engine: str = ..., | ||
| parser: str = ..., | ||
| env: Scope | None = ..., | ||
| level: int = ..., | ||
| ) -> None: ... | ||
| @property | ||
| def assigner(self): ... | ||
| def __call__(self): ... | ||
| def __len__(self) -> int: ... | ||
| def parse(self): ... | ||
| @property | ||
| def names(self): ... | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this file can be deleted. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,56 +3,34 @@ from typing import Any | |
|
|
||
| import numpy as np | ||
|
|
||
| class UndefinedVariableError(NameError): | ||
| def __init__(self, name, is_local: bool = ...) -> None: ... | ||
| class UndefinedVariableError(NameError): ... | ||
|
|
||
| class Term: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tihnk |
||
| def __new__(cls, name, env, side=..., encoding=...): ... | ||
| is_local: bool | ||
| env = ... | ||
| side = ... | ||
| encoding = ... | ||
| def __init__(self, name, env, side=..., encoding=...) -> None: ... | ||
| @property | ||
| def local_name(self) -> str: ... | ||
| def __call__(self, *args: Any, **kwargs: Any): ... | ||
| def evaluate(self, *args: Any, **kwargs: Any): ... | ||
| def update(self, value) -> None: ... | ||
| @property | ||
| def is_scalar(self) -> bool: ... | ||
| @property | ||
| def type(self): ... | ||
| return_type = ... | ||
| @property | ||
| def raw(self) -> str: ... | ||
| @property | ||
| def is_datetime(self) -> bool: ... | ||
| @property | ||
| def value(self): ... | ||
| @value.setter | ||
| def value(self, new_value) -> None: ... | ||
| @property | ||
| def name(self): ... | ||
| @property | ||
| def ndim(self) -> int: ... | ||
|
|
||
| class Constant(Term): | ||
| @property | ||
| def name(self): ... | ||
| class Constant(Term): ... | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can be deleted
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, can be deleted |
||
|
|
||
| class Op: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that this and its subclasses can be deleted |
||
| op: str | ||
| operands = ... | ||
| encoding = ... | ||
| def __init__(self, op: str, operands, *args: Any, **kwargs: Any) -> None: ... | ||
| def __iter__(self): ... | ||
| @property | ||
| def return_type(self): ... | ||
| @property | ||
| def has_invalid_return_type(self) -> bool: ... | ||
| @property | ||
| def operand_types(self): ... | ||
| @property | ||
| def is_scalar(self) -> bool: ... | ||
| @property | ||
| def is_datetime(self) -> bool: ... | ||
|
|
@@ -61,21 +39,14 @@ class BinOp(Op): | |
| lhs = ... | ||
| rhs = ... | ||
| func = ... | ||
| def __init__(self, op: str, lhs, rhs, **kwargs: Any) -> None: ... | ||
| def __call__(self, env): ... | ||
| def evaluate(self, env, engine: str, parser, term_type, eval_in_python): ... | ||
| def convert_values(self): ... | ||
|
|
||
| def isnumeric(dtype) -> bool: ... | ||
| def isnumeric(dtype: type) -> bool: ... | ||
|
|
||
| class Div(BinOp): | ||
| def __init__(self, lhs, rhs, **kwargs: Any) -> None: ... | ||
| class Div(BinOp): ... | ||
|
|
||
| class UnaryOp(Op): | ||
| operand = ... | ||
| func = ... | ||
| def __init__(self, op: str, operand) -> None: ... | ||
| def __call__(self, env): ... | ||
| if sys.version_info >= (3, 11): | ||
| @property | ||
| def return_type(self) -> np.dtype: ... | ||
|
|
@@ -85,11 +56,8 @@ class UnaryOp(Op): | |
|
|
||
| class MathCall(Op): | ||
| func = ... | ||
| def __init__(self, func, args) -> None: ... | ||
| def __call__(self, env): ... | ||
|
|
||
| class FuncNode: | ||
| name = ... | ||
| func = ... | ||
| def __init__(self, name: str) -> None: ... | ||
| def __call__(self, *args: Any): ... | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this can be deleted.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PyTables is used in |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,87 +3,39 @@ from typing import Any | |
| from pandas.core.computation import ( | ||
| expr as expr, | ||
| ops as ops, | ||
| scope as _scope, | ||
| ) | ||
| from pandas.core.computation.expr import BaseExprVisitor as BaseExprVisitor | ||
| from pandas.core.indexes.base import Index | ||
|
|
||
| class PyTablesScope(_scope.Scope): | ||
| queryables: dict[str, Any] | ||
| def __init__( | ||
| self, | ||
| level: int, | ||
| global_dict=..., | ||
| local_dict=..., | ||
| queryables: dict[str, Any] | None = ..., | ||
| ) -> None: ... | ||
|
|
||
| class Term(ops.Term): | ||
| env = ... | ||
| def __new__(cls, name, env, side=..., encoding=...): ... | ||
| def __init__(self, name, env: PyTablesScope, side=..., encoding=...) -> None: ... | ||
| @property | ||
| def value(self): ... | ||
| @value.setter | ||
| def value(self, new_value) -> None: ... | ||
|
|
||
| class Constant(Term): | ||
| def __init__(self, name, env: PyTablesScope, side=..., encoding=...) -> None: ... | ||
|
|
||
| class BinOp(ops.BinOp): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is referred to only in classes that are not referred to. Can also be removed, I believe. |
||
| op: str | ||
| queryables: dict[str, Any] | ||
| encoding = ... | ||
| condition = ... | ||
| def __init__( | ||
| self, op: str, lhs, rhs, queryables: dict[str, Any], encoding | ||
| ) -> None: ... | ||
| def prune(self, klass): ... | ||
| def conform(self, rhs): ... | ||
| @property | ||
| def is_valid(self) -> bool: ... | ||
| @property | ||
| def is_in_table(self) -> bool: ... | ||
| @property | ||
| def kind(self): ... | ||
| @property | ||
| def meta(self): ... | ||
| @property | ||
| def metadata(self): ... | ||
| def generate(self, v) -> str: ... | ||
| def convert_value(self, v) -> TermValue: ... | ||
| def convert_values(self) -> None: ... | ||
|
|
||
| class FilterBinOp(BinOp): | ||
| filter: tuple[Any, Any, Index] | None = ... | ||
| def invert(self): ... | ||
| def format(self): ... | ||
| def generate_filter_op(self, invert: bool = ...): ... | ||
|
|
||
| class JointFilterBinOp(FilterBinOp): | ||
|
||
| def format(self) -> None: ... | ||
|
|
||
| class ConditionBinOp(BinOp): | ||
|
||
| def invert(self) -> None: ... | ||
| def format(self): ... | ||
| condition = ... | ||
|
|
||
| class JointConditionBinOp(ConditionBinOp): | ||
|
||
| condition = ... | ||
|
|
||
| class UnaryOp(ops.UnaryOp): | ||
| def prune(self, klass): ... | ||
| class UnaryOp(ops.UnaryOp): ... | ||
|
||
|
|
||
| class PyTablesExprVisitor(BaseExprVisitor): | ||
|
||
| const_type = ... | ||
| term_type = ... | ||
| def __init__(self, env, engine, parser, **kwargs: Any) -> None: ... | ||
| def visit_UnaryOp(self, node, **kwargs: Any): ... | ||
| def visit_Index(self, node, **kwargs: Any): ... | ||
| def visit_Assign(self, node, **kwargs: Any): ... | ||
| def visit_Subscript(self, node, **kwargs: Any): ... | ||
| def visit_Attribute(self, node, **kwargs: Any): ... | ||
| def translate_In(self, op): ... | ||
|
|
||
| class PyTablesExpr(expr.Expr): | ||
| encoding = ... | ||
|
|
@@ -93,16 +45,13 @@ class PyTablesExpr(expr.Expr): | |
| expr = ... | ||
| def __init__( | ||
| self, | ||
| where, | ||
| where: Any, | ||
| queryables: dict[str, Any] | None = ..., | ||
| encoding=..., | ||
| encoding: Any = ..., | ||
| scope_level: int = ..., | ||
| ) -> None: ... | ||
| def evaluate(self): ... | ||
|
|
||
| class TermValue: | ||
| value = ... | ||
| converted = ... | ||
| kind = ... | ||
| def __init__(self, value, converted, kind: str) -> None: ... | ||
| def tostring(self, encoding) -> str: ... | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can delete this file as well
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually |
Uh oh!
There was an error while loading. Please reload this page.