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

Review and normalize docstrings #7074

Closed
52 tasks done
shadeMe opened this issue Feb 23, 2024 · 0 comments
Closed
52 tasks done

Review and normalize docstrings #7074

shadeMe opened this issue Feb 23, 2024 · 0 comments
Assignees
Labels
2.x Related to Haystack v2.0 epic P1 High priority, add to the next sprint type:documentation Improvements on the docs
Milestone

Comments

@shadeMe
Copy link
Contributor

shadeMe commented Feb 23, 2024

Guidelines

Make sure the docstrings adhere to the following:

  • Markdown syntax is correct.
  • Component docstrings should be concise and not have information that's not directly associated with their code.
    • Format:
      •   """
          <A brief description of the component.>
        
          <An optional paragraph with additional details and references. Just one paragraph.>
        
          Usage example:
          <Example code block>
          """
  • Links to external webpages are not bare/correctly formatted.
    • Don't directly use URLs but anchor text instead.
  • Component Run method has the following format:
    •   """
        <One-liner describing the semantics of the run operation>
        
        <Parameter list for the inputs>
      
        <Output description. If a dict is returned, provide a bullet list 
        of all expected keys and a short description of their values; use inline code quotes for key names.>
        """
  • Defaults/type annotations for parameters are not present in the docstring.
    • These are automatically generated.
  • Use the following docstrings for standard functions:
    • warm_up:
      •   """
          Initializes the component.
          """
    • to_dict:
      •   """
          Serializes the component to a dictionary.
        
          :returns: 
          	Dictionary with serialized data.
          """
    • from_dict:
      •   """
          Deserializes the component from a dictionary.
        
          :param data:
              Dictionary to deserialize from.
          :returns:
          	Deserialized component.
          """
  • Test the changes to the docstrings by rendering them locally using pydoc-markdown.

Scope

  • Target all publicly visible classes.
  • Private/internal classes can be more sparsely documented than their public counterparts.

Related tasks

  • Test the usage example locally.
  • Add missing docstrings.

Haystack Core

Preview Give feedback
  1. 2.x P1 type:documentation
    masci
  2. 2.x P1 type:documentation
    masci
  3. 2.x P1 type:documentation
    shadeMe
  4. 2.x P1 type:documentation
    anakin87
  5. 2.x P1 type:documentation
    vblagoje
  6. 2.x P1 type:documentation
    silvanocerza
  7. 2.x P1 type:documentation
    silvanocerza
  8. 2.x P1 type:documentation
    shadeMe
  9. 2.x P1 type:documentation
    wochinge
  10. 2.x P1 type:documentation
    davidsbatista
  11. 2.x P1 type:documentation
    silvanocerza
  12. 2.x P1 type:documentation
    vblagoje
  13. 2.x P1 type:documentation
    anakin87
  14. 2.x P1 type:documentation
    julian-risch
  15. 2.x P1 type:documentation
    julian-risch
  16. 2.x P1 type:documentation
    julian-risch
  17. 2.x P1 type:documentation
    anakin87
  18. 2.x P1 type:documentation
    anakin87
  19. 2.x P1 type:documentation
    wochinge
  20. 2.x P1 type:documentation
    wochinge
  21. 2.x P1 type:documentation
    julian-risch
  22. 2.x P1 type:documentation
    julian-risch
  23. 2.x P1 type:documentation
    davidsbatista
  24. 2.x P1 type:documentation
    davidsbatista
  25. 2.x P1 type:documentation
    vblagoje
  26. 2.x P1 type:documentation
    vblagoje

Haystack Core Integrations

Preview Give feedback
  1. 2.x P1 type:documentation
    vblagoje
  2. 2.x P1 type:documentation
    vblagoje
  3. 2.x P1 type:documentation
    wochinge
  4. 2.x P1 type:documentation
    wochinge
  5. 2.x P1 type:documentation
    wochinge
  6. 2.x P1 type:documentation
    shadeMe
  7. 2.x P1 type:documentation
    vblagoje
  8. 2.x P1 type:documentation
    vblagoje
  9. 2.x P1 type:documentation
    anakin87
  10. 2.x P1 type:documentation
    wochinge
  11. 2.x P1 type:documentation
    davidsbatista
  12. 2.x P1 type:documentation
    davidsbatista
  13. 2.x P1 type:documentation
    anakin87
  14. 2.x P1 type:documentation
    anakin87
  15. 2.x P1 type:documentation
    masci
  16. 2.x P1 type:documentation
    vblagoje
  17. 2.x P1 type:documentation
    masci
  18. 2.x P1 type:documentation
    davidsbatista
  19. 2.x P1 type:documentation
    shadeMe
  20. 2.x P1 type:documentation
    anakin87
  21. 2.x P1 type:documentation
    anakin87
  22. 2.x P1 type:documentation
    davidsbatista
  23. 2.x P1 type:documentation
    shadeMe
  24. 2.x P1 type:documentation
    anakin87
  25. 2.x P1 type:documentation
    shadeMe
  26. 2.x P1 type:documentation
    masci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to Haystack v2.0 epic P1 High priority, add to the next sprint type:documentation Improvements on the docs
Projects
None yet
Development

No branches or pull requests

3 participants