Skip to content

Commit

Permalink
Rename ArrayExpr => VectorExpr
Browse files Browse the repository at this point in the history
  • Loading branch information
krinart committed Jan 29, 2019
1 parent 95e32c6 commit c63d502
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion m2cgen/interpreters/java/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def interpret(self, expr):
(self.model_name, top_cg.code),
]

def interpret_array_expr(self, expr, **kwargs):
def interpret_vector_expr(self, expr, **kwargs):
nested = []
for e in expr.exprs:
nested.append(self._do_interpret(e, **kwargs))
Expand Down
2 changes: 1 addition & 1 deletion tests/assemblers/test_linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_multi_class():
assembler = assemblers.LinearModelAssembler(estimator)
actual = assembler.assemble()

expected = ast.ArrayExpr([
expected = ast.VectorExpr([
ast.SubroutineExpr(
ast.BinNumExpr(
ast.BinNumExpr(
Expand Down
6 changes: 3 additions & 3 deletions tests/assemblers/test_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,18 @@ def test_multi_class():
ast.FeatureRef(0),
ast.NumVal(1.5),
ast.CompOpType.LTE),
ast.ArrayExpr([
ast.VectorExpr([
ast.NumVal(0.0),
ast.NumVal(1.0)]),
ast.IfExpr(
ast.CompExpr(
ast.FeatureRef(0),
ast.NumVal(2.5),
ast.CompOpType.LTE),
ast.ArrayExpr([
ast.VectorExpr([
ast.NumVal(1.0),
ast.NumVal(0.0)]),
ast.ArrayExpr([
ast.VectorExpr([
ast.NumVal(0.0),
ast.NumVal(1.0)])))

Expand Down
4 changes: 2 additions & 2 deletions tests/interpreters/test_java.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ def test_multi_output():
ast.NumVal(1),
ast.NumVal(1),
ast.CompOpType.EQ),
ast.ArrayExpr([ast.NumVal(1), ast.NumVal(2)]),
ast.ArrayExpr([ast.NumVal(3), ast.NumVal(4)])))
ast.VectorExpr([ast.NumVal(1), ast.NumVal(2)]),
ast.VectorExpr([ast.NumVal(3), ast.NumVal(4)])))

expected_code = """
public class Model {
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def cmp_exprs(left, right):
"""Recursively compares two ast expressions."""

if isinstance(left, ast.ArrayExpr) and isinstance(right, ast.Expr):
if isinstance(left, ast.VectorExpr) and isinstance(right, ast.Expr):
left_exprs = left.exprs
right_exprs = right.exprs
assert len(left_exprs) == len(right_exprs)
Expand Down

0 comments on commit c63d502

Please sign in to comment.