mathai 0.6.9__py3-none-any.whl → 0.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
mathai/base.py CHANGED
@@ -370,21 +370,23 @@ def product(lst):
370
370
  for item in lst[1:]:
371
371
  s *= item
372
372
  return s
373
- def flatten_tree(node, add=[]):
373
+ def flatten_tree(node):
374
+ if node is None:
375
+ return None
374
376
  if not node.children:
375
377
  return node
376
378
  ad = []
377
379
  if node.name in ["f_add", "f_mul", "f_and", "f_or", "f_wmul"]:
378
380
  merged_children = []
379
381
  for child in node.children:
380
- flattened_child = flatten_tree(child, add)
382
+ flattened_child = flatten_tree(child)
381
383
  if flattened_child.name == node.name:
382
384
  merged_children.extend(flattened_child.children)
383
385
  else:
384
386
  merged_children.append(flattened_child)
385
387
  return TreeNode(node.name, merged_children)
386
388
  else:
387
- node.children = [flatten_tree(child, add) for child in node.children]
389
+ node.children = [flatten_tree(child) for child in node.children]
388
390
  return node
389
391
  def dowhile(eq, fx):
390
392
  if eq is None:
mathai/matrix.py CHANGED
@@ -215,7 +215,7 @@ def fold_wmul(root):
215
215
  return newnode[root]
216
216
 
217
217
  def flat(eq):
218
- return flatten_tree(eq, ["f_wmul"])
218
+ return flatten_tree(eq)
219
219
  def use(eq):
220
220
  return TreeNode(eq.name, [use(child) for child in eq.children])
221
221
  def _matrix_solve(eq):
mathai/parser.py CHANGED
@@ -154,7 +154,7 @@ def parse(equation, funclist=None):
154
154
  return tree_node
155
155
 
156
156
  tree_node = rfx(tree_node)
157
- tree_node = flatten_tree(tree_node, ["f_wmul"])
157
+ tree_node = flatten_tree(tree_node)
158
158
  if TreeNode.matmul == True:
159
159
  TreeNode.matmul = False
160
160
  tree_node = use(tree_form(str_form(tree_node).replace("f_w","f_")))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mathai
3
- Version: 0.6.9
3
+ Version: 0.7.0
4
4
  Summary: Mathematics solving Ai tailored to NCERT
5
5
  Home-page: https://github.com/infinity390/mathai4
6
6
  Author: educated indians are having a low iq and are good for nothing
@@ -1,6 +1,6 @@
1
1
  mathai/__init__.py,sha256=Mv0vNdV-FHKS6MzAsnHsE0eBtSkCUq0nc9tUgCWxbFo,1541
2
2
  mathai/apart.py,sha256=VSS3khE9PNuxiRvdU5JDl4IN-KJBSIFjwR17pkhviXI,4197
3
- mathai/base.py,sha256=mk5LTVcgOpd-Zh0VBGQmZQOBlH5G3XFQI_TzwXYaRss,15794
3
+ mathai/base.py,sha256=hRiJWS94asWl-t11eGrVCEhZqIub0T-8S_Eqmlun6mI,15819
4
4
  mathai/bivariate_inequality.py,sha256=Da-A1kqVynR0tNOlEI7GSTf5T2vNkcF4etL9-EoyPJg,11415
5
5
  mathai/console.py,sha256=Sn58iwYE79MLEh67s8X3q6vZjw6g7f9XM1T8_dBBR2o,3048
6
6
  mathai/diff.py,sha256=RSTwlfeddvYXUDShCeRdcPjsmAS8Vf5OkYJAaUBPaiM,3060
@@ -12,9 +12,9 @@ mathai/inverse.py,sha256=ya7P8WjzfaAL3UXL7xqOh5GaIsXLDZ-F6lZFy3IEgaQ,2931
12
12
  mathai/limit.py,sha256=9F8i9UZh2xb-V8A5Sd1gdhDf9c2RFgpE1GdNn9MvbWI,5703
13
13
  mathai/linear.py,sha256=viGlPU8BPrjLWHlyNUvnfPHNH5d4ZBImiQMdyXaKGg0,5702
14
14
  mathai/logic.py,sha256=Ndz4Fd6aNCmzFlqoPyyIpSmV_BXmYHsurePjLyZJoNc,9809
15
- mathai/matrix.py,sha256=Owv7Xbn2emrSWqrvaqSHeWX5xPuQF5tkZICCuTbQAyQ,7288
15
+ mathai/matrix.py,sha256=sIusSmZN0Y6k4TovI5L6Hepls9i7FPRjA3CZIU4X4_w,7276
16
16
  mathai/ode.py,sha256=zxxTXAOpt7oSsfpgI4vHsCWKXevmM96ZOBZWWs-vj8Y,4801
17
- mathai/parser.py,sha256=nEAdSSJeapBOhvjbkXJFtCEBU8izajXZAITV8rbslic,7314
17
+ mathai/parser.py,sha256=3cBl7DhqL275gqXszET5zC85O9v3XKxRPc2EaOigAns,7302
18
18
  mathai/parsetab.py,sha256=TL-4jvRM_Tx6ipwet8CFJc2DkjR4tGsbrGF_r4IC8xI,9651
19
19
  mathai/printeq.py,sha256=4UgLJo-vV_YlVw_3QUQY_jQMHrFnG-ZKAyVZsd7yD6o,1450
20
20
  mathai/simplify.py,sha256=VsUw89U3FqSpD3mMUGM0pr0dZ__MDQOBD8maaB7MDBY,19973
@@ -22,7 +22,7 @@ mathai/structure.py,sha256=wrU7kqphSN7CqaVffyHHXD2-3t5My_Z_TtYFoUe_lTU,4099
22
22
  mathai/tool.py,sha256=ozcXTXLbKUnyPM9r9kz9M43YA2CBcWezcqLZfEs8rpc,6051
23
23
  mathai/trig.py,sha256=fnBbfiopcQzFg4ya1BoO5M0X_aCBnse2bjnKh1juw4I,11223
24
24
  mathai/univariate_inequality.py,sha256=LPFdWgC1y5zBwnsy1wwZxj-yP_SbqFDhCmTTzhuwoiY,16469
25
- mathai-0.6.9.dist-info/METADATA,sha256=6Q_imbUXwELM1E1VZap8NoO2fm9SFAhalIoi0nWsULg,7103
26
- mathai-0.6.9.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
27
- mathai-0.6.9.dist-info/top_level.txt,sha256=ROP4l3OhGYw3ihkQGASr18xM9GsK4z3_6whV5AyXLwE,7
28
- mathai-0.6.9.dist-info/RECORD,,
25
+ mathai-0.7.0.dist-info/METADATA,sha256=GrlB2OU2Qg4SXWpTvXeUaW9jobvWSlXyj66iSMkBr8Q,7103
26
+ mathai-0.7.0.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
27
+ mathai-0.7.0.dist-info/top_level.txt,sha256=ROP4l3OhGYw3ihkQGASr18xM9GsK4z3_6whV5AyXLwE,7
28
+ mathai-0.7.0.dist-info/RECORD,,
File without changes