Skip to content

Conversation

@tylerflex
Copy link
Collaborator

@tylerflex tylerflex commented Jan 19, 2022

Major changes to how the pydantic models are defined and the docs are generated:

Instead of all information being contained in docstrings, each field itself will have some metadata. For example

class Box(Geometry):
    """Class level description"""

    size : Tuple[float, float, float] = pydantic.Field(
        (0,0,0),
        title="Size",
        description="Side length sizes of the box in x, y, z."
        units="um",
    )

This metadata is written into the schema in the appropriate place, making everyone's lives easier.

We then use autodoc-pydantic sphinx plugin to generate the docs.

Note: this is a WIP.

@momchil-flex
Copy link
Collaborator

This is actually pretty awesome. Glad you're doing it. Copying over docstrings was both a nuisance and just seemed wrong...

Let me know if you want to run anything specific by me, otherwise looks good to me.

@tylerflex
Copy link
Collaborator Author

Thanks, yea I think it will be good to do. Still a lot of work to clean things up and pretty up the docs. I think once it's closer to completion I might pick your brain on a thing or two, mainly regarding how the docs should look.

@tylerflex tylerflex merged commit c62fece into develop Jan 22, 2022
@momchil-flex momchil-flex deleted the field_docs branch March 17, 2022 18:07
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.

2 participants