-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Docs: Standardize and improve SentenceTransformersTextEmbedder docstrings #8060
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the class docstring the suggested changes seem to divert from our current standard. Unless we change our standard, I would keep that line as is. The other changes look good to me. 👍
@component | ||
class SentenceTransformersTextEmbedder: | ||
""" | ||
A component for embedding strings using Sentence Transformers models. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All other components in Haystack use one sentence for this docstring and many (not all) start with A component
. If we change only the class SentenceTransformersTextEmbedder
it's not really standardized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're going to gradually change them all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the goal is also to shorten the docstrings and not repeat what's obvious, that's why I did away with "A component for.."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@julian-risch "A component" is used often, but is not a standard (see DocumentWriter, CacheChecker, converters for examples), I would say that the shorter style that describes what component is doing looks quite good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@julian-risch are you OK with the new format? can I resolve this?
@dfokina @agnieszka-m I saw that the related PR #8057 mentions the PR is part of a series of changes. I suggest that you open one issue for the series of changes with a description of the required changes. |
haystack/components/embedders/sentence_transformers_text_embedder.py
Outdated
Show resolved
Hide resolved
Pull Request Test Coverage Report for Build 10093246889Details
💛 - Coveralls |
haystack/components/embedders/sentence_transformers_text_embedder.py
Outdated
Show resolved
Hide resolved
haystack/components/embedders/sentence_transformers_text_embedder.py
Outdated
Show resolved
Hide resolved
…der.py Co-authored-by: Daria Fokina <[email protected]>
…der.py Co-authored-by: Daria Fokina <[email protected]>
There was a problem hiding this 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! 👍 Thank you also for creating the overview issue here #8062 What remains to be done is to better explain to the rest of the team what standards to follow when writing docstrings in future.
@julian-risch Absolutely, I'll document the standards for the docstrings. |
Related Issues
Proposed Changes:
Standardize and improve docstrings.
How did you test it?
Notes for the reviewer
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.