eriknw / afar

Run code on a Dask cluster via a context manager or IPython magic
Other
30 stars 0 forks source link

Add `%afar` IPython magic! #22

Closed eriknw closed 3 years ago

eriknw commented 3 years ago

Closes #16

The options let you specify variable names for a Run object, data dict, Where object, and Client object, but I don't think these will be used that often. Oh, it also lets you specify variable names just like in with afar.run('x', 'y'), remotely:.

The main thing that this doesn't let you do that might be useful is specifying values for data or the keyword arguments passed to client.submit. For example, you can't do this: %afar --data={'x': 7} x + 1. To pass keyword arguments to client.submit, one needs to do this:

In [1]: on_gpus = afar.remotely(resources={"GPU": 1})
In [2]: %%afar --where on_gpus
   ...: x = 1
   ...: y = x + 1
eriknw commented 3 years ago

YOLO. Merging and releasing 🚀