Skip to content

Adds python API reference#25

Merged
alexhroom merged 8 commits intoRascalSoftware:mainfrom
alexhroom:1-python-api
Feb 12, 2025
Merged

Adds python API reference#25
alexhroom merged 8 commits intoRascalSoftware:mainfrom
alexhroom:1-python-api

Conversation

@alexhroom
Copy link
Copy Markdown
Collaborator

@alexhroom alexhroom commented Jan 15, 2025

This PR fixes #1 by adding an auto-generated Python API reference. A library autodoc-pydantic is used to build docs for Pydantic models!

@alexhroom
Copy link
Copy Markdown
Collaborator Author

doc build failing because of a bad docstring in the python creating a warning...

Copy link
Copy Markdown
Collaborator

@StephenNneji StephenNneji 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 so far

  1. Please see if the validators and config can be hidden in the Pydantic classes
    Screenshot 2025-02-05 121029

  2. The Developer API does not show the full docstring even though it is available
    Screenshot 2025-02-05 115436

  3. Is it possible to remove the type hints from function signature since they already exist in the docstring? This should make the signature less cluttered
    Screenshot 2025-02-05 122154

Copy link
Copy Markdown
Collaborator

@StephenNneji StephenNneji left a comment

Choose a reason for hiding this comment

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

Looks better, Please see comments

Still got some typehints in outputs.rst

Screenshot 2025-02-06 102207

Enums don't show members

Screenshot 2025-02-06 102022

Also I think enums should be in the user API not developer. Also adding RAT.run to index.rst does not look great. We need to give RAT.run its own page or maybe merge with classlist.rst then rename the file.

Screenshot 2025-02-06 104021

@alexhroom
Copy link
Copy Markdown
Collaborator Author

alexhroom commented Feb 7, 2025

@StephenNneji for some reason the type hints aren't suppressed if the class has no docstring. If I give the Results class a docstring and build the docs then it works as expected. I've created the issue RascalSoftware/python-RAT#130 to add docstrings to outputs

Copy link
Copy Markdown
Collaborator

@StephenNneji StephenNneji 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, thanks

@alexhroom alexhroom merged commit b75ee4e into RascalSoftware:main Feb 12, 2025
@alexhroom alexhroom deleted the 1-python-api branch February 12, 2025 07:34
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.

Auto-generate API reference

2 participants