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 reference docs are almost empty #1439

Closed
2 tasks done
visr opened this issue Apr 29, 2024 · 6 comments
Closed
2 tasks done

Python reference docs are almost empty #1439

visr opened this issue Apr 29, 2024 · 6 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@visr
Copy link
Member

visr commented Apr 29, 2024

https://deltares.github.io/Ribasim/reference/python/
Could be due to changes in https://github.com/machow/quartodoc

Possibly related to #219

Edit: I think it is working fine, but we just don't have many docstrings anymore. And currently methods that have docstrings don't seems to get included, so we should look into that. Perhaps best done after #1298.

  • Fix bug in docstrings
  • add info to pages (focus on most important items:
@visr visr added documentation Improvements or additions to documentation bug labels Apr 29, 2024
@github-project-automation github-project-automation bot moved this to To do in Ribasim Apr 29, 2024
@visr visr removed the bug label Apr 29, 2024
@visr visr changed the title Python reference docs are empty Python reference docs are almost empty Apr 30, 2024
@SnippenE SnippenE moved this from To do to What's next in Ribasim May 2, 2024
@SnippenE SnippenE moved this from What's next to Sprint backlog in Ribasim May 30, 2024
visr added a commit that referenced this issue Jun 13, 2024
In the recent doc restructuring these pages were no longer included.
Related to #1439, but does not fix that issue.
@Jingru923 Jingru923 self-assigned this Jun 14, 2024
@Jingru923
Copy link
Contributor

I added some docstring under Model() class, and quartodoc can show those docstring now, the bug is no longer there.

@Jingru923 Jingru923 moved this from Sprint backlog to 🏗 In progress in Ribasim Jun 19, 2024
@Jingru923 Jingru923 moved this from 🏗 In progress to 👀 In review in Ribasim Jun 19, 2024
@Jingru923
Copy link
Contributor

When I was working on this issue, I hope that quardoc can collect all the self-defined functions in Model class and show it in API.

I tried include_functions option in content, it does nothing. This turns out to be impossible.

My current conclusion is that we need to list all the functions manually, and later if new functions are added, keep in mind to also add them to API page. I think we can generate a list of functions in python, and copy paste that list to quartodoc in _quarto.yml. I couldn't succeed it yet but I believe we can investigate that

@evetion
Copy link
Member

evetion commented Jun 19, 2024

It might be good to link to an open issue on quartodoc about this, and link to the configuration page, where you got the include_functions from.

@evetion
Copy link
Member

evetion commented Jun 19, 2024

FWIW, after checking the documentation, and this issue, we could do this:

quartodoc:
  style: pkgdown
  dir: python/reference
  title: API Reference
  package: ribasim
  options:
      include_inherited: true
      include_empty: true
      include_attributes: true
      include_classes: true
      include_functions: true
  sections:
    - title: ribasim
      contents:
        - name: ribasim
          package: null
          include_imports: true

The options will make sure to render everything (classes/attributes/etc), while the ribasim section would render everything we export.

@SnippenE SnippenE moved this from 👀 In review to 🏗 In progress in Ribasim Jun 20, 2024
@Jingru923
Copy link
Contributor

Thanks for the input @evetion

What you put in the sections should be modules in ribasim otherwise you get error Cannot find an object named: ribasim. Does an object with the path ribasim:ribasim exist

However, if I remove lines after sections, specifying options in this way seems working! Now we have a not-empty-at-all API

@Jingru923 Jingru923 moved this from 🏗 In progress to 👀 In review in Ribasim Jun 20, 2024
visr pushed a commit that referenced this issue Jun 20, 2024
Part of #1439 .

I added the public functions (the one that doesn't start with a "_") to
the documentation. Give some short description on some of them.
@Jingru923
Copy link
Contributor

Continue work of this issue is here #1571

This issue thus can be closed

@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Ribasim Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
Archived in project
Development

No branches or pull requests

3 participants