Re:Fluent Interfaces Are Bad for Maintainability
by wenc on Tuesday March 20, 2018 @01:03PM
(#16630419)
I'm not sure if you are aware, but there are several efforts out there to give Python a more data-pipeline-friendly (composable pipe) syntax:
1) Coconut: http://coconut-lang.org/
2) https://github.com/JulienPalard/Pipe
3) Pandas also has a new dataframe pipe method. https://pandas.pydata.org/pandas-docs/stable/generated/panda...
I would look at those before rolling out a custom solution.
`data | groupby, "author" | mean`
Would create a graph object, which could be lazily evaluated, run in Dask, TF, etc.
It started to get ugly when passing in multiple parameters into a function. I had to watch out for left and right associativity, and manage casting of arguments.
It was a fun little experiment but I'm not sure how much it would actually improve workflows. If that sounds interesting, let me know and I'll poke at it again.