Skip to content

Commit

Permalink
BREAKING CHANGE: Solution.print() and tabulate() have been removed
Browse files Browse the repository at this point in the history
  • Loading branch information
CallumJHays committed Oct 6, 2022
1 parent a3877d7 commit d9e0bbd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 33 deletions.
20 changes: 0 additions & 20 deletions mathpad/display.py

This file was deleted.

13 changes: 2 additions & 11 deletions mathpad/solve.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from typing import Collection, Dict, Set, Tuple, Union, overload
from ansitable import ANSITable
from typing import Collection, Dict, Union, overload
import sympy

from mathpad.val import Val, ValT
Expand All @@ -13,7 +12,7 @@ def __init__(self, result_dict: Dict[Val, Val]):
def __getitem__(self, k: ValT) -> ValT:
result = self.result_dict[k]
assert result.units == k.units
return result
return result # type: ignore

def __repr__(self):
return self._repr("", " ")
Expand All @@ -28,14 +27,6 @@ def _repr(self, newline: str, indent: str):
+ f"{newline}{' ' if not newline else ''})"
)

def print(self):
table = ANSITable(
" unknown ", " solutions ", border="thick", bordercolor="green"
)
for k, v in self.result_dict.items():
table.row(k, v)
table.print()


@overload
def solve(equations: Equation, solve_for: Val, in_place: bool = False) -> Solution:
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ typing-extensions = "^4.0.0"
numpy = "^1.20"
sympy = "^1.8"
tqdm = "^4.62.3"
ansitable = "^0.9.6"
scipy = "^1.7.1"
plotly = "^5.3.1"
kaleido = "0.2.1"


[tool.poetry.extras]
# kaleido doesn't work on jupyterlite yet
static_plots = ["kaleido==0.2.1"]


[build-system]
Expand Down

0 comments on commit d9e0bbd

Please sign in to comment.