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

Autogenerated docstrings for @version-generated record types #75

Open
omus opened this issue Dec 8, 2022 · 1 comment
Open

Autogenerated docstrings for @version-generated record types #75

omus opened this issue Dec 8, 2022 · 1 comment

Comments

@omus
Copy link
Member

omus commented Dec 8, 2022

It would be nice to provide some autogenerated docstrings for record types. Usually when the a Legolas record type is given a docstring the code used to generate the schema version is just copied into the docstring making maintaining the docstring annoying. Most likely we'll want to autogenerate a default docstring for Legolas record types but provide functionality such that it's easy to generate the docstring. One proposal for how we can handle this can be seen in: beacon-biosignals/Onda.jl#137 (comment)

Split out from: #10

@omus
Copy link
Member Author

omus commented Dec 8, 2022

Quite possibly we can use DocStringExtensions.jl to provide most of the functionality we want. If supported we could write the following:

"""
    AnnotationV1

My amazing description.

# Fields

$(TYPEDFIELDS)
"""
@version AnnotationV1 begin
    "The UUID identifying the recording with which the annotation is associated."
    recording::UUID = UUID(recording)

    "The UUID identifying the annotation."
    id::UUID = UUID(id)

    "The annotation's time span within the recording."
    span::TimeSpan = TimeSpan(span)
end

This would require a change to the @version macro to handle the addition of docstrings on fields. Additionally, this would provide us a way of automatically documenting the RHS of the fields. We would need to provide our own docstring extension to provide this functionality.

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

No branches or pull requests

1 participant