Dask: Idea: Alias `.compute()` to e.g. `.c`

Created on 25 Feb 2020  路  3Comments  路  Source: dask/dask

When prototyping code in a Jupyter notebook, I'm often finding myself using .compute() to check output.

Inspired by numpy transpose which uses the attribute .T for .transpose(), is it worth adding such an attribute for .compute()?

Of course to stay Pythonic I wouldn't want this to confuse matters. .c seems like a possible attribute (I realise if _A_ is a matrix than _A^T_ is the mathematical notation for _A_ transpose, but I don't think there is a meaning for the mathematical notation _A^c_?)

Most helpful comment

@asmith26 I appreciate the thoughts here but I'm inclined not to add an alias -- at least not at the moment. As you say .T is an alias due to historic mathematical notation and while I can see writing .compute many many times would be annoying, I think it's good to be explicit in dask about compute. Others may disagree. Again, thank you for taking the time to write up your thoughts

All 3 comments

@asmith26 I appreciate the thoughts here but I'm inclined not to add an alias -- at least not at the moment. As you say .T is an alias due to historic mathematical notation and while I can see writing .compute many many times would be annoying, I think it's good to be explicit in dask about compute. Others may disagree. Again, thank you for taking the time to write up your thoughts

Thanks @asmith26 for raising this discussion point and your reasoning behind the proposal! I agree with @quasiben that explicit is better in this case though

Thanks for the feedback. I understand the explanations for not doing this for now, hence closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hoangthienan95 picture hoangthienan95  路  6Comments

rmancy-smg picture rmancy-smg  路  4Comments

JackKelly picture JackKelly  路  5Comments

mrocklin picture mrocklin  路  4Comments

curiouscod3 picture curiouscod3  路  5Comments