single-cell-data / SOMA

A flexible and extensible API for annotated 2D matrix data stored in multiple underlying formats.
MIT License
69 stars 9 forks source link

[python] Enable chaining on certain write methods #123

Closed thetorpedodog closed 1 year ago

thetorpedodog commented 1 year ago

Returns self from a few methods to enable chaining:

This enables useful chaining:

some_coll.set('x', ...).set('y', ...)

my_df = DataFrame.create(...).write(...)
do_stuff_with(my_df)

I remember this being something we discussed a while back that got lost in other things, so here it is back again.