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

documentation: automatically generate documentation from all .py files in xDSL #3758

Merged
merged 5 commits into from
Jan 21, 2025

Conversation

superlopuh
Copy link
Member

Excludes:

  • __main__.py files
  • _-prefixed files
  • xdsl/irdl/error.py as it contains a function called error which confuses the doc mechanism for some reason
  • xdsl/ir/*.py as we've already got curated docs for these files

Still needs a bit of cleanup and to merge the code changes separately.

The big question for this PR is whether we want to commit these files and, if not, how do we review them?

@superlopuh superlopuh added the documentation Improvements or additions to documentation label Jan 17, 2025
@superlopuh superlopuh self-assigned this Jan 17, 2025
Copy link
Member Author

Choose a reason for hiding this comment

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

Screenshot 2025-01-17 at 00 33 23

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure that this is actually how we want to print this

Copy link
Member Author

Choose a reason for hiding this comment

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

Without code blocks, the [] are treated as md references, which raises errors during the build, and looks ugly on the page.

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.25%. Comparing base (5c96c6e) to head (c9d11cf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3758   +/-   ##
=======================================
  Coverage   91.25%   91.25%           
=======================================
  Files         461      461           
  Lines       57479    57479           
  Branches     5543     5543           
=======================================
  Hits        52455    52455           
  Misses       3602     3602           
  Partials     1422     1422           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 376 to 382
"""
number of chunks into which communication and computation should be split.
Effectively, the number of times `csl_stencil.apply.receive_chunk` will be
executed and the tensor sizes it handles. Higher values may increase compute
overhead but reduce size of communication buffers when lowered.
"""
Copy link
Member Author

Choose a reason for hiding this comment

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

Screenshot 2025-01-17 at 00 37 48

@compor
Copy link
Collaborator

compor commented Jan 17, 2025

Wdym by "if we commit these files"? You don't mean the generated documentation, right?
Although we didn't discuss it, I thought we could use something like readthedocs.io to publish them upon each release with a workflow or similar?

@superlopuh
Copy link
Member Author

Yep there's a way to actually do it for each pull request and with a diff view:

https://docs.readthedocs.io/en/stable/pull-requests.html

@compor
Copy link
Collaborator

compor commented Jan 17, 2025

Yep there's a way to actually do it for each pull request and with a diff view:

https://docs.readthedocs.io/en/stable/pull-requests.html

Great! Maybe that's the way to go?

@superlopuh
Copy link
Member Author

Definitely, I just need to move our jupyter notebooks over first as they currently deploy with github pages

Copy link
Collaborator

@EdmundGoodman EdmundGoodman left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Is the plan to deply to GitHub pages with the https://xdsl.dev website or readthedocs.io? The latter might break some URLs but might provide some other features for free?

Also something to consider is versioning the docs (at least after the first major semantic versioned release, but don't want to have to rebuild doc infrastructure then) can be quite valuable, which you can do with https://github.com/jimporter/mike for mkdocs-material on GitHub pages, but I am not sure how this would play with readthedocs.io?

mkdocs.yml Outdated
@@ -5,9 +5,27 @@ theme:

plugins:
- search
- gen-files:
scripts:
- scripts/gen_ref_pages.py
- mkdocstrings
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can get a bit more out of this extension with some more settings. In the past I've used something like this:

  - mkdocstrings:
      handlers:
        python:
          options:
            docstring_style: google
            members_order: source
            show_root_heading: true
            show_root_full_path: false
            show_signature_annotations: true

But it might be a bit verbose for a very large codebase

@superlopuh superlopuh changed the title [WIP] documentation: automatically generate documentation from all .py files in xDSL documentation: automatically generate documentation from all .py files in xDSL Jan 21, 2025
@superlopuh superlopuh merged commit bba4671 into main Jan 21, 2025
16 checks passed
@superlopuh superlopuh deleted the sasha/docs/autogen branch January 21, 2025 23:49
superlopuh added a commit that referenced this pull request Jan 23, 2025
…s in xDSL (#3758)

Excludes:

 - `__main__.py` files
 - `_`-prefixed files
- `xdsl/irdl/error.py` as it contains a function called `error` which
confuses the doc mechanism for some reason
- `xdsl/ir/*.py` as we've already got curated docs for these files

Still needs a bit of cleanup and to merge the code changes separately.

The big question for this PR is whether we want to commit these files
and, if not, how do we review them?
oluwatimilehin pushed a commit to oluwatimilehin/xdsl that referenced this pull request Feb 13, 2025
…s in xDSL (xdslproject#3758)

Excludes:

 - `__main__.py` files
 - `_`-prefixed files
- `xdsl/irdl/error.py` as it contains a function called `error` which
confuses the doc mechanism for some reason
- `xdsl/ir/*.py` as we've already got curated docs for these files

Still needs a bit of cleanup and to merge the code changes separately.

The big question for this PR is whether we want to commit these files
and, if not, how do we review them?
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
None yet
Development

Successfully merging this pull request may close these issues.

4 participants