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

Tidy some docstrings #132

Merged
merged 1 commit into from
Jul 10, 2024
Merged

Tidy some docstrings #132

merged 1 commit into from
Jul 10, 2024

Conversation

hyanwong
Copy link
Owner

@hyanwong hyanwong commented Jul 10, 2024

And remove extraneous timedelta param

Summary by CodeRabbit

  • Documentation

    • Added a call to action for contributions by providing a link to the GitHub repository.
    • Enhanced method documentation in the Graph class for better clarity.
  • Refactor

    • Updated methods in Graph and Tables classes to include parameter and return type annotations.
    • Removed the timedelta parameter from the from_tree_sequence method and adjusted related logic.
  • Tests

    • Modified the test case to handle time changes differently, improving test coverage and accuracy.

And remove extraneous timedelta param
Copy link
Contributor

coderabbitai bot commented Jul 10, 2024

Walkthrough

The recent changes enhance documentation and type annotations across several files, improving code clarity and maintainability. In giglib/graph.py, parameter descriptions and return types were added. In giglib/tables.py, docstrings and type annotations were updated, and a parameter was removed. The test file tests/test_tables.py was updated to match these modifications. Additionally, a call to action for contributions was included in the documentation.

Changes

Files Change Summary
docs/index.md Added a call to action for contribution by providing a link to the GitHub repository.
giglib/graph.py Added parameter descriptions and return types for methods to_tree_sequence, decapitate, and sample_resolve in the Graph class.
giglib/tables.py Clarified copy method docstring, added type annotations, and removed timedelta parameter from from_tree_sequence method.
tests/test_tables.py Modified test_simple_from_tree_sequence_with_timedelta to adjust for the removal of the timedelta parameter.

Poem

In the code where graphs do weave,
 > Types and docs now interleave,
 > From tables' time to tests' embrace,
 > Clarity and rhyme replace the chase.
 > Contributions call, come one, come all,
 > To improve the code, both big and small!


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@hyanwong hyanwong merged commit 2139326 into main Jul 10, 2024
4 checks passed
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
docs/index.md (1)

26-26: Convert bare URL to markdown link.

Bare URLs should be converted to markdown links to enhance readability and compliance with Markdownlint rules.

- Please visit https://github.com/hyanwong/giglib to contribute to development.
+ Please visit [the project's GitHub repository](https://github.com/hyanwong/giglib) to contribute to development.
Tools
Markdownlint

26-26: null
Bare URL used

(MD034, no-bare-urls)

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 605e88c and c41bf23.

Files selected for processing (4)
  • docs/index.md (1 hunks)
  • giglib/graph.py (3 hunks)
  • giglib/tables.py (6 hunks)
  • tests/test_tables.py (1 hunks)
Files skipped from review due to trivial changes (1)
  • giglib/graph.py
Additional context used
Markdownlint
docs/index.md

26-26: null
Bare URL used

(MD034, no-bare-urls)

Additional comments not posted (7)
tests/test_tables.py (1)

34-35: LGTM! Changes are correctly implemented.

The test function test_simple_from_tree_sequence_with_timedelta has been correctly updated to remove the timedelta parameter from the from_tree_sequence method call and introduce the change_times method call to manage the timedelta parameter.

giglib/tables.py (6)

1139-1143: Docstring and type annotation update in Tables.copy method approved.

The updated docstring and the addition of the return type annotation improve the clarity and documentation of the method.


1244-1246: Docstring and type annotation update in Tables.graph method approved.

The updated docstring and the addition of the return type annotation improve the clarity and documentation of the method.


1256-1257: Docstring and type annotation update in Tables.sample_ids property approved.

The updated docstring and the addition of the return type annotation improve the clarity and documentation of the property.


1273-1278: Docstring and type annotation update in Tables.decapitate method approved.

The updated docstring and the addition of the return type annotation improve the clarity and documentation of the method.


1311-1319: Docstring and type annotation update in Tables.from_tree_sequence method approved.

The updated docstring and the addition of the return type annotation improve the clarity and documentation of the method. The removal of the timedelta parameter simplifies the method signature.


1139-1143: Docstring and type annotation update in Tables.copy method approved.

The updated docstring and the addition of the return type annotation improve the clarity and documentation of the method.

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.

1 participant