Skip to content

Commit

Permalink
chore: type errors and auto formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
justindujardin committed Nov 29, 2023
1 parent 5bfbd78 commit 5176815
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 11 deletions.
4 changes: 0 additions & 4 deletions mathy_core/expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ def clear_classes(self) -> None:
def visit_fn(
node: MathExpression, depth: int, data: Any
) -> Optional[VisitStop]:

node.classes = []
return None

Expand All @@ -153,7 +152,6 @@ def to_list(self, visit: str = "preorder") -> List["MathExpression"]:
def visit_fn(
node: MathExpression, depth: int, data: Any
) -> Optional[VisitStop]:

results.append(node)
return None

Expand All @@ -179,7 +177,6 @@ def find_type(self, instanceType: Type[NodeType]) -> List[NodeType]:
def visit_fn(
node: MathExpression, depth: int, data: Any
) -> Optional[VisitStop]:

if isinstance(node, instanceType):
results.append(node) # type:ignore
return None
Expand All @@ -197,7 +194,6 @@ def find_id(self, id: str) -> Optional["MathExpression"]:
def visit_fn(
node: MathExpression, depth: int, data: Any
) -> Optional[VisitStop]:

nonlocal result
if node.id == id:
result = node
Expand Down
1 change: 0 additions & 1 deletion mathy_core/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


class TidierExtreme:

left: Optional[BinaryTreeNode]
right: Optional[BinaryTreeNode]
thread: Optional[BinaryTreeNode]
Expand Down
2 changes: 1 addition & 1 deletion mathy_core/problems.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

class MathyTermTemplate(BaseModel):
variable: Optional[str] = Field(None, description="the term variable")
exponent: Optional[int] = Field(None, description="the term exponent")
exponent: Optional[int | float] = Field(None, description="the term exponent")

def make(self) -> str:
return mathy_term_string(
Expand Down
1 change: 0 additions & 1 deletion tests/test_problems.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@


def test_number_generation() -> None:

random.seed(1337)

# When using pretty number generation, all values
Expand Down
2 changes: 0 additions & 2 deletions tests/test_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@


def test_tokenizer_tokenize() -> None:

text = "4x + 2x^3 * 7!"
tokenizer = Tokenizer()
tokens: List[Token] = tokenizer.tokenize(text)
Expand All @@ -18,7 +17,6 @@ def test_tokenizer_tokenize() -> None:


def test_tokenizer_errors() -> None:

text = "4x + 2x^3 * 7\\"
tokenizer = Tokenizer()

Expand Down
1 change: 0 additions & 1 deletion tests/test_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def node_visit(node, depth, data):


def test_tree_node_is_leaf():

"""check that the known extremes of a tree are reported as leaf nodes
and that all other known non - extremes are not."""
tree = BinarySearchTree(0)
Expand Down
1 change: 0 additions & 1 deletion tests/test_tree_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def node_visit(node, depth, data):


def test_tree_node_is_leaf():

"""check that the known extremes of a tree are reported as leaf nodes
and that all other known non - extremes are not."""
tree = BinarySearchTree(0)
Expand Down

0 comments on commit 5176815

Please sign in to comment.