forked from M-Labs/artiq
Revert "compiler: Fix #1871 (array() breaks math functions)"
This reverts commit 8786b137a3
.
This commit is contained in:
parent
3bc5a0dfb7
commit
83af3b756d
@ -169,9 +169,7 @@ def fn_list():
|
|||||||
return types.TConstructor(TList())
|
return types.TConstructor(TList())
|
||||||
|
|
||||||
def fn_array():
|
def fn_array():
|
||||||
# numpy.array() is actually a "magic" macro that is expanded in-place, but
|
return types.TConstructor(TArray())
|
||||||
# just as for builtin functions, we do not want to quote it, etc.
|
|
||||||
return types.TBuiltinFunction("array")
|
|
||||||
|
|
||||||
def fn_Exception():
|
def fn_Exception():
|
||||||
return types.TExceptionConstructor(TException("Exception"))
|
return types.TExceptionConstructor(TException("Exception"))
|
||||||
|
@ -530,42 +530,3 @@ class NumpyBoolTest(ExperimentCase):
|
|||||||
def test_numpy_bool(self):
|
def test_numpy_bool(self):
|
||||||
"""Test NumPy bools decay to ARTIQ compiler builtin bools as expected"""
|
"""Test NumPy bools decay to ARTIQ compiler builtin bools as expected"""
|
||||||
self.create(_NumpyBool).run()
|
self.create(_NumpyBool).run()
|
||||||
|
|
||||||
|
|
||||||
class _Alignment(EnvExperiment):
|
|
||||||
def build(self):
|
|
||||||
self.setattr_device("core")
|
|
||||||
|
|
||||||
@rpc
|
|
||||||
def a_tuple(self) -> TList(TTuple([TBool, TFloat, TBool])):
|
|
||||||
return [(True, 1234.5678, True)]
|
|
||||||
|
|
||||||
@kernel
|
|
||||||
def run(self):
|
|
||||||
a, b, c = self.a_tuple()[0]
|
|
||||||
d, e, f = self.a_tuple()[0]
|
|
||||||
assert a == d
|
|
||||||
assert b == e
|
|
||||||
assert c == f
|
|
||||||
return 0
|
|
||||||
|
|
||||||
|
|
||||||
class AlignmentTest(ExperimentCase):
|
|
||||||
def test_tuple(self):
|
|
||||||
self.create(_Alignment).run()
|
|
||||||
|
|
||||||
|
|
||||||
class _NumpyQuoting(EnvExperiment):
|
|
||||||
def build(self):
|
|
||||||
self.setattr_device("core")
|
|
||||||
|
|
||||||
@kernel
|
|
||||||
def run(self):
|
|
||||||
a = np.array([10, 20])
|
|
||||||
b = np.sqrt(4.0)
|
|
||||||
|
|
||||||
|
|
||||||
class NumpyQuotingTest(ExperimentCase):
|
|
||||||
def test_issue_1871(self):
|
|
||||||
"""Ensure numpy.array() does not break NumPy math functions"""
|
|
||||||
self.create(_NumpyQuoting).run()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user