mathai 0.6.9__tar.gz → 0.7.0__tar.gz
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-0.6.9 → mathai-0.7.0}/PKG-INFO +1 -1
- {mathai-0.6.9 → mathai-0.7.0}/mathai/base.py +5 -3
- {mathai-0.6.9 → mathai-0.7.0}/mathai/matrix.py +1 -1
- {mathai-0.6.9 → mathai-0.7.0}/mathai/parser.py +1 -1
- {mathai-0.6.9 → mathai-0.7.0}/mathai.egg-info/PKG-INFO +1 -1
- {mathai-0.6.9 → mathai-0.7.0}/setup.py +1 -1
- {mathai-0.6.9 → mathai-0.7.0}/README.md +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/__init__.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/apart.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/bivariate_inequality.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/console.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/diff.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/expand.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/factor.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/fraction.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/integrate.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/inverse.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/limit.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/linear.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/logic.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/ode.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/parsetab.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/printeq.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/simplify.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/structure.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/tool.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/trig.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai/univariate_inequality.py +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai.egg-info/SOURCES.txt +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai.egg-info/dependency_links.txt +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai.egg-info/requires.txt +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/mathai.egg-info/top_level.txt +0 -0
- {mathai-0.6.9 → mathai-0.7.0}/setup.cfg +0 -0
|
@@ -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
|
|
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
|
|
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
|
|
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:
|
|
@@ -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
|
|
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_")))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|