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

[Issue]: Improve consistency of doc strings across modules #2048

Closed
Tracked by #1597
gagb opened this issue Mar 18, 2024 · 10 comments
Closed
Tracked by #1597

[Issue]: Improve consistency of doc strings across modules #2048

gagb opened this issue Mar 18, 2024 · 10 comments
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@gagb
Copy link
Collaborator

gagb commented Mar 18, 2024

Describe the issue

Doc strings across all files lack consistency, presumably because different authors are using different conventions (including me). Eg, these are PEP 257 guidelines for multi-line doc strings:

image

It's easy to spot even the violations of the first para. For example:

  • RetrieveUserProxyAgent does not have the first single line.

    class RetrieveUserProxyAgent(UserProxyAgent):
    def __init__(
    self,
    name="RetrieveChatAgent", # default set to RetrieveChatAgent
    human_input_mode: Optional[str] = "ALWAYS",
    is_termination_msg: Optional[Callable[[Dict], bool]] = None,
    retrieve_config: Optional[Dict] = None, # config for the retrieve agent
    **kwargs,
    ):
    r"""
    Args:
    name (str): name of the agent.
    human_input_mode (str): whether to ask for human inputs every time a message is received.

  • initiate_chats uses extra indents that cause it to not render properly in vscode documentation pop outs.

    def initiate_chats(chat_queue: List[Dict[str, Any]]) -> List[ChatResult]:
    """Initiate a list of chats.
    Args:
    chat_queue (List[Dict]): a list of dictionaries containing the information about the chats.
    Each dictionary should contain the input arguments for `ConversableAgent.initiate_chat`. For example:
    "sender": the sender agent.
    "recipient": the recipient agent.
    "clear_history" (bool): whether to clear the chat history with the agent. Default is True.

cc. @ekzhu @jackgerrits

@gagb gagb added documentation Improvements or additions to documentation dev good first issue Good for newcomers labels Mar 18, 2024
@jackgerrits
Copy link
Member

jackgerrits commented Mar 18, 2024

Additionally, I think we should settle on Google style docstrings. There is great support for them and they are (in my opinion) the easiest to read. A large amount of the codebase already uses this style too. So it's really just making this fact explicit.

@gagb
Copy link
Collaborator Author

gagb commented Mar 18, 2024

Additionally, I think we should settle on Google style docstrings.

Agreed.

@sharsha315
Copy link
Contributor

Is this issue still open. Can I have the opportunity to work on this issue.

@RohitRathore1
Copy link
Contributor

Is this issue still open. Can I have the opportunity to work on this issue.

@sharsha315 Yes, please go ahead.

@sharsha315
Copy link
Contributor

sharsha315 commented Mar 22, 2024

Hi, a little help, Please. I made the necessary changes, formatted the docstrings, but when I make a commit I am getting an error and the git commit is getting failed. I have enclosed the snapshots of the errors.
commit_error_1
commit_error_2
commit_error_3

@sharsha315
Copy link
Contributor

Hi @RohitRathore1, a little help here. Please, help me with this above error, I am not able to go on further.

@jackgerrits
Copy link
Member

This was fixed in main by fafc29e, please make sure you've updated to latest

@sharsha315
Copy link
Contributor

This was fixed in main by fafc29e, please make sure you've updated to latest

Thank you for the quick response. It's working now.

@sharsha315
Copy link
Contributor

Hi @RohitRathore1, I have submitted the PR. Please, review the PR and provide feedback. Thank you.

@RohitRathore1
Copy link
Contributor

@sharsha315 Thanks for your PR. Please read the CLA & if you are agree with it then you can comment @microsoft-github-policy-service agree in the same PR.

@gagb gagb closed this as completed Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants