Skip to content

Commit

Permalink
chore: update readme with docs.sh
Browse files Browse the repository at this point in the history
 - IDK I guess I stopped auto-running this at some point?
  • Loading branch information
justindujardin committed Nov 30, 2023
1 parent f49ebee commit 7eea161
Showing 1 changed file with 30 additions and 26 deletions.
56 changes: 30 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,7 @@ Return the root element of this tree
### get_root_side <kbd>method</kbd>

```python (doc)
BinaryTreeNode.get_root_side(
self: 'BinaryTreeNode',
) -> typing_extensions.Literal['left', 'right']
BinaryTreeNode.get_root_side(self: 'BinaryTreeNode') -> Literal['left', 'right']
```

Return the side of the tree that this node lives on
Expand All @@ -386,7 +384,7 @@ has no sibling, the return value will be None.
BinaryTreeNode.get_side(
self,
child: Optional[BinaryTreeNode],
) -> typing_extensions.Literal['left', 'right']
) -> Literal['left', 'right']
```

Determine whether the given `child` is the left or right child of this
Expand Down Expand Up @@ -439,7 +437,7 @@ Set the right node to the passed `child`
BinaryTreeNode.set_side(
self,
child: ~NodeType,
side: typing_extensions.Literal['left', 'right'],
side: Literal['left', 'right'],
) -> ~NodeType
```

Expand All @@ -450,10 +448,10 @@ Set a new `child` on the given `side`
```python (doc)
BinaryTreeNode.visit_inorder(
self,
visit_fn: Callable[[Any, int, Optional[Any]], Optional[typing_extensions.Literal['stop']]],
visit_fn: Callable[[Any, int, Optional[Any]], Optional[Literal['stop']]],
depth: int = 0,
data: Optional[Any] = None,
) -> Optional[typing_extensions.Literal['stop']]
) -> Optional[Literal['stop']]
```

Visit the tree inorder, which visits the left child, then the current node,
Expand All @@ -474,10 +472,10 @@ visited, the current depth in the tree, and a user specified data parameter.
```python (doc)
BinaryTreeNode.visit_postorder(
self,
visit_fn: Callable[[Any, int, Optional[Any]], Optional[typing_extensions.Literal['stop']]],
visit_fn: Callable[[Any, int, Optional[Any]], Optional[Literal['stop']]],
depth: int = 0,
data: Optional[Any] = None,
) -> Optional[typing_extensions.Literal['stop']]
) -> Optional[Literal['stop']]
```

Visit the tree postorder, which visits its left child, then its right child,
Expand All @@ -498,10 +496,10 @@ visited, the current depth in the tree, and a user specified data parameter.
```python (doc)
BinaryTreeNode.visit_preorder(
self,
visit_fn: Callable[[Any, int, Optional[Any]], Optional[typing_extensions.Literal['stop']]],
visit_fn: Callable[[Any, int, Optional[Any]], Optional[Literal['stop']]],
depth: int = 0,
data: Optional[Any] = None,
) -> Optional[typing_extensions.Literal['stop']]
) -> Optional[Literal['stop']]
```

Visit the tree preorder, which visits the current node, then its left
Expand All @@ -517,10 +515,6 @@ visited, the current depth in the tree, and a user specified data parameter.

Traversals may be canceled by returning `STOP` from any visit function.

## NodeType

Template type that inherits from BinaryTreeNode.

## VisitDataType

Template type of user data passed to visit functions.
Expand Down Expand Up @@ -585,7 +579,7 @@ Render this node as a MathML element fragment
## ConstantExpression <kbd>class</kbd>

```python (doc)
ConstantExpression(self, value: Optional[int, float] = None)
ConstantExpression(self, value: Optional[float, int] = None)
```

A Constant value node, where the value is accessible as `node.value`
Expand Down Expand Up @@ -743,7 +737,7 @@ Color to use for this node when rendering it as changed with
```python (doc)
MathExpression.evaluate(
self,
context: Union[Dict[str, Optional[float, int]]] = None,
context: Optional[Dict[str, Union[float, int]]] = None,
) -> Union[float, int]
```

Expand All @@ -752,10 +746,7 @@ Evaluate the expression, resolving all variables to constant values
### find_id <kbd>method</kbd>

```python (doc)
MathExpression.find_id(
self,
id: str,
) -> Optional[MathExpression]
MathExpression.find_id(self, id: str) -> Optional[MathExpression]
```

Find an expression by its unique ID.
Expand Down Expand Up @@ -1264,15 +1255,16 @@ Returns a TreeMeasurement object that describes the bounds of the tree
```python (doc)
TreeLayout.transform(
self,
node: mathy_core.tree.BinaryTreeNode = None,
node: Optional[mathy_core.tree.BinaryTreeNode] = None,
x: float = 0,
unit_x_multiplier: float = 1,
unit_y_multiplier: float = 1,
measure: Optional[TreeMeasurement] = None,
) -> 'TreeMeasurement'
```

Transform relative to absolute coordinates, and measure the bounds of the tree.
Transform relative to absolute coordinates, and measure the bounds of
the tree.

Return a measurement of the tree in output units.

Expand Down Expand Up @@ -1393,7 +1385,7 @@ The challenge is to commute the terms to each other in one move.
^-----------^
```

`mathy:4y + 12j + 73q + 19k + 13z + 24x + 56l + 12x + 43n + 17j`
`mathy:4y + 12j + 73q + 19k + 13z + 24x + 56l + 12x + 43n + 17j`

## gen_move_around_blockers_one <kbd>function</kbd>

Expand Down Expand Up @@ -1439,7 +1431,7 @@ Two like terms with three blockers.
gen_simplify_multiple_terms(
num_terms: int,
optional_var: bool = False,
op: Union[List[str], str] = None,
op: Optional[List[str], str] = None,
common_variables: bool = True,
inner_terms_scaling: float = 0.3,
powers_probability: float = 0.33,
Expand All @@ -1448,7 +1440,7 @@ gen_simplify_multiple_terms(
shuffle_probability: float = 0.66,
share_var_probability: float = 0.5,
grouping_noise_probability: float = 0.66,
noise_terms: int = None,
noise_terms: Optional[int] = None,
) -> Tuple[str, int]
```

Expand Down Expand Up @@ -1488,6 +1480,18 @@ get_rand_vars(

Get a list of random variables, excluding the given list of hold-out variables

## MathyTermTemplate <kbd>dataclass</kbd>

```python (doc)
MathyTermTemplate(
self,
variable: Optional[str] = None,
exponent: Optional[float, int] = None,
) -> None
```

MathyTermTemplate(variable: Optional[str] = None, exponent: Union[float, int, NoneType] = None)

## split_in_two_random <kbd>function</kbd>

```python (doc)
Expand Down

0 comments on commit 7eea161

Please sign in to comment.