Skip to content

python: improve documentation #254

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

Merged
merged 11 commits into from
Feb 28, 2025
Merged

python: improve documentation #254

merged 11 commits into from
Feb 28, 2025

Conversation

bryfox
Copy link
Contributor

@bryfox bryfox commented Feb 28, 2025

This improves the python documentation & example; notably:

  • Enum variants are documented (also in the stubs; IDEs will pick this up)
  • ParameterValue nested classes are documented
  • Added param types to docstrings
  • All additional examples have been added to the docs
  • The last remaining example was moved from sdk into sdk-examples

For the first two items, I resorted to manual documentation for the reasons noted in index.rst. This is unfortunate, and I think we're going to need to look into some sort of doc testing down the line, but it's better than missing documentation today.

@bryfox bryfox requested review from gasmith, eloff and mguida22 February 28, 2025 00:49

.. py:class:: Bytes(value: bytes)

A byte array
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this match the description In _foglove_py/__init__.pyi?

Suggested change
A byte array
A byte array, encoded as a base64-encoded string.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. It's the other way around; the python implementation does the encoding for you. I've updated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, in that case I think this is just missing a period.


.. py:class:: Bytes(value: bytes)

A byte array
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, in that case I think this is just missing a period.

Copy link
Contributor

@gasmith gasmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG

Comment on lines 190 to 192
:param host: The host to bind to.
:type host: Optional[str]
:param port: The port to bind to.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add the default values here.

@bryfox bryfox merged commit 0847f2d into main Feb 28, 2025
36 checks passed
@bryfox bryfox deleted the bryan/improve-docs branch February 28, 2025 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants