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

Generate API documentation #149

Closed
sverhoeven opened this issue Jun 28, 2023 · 3 comments · Fixed by #164
Closed

Generate API documentation #149

sverhoeven opened this issue Jun 28, 2023 · 3 comments · Fixed by #164
Assignees

Comments

@sverhoeven
Copy link
Collaborator

The code has lots of docstrings it would be nice to see them renderend somewhere like the mkdir api docs.

@Peter9192
Copy link
Collaborator

Peter9192 commented Jul 10, 2023

There's also examples in notebooks for each of the datasets. Might want to limit duplication as it's hard to maintain. Note these can also double as tests. https://github.com/phenology/springtime/tree/main/docs/notebooks

@Peter9192
Copy link
Collaborator

Peter9192 commented Jul 10, 2023

Mkdocstrings uses a python handler. There's a legacy handler based on pytkdocs and a newer handler based on griffe, where pydantic support is still on the todo list. There's been several issues relating to how we use our (typically pydantic) classes, e.g. related to inhering from parents, using class attributes/fields, etc. that have only partly been solved

mkdocstrings/griffe#170
mkdocstrings/pytkdocs#123
mkdocstrings/pytkdocs#9
mkdocstrings/python#40

Note that attributes documented in the class docstring are formatted much nicer than attributes documented inline:

image
versus
image

@Peter9192
Copy link
Collaborator

Peter9192 commented Jul 11, 2023

TODO:

  • Add example recipes (yaml) to docstrings
  • See if we can run examples somehow to include output in the API docs to replace notebooks
  • Refactor datasets to adhere to current docs grouping (field obs, satellites, meteo).

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 a pull request may close this issue.

2 participants