expr-codegen 0.10.1__tar.gz → 0.10.2__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.
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/PKG-INFO +1 -1
- expr_codegen-0.10.2/expr_codegen/_version.py +1 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/codes.py +3 -1
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/expr.py +4 -1
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/tool.py +4 -3
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen.egg-info/PKG-INFO +1 -1
- expr_codegen-0.10.1/expr_codegen/_version.py +0 -1
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/LICENSE +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/README.md +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/__init__.py +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/dag.py +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/latex/__init__.py +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/latex/printer.py +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/model.py +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/pandas/__init__.py +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/pandas/code.py +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/pandas/helper.py +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/pandas/printer.py +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/pandas/ta.py +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/pandas/template.py.j2 +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/polars_group/__init__.py +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/polars_group/code.py +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/polars_group/printer.py +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/polars_group/template.py.j2 +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/polars_over/__init__.py +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/polars_over/code.py +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/polars_over/printer.py +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen/polars_over/template.py.j2 +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen.egg-info/SOURCES.txt +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen.egg-info/dependency_links.txt +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen.egg-info/requires.txt +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/expr_codegen.egg-info/top_level.txt +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/pyproject.toml +0 -0
- {expr_codegen-0.10.1 → expr_codegen-0.10.2}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.10.2"
|
|
@@ -2,7 +2,7 @@ import ast
|
|
|
2
2
|
import re
|
|
3
3
|
from ast import expr
|
|
4
4
|
|
|
5
|
-
from sympy import Add, Mul, Pow, Eq
|
|
5
|
+
from sympy import Add, Mul, Pow, Eq, Not, Xor
|
|
6
6
|
|
|
7
7
|
from expr_codegen.expr import register_symbols, dict_to_exprs
|
|
8
8
|
|
|
@@ -372,6 +372,8 @@ def _add_default_type(globals_):
|
|
|
372
372
|
globals_['Mul'] = Mul
|
|
373
373
|
globals_['Pow'] = Pow
|
|
374
374
|
globals_['Eq'] = Eq
|
|
375
|
+
globals_['Not'] = Not
|
|
376
|
+
globals_['Xor'] = Xor
|
|
375
377
|
return globals_
|
|
376
378
|
|
|
377
379
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from functools import reduce
|
|
2
2
|
|
|
3
|
-
from sympy import Mul, preorder_traversal, symbols, Function, simplify, Add, Basic, Symbol, sympify
|
|
3
|
+
from sympy import Mul, preorder_traversal, symbols, Function, simplify, Add, Basic, Symbol, sympify, FunctionClass
|
|
4
4
|
|
|
5
5
|
# 预定义前缀,算子用前缀进行区分更方便。
|
|
6
6
|
# 当然也可以用是否在某容器中进行分类
|
|
@@ -23,6 +23,9 @@ def is_symbol(x, globals_):
|
|
|
23
23
|
if type(s) is type:
|
|
24
24
|
# Eq
|
|
25
25
|
return issubclass(s, Basic)
|
|
26
|
+
if isinstance(s, FunctionClass):
|
|
27
|
+
# Not
|
|
28
|
+
return True
|
|
26
29
|
return False
|
|
27
30
|
|
|
28
31
|
|
|
@@ -127,11 +127,12 @@ class ExprTool:
|
|
|
127
127
|
|
|
128
128
|
exprs_dict = {}
|
|
129
129
|
|
|
130
|
-
#
|
|
130
|
+
# cse前简化一次,cse后不再简化
|
|
131
|
+
# (~开盘涨停 & 昨收涨停) | (~收盘涨停 & 最高涨停)
|
|
131
132
|
for variable, expr in repl:
|
|
132
|
-
exprs_dict[variable] =
|
|
133
|
+
exprs_dict[variable] = expr
|
|
133
134
|
for variable, expr in redu:
|
|
134
|
-
exprs_dict[variable] =
|
|
135
|
+
exprs_dict[variable] = expr
|
|
135
136
|
|
|
136
137
|
return exprs_dict
|
|
137
138
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.10.1"
|
|
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
|