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] Convert docstrings to Google style #151

Closed thetorpedodog closed 1 year ago

thetorpedodog commented 1 year ago

This also expands the docstrings for Experiment and Measurement.


In this change, I also changed the format of maturity levels to make them look like just another docs stanza. If we don’t like it, it can be reverted to the [lifecycle: whatever] style.

Part of https://github.com/single-cell-data/TileDB-SOMA/issues/974.

bkmartinjr commented 1 year ago

Question: is the [lifecycle: whatever] supposed to be machine parsable? I.e., does the format matter, or just the human-readable content?

thetorpedodog commented 1 year ago

With the disclaimer that this is just my opinion: I expect it to be only human-readable. If we want to have a machine-parseable version of the lifecycle (which seems like a niche use case), I would have it in a function attribute (maybe set .soma_lifecycle in a decorator) rather than the docstring, something like:

from . import lifecycle

@lifecycle.experimental
def some_func(...):
  ...

some_func.soma_lifecycle
# -> experimental
bkmartinjr commented 1 year ago

I expect it to be only human-readable.

Given this, I also prefer your proposed style (i.e., a new stanza), placed at the end of the docstring. We should update both packages if we go this route.

johnkerl commented 1 year ago

I completely agree re human-readable, and that if we want programmatic access we could do a soma_lifecycle() or somesuch,