Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python] Convert docstrings to Google style #151

Merged
merged 2 commits into from
Mar 6, 2023
Merged

Conversation

thetorpedodog
Copy link
Contributor

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 single-cell-data/TileDB-SOMA#974.

This also expands the docstrings for Experiment and Measurement.
@bkmartinjr
Copy link
Member

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

@thetorpedodog
Copy link
Contributor Author

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
Copy link
Member

bkmartinjr commented Mar 6, 2023

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 johnkerl changed the title Convert docstrings to Google style. [python] Convert docstrings to Google style Mar 6, 2023
@johnkerl
Copy link
Member

johnkerl commented Mar 6, 2023

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

@thetorpedodog thetorpedodog merged commit b1c7463 into main Mar 6, 2023
@thetorpedodog thetorpedodog deleted the great-googly-moogly branch March 6, 2023 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants