covalent
covalent copied to clipboard
Meaningful errors for non-lattice dispatches.
Consider this code
@ct.electron
def new_func(a, b, c, d, e):
time.sleep(10)
return a + b + c + d + e
@ct.electron
@ct.lattice
def work_func(a, b, c):
return new_func(a, b, c, d=4, e=5)
dispatch_id = ct.dispatch(work_func)(5, 6, 7)
print(dispatch_id)
Running this will produce an error like this
Traceback (most recent call last):
File "example_db.py", line 246, in <module>
dispatch_id = ct.dispatch(lattice)(*args)
File "/Users/scott/covalent/covalent/_dispatcher_plugins/local.py", line 83, in wrapper
lattice.build_graph(*args, **kwargs)
AttributeError: 'function' object has no attribute 'build_graph'
I expect this is because I'm trying to dispatch a sublattice. If that's the case, we should have a check in the code that raises an informative error so users don't see the AttributeError.
Loosely related to #760
Originally posted by @scottwn in https://github.com/AgnostiqHQ/covalent/discussions/788
Hi, I would like to on this one, you think. Can I give it a try?
Go for it @gcamach0! thanks!
Thanks for reaching out @gcamach0 ! I have assigned this issue to you. Let me know if you have any questions and I will do my best to answer :)
Thanks I'll let you know any updates
@wjcunningham7 can you assign this issue to me?