You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importcspfromcspimporttsfromdatetimeimportdatetime, timedeltafromtypingimportCallable, Optional, Listcsp.set_print_full_exception_stack(True)
@csp.nodedefmy_node_callable(
x: ts[int],
my_data: Callable[[int], int] =None
)->ts[int]:
ifcsp.ticked(x):
ifmy_data:
returnmy_data(x) ifcallable(my_data) else12# This should fail but it does notres=csp.run(
my_node_callable,
x=csp.const(10),
my_data=None,
starttime=datetime.utcnow(),
endtime=timedelta(1)
)
@csp.nodedefmy_node_callable2(
x: ts[int],
my_data: Callable=None
)->ts[int]:
ifcsp.ticked(x):
ifmy_data:
returnmy_data(x) ifcallable(my_data) else12# This should fail but it does notres=csp.run(
my_node_callable2,
x=csp.const(10),
my_data=None,
starttime=datetime.utcnow(),
endtime=timedelta(1)
)
# This should not fail but it doesres=csp.run(
my_node_callable2,
x=csp.const(10),
my_data=lambdax: 2*x,
starttime=datetime.utcnow(),
endtime=timedelta(1)
)
NeejWeej
added a commit
to NeejWeej/csp
that referenced
this issue
Jan 9, 2025
Describe the bug
Having an
Optional[List[]]
in acsp.node
or graph causes an argument mismatch if a non-null value is supplied.To Reproduce
Expected behavior
No arg mismatch error
Error Message
Runtime Environment
Output from
import sys, csp; print(csp.__version__); print(sys.version); print(sys.platform)
.The text was updated successfully, but these errors were encountered: