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

Add jupyter notebooks for code instruction #72

Merged
merged 19 commits into from
Apr 4, 2024
Merged

Conversation

eberrigan
Copy link
Collaborator

@eberrigan eberrigan commented Apr 1, 2024

  • Adjust the pyproject.toml so that the notebooks folder is not automatically registered as a package in our flat layout structure
  • Add notebooks with example usage of each pipeline for calculating individual traits, traits of a series, traits of a batch of series and traits of batches of grouped series for the MultipleDicotPipeline
  • MultipleDicotPipeline example usage
  • DicotPipeline example usage
  • YoungerMonocotPipeline example usage
  • OlderMonocotPipelline example usage

Summary by CodeRabbit

  • New Features
    • Introduced a Jupyter notebook MultipleDicotPipeline.ipynb for loading root predictions, processing with a custom pipeline, and visualizing results.
    • Added a new property group to the Series class representing the group name for the series from the CSV.
  • Chores
    • Updated package configuration to specify inclusion of sleap_roots and exclusion of notebooks.

Copy link
Contributor

coderabbitai bot commented Apr 1, 2024

Warning

Rate Limit Exceeded

@eberrigan has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 40 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between bf493eb and 77294cf.

Walkthrough

The recent update introduces a new Jupyter notebook, MultipleDicotPipeline.ipynb, focused on processing root predictions and visualizing results. The pyproject.toml file now specifies package inclusions and exclusions for setuptools, enhancing project organization.

Changes

Files Change Summary
notebooks/MultipleDicotPipeline.ipynb Introduces a Jupyter notebook for loading root predictions, custom processing, and visualization.
pyproject.toml Added configuration to specify package inclusion and exclusion for setuptools.
README.md Updated Series.load calls, added new imports, tutorials section, and citation information.
sleap_roots/series.py Added a group property to the Series class for group names from CSV.

🐇✨
In the code's deep maze, where roots entwine,
A notebook emerges, its design refined.
Configurations aligned, exclusions defined,
Changes embraced, in the digital vine.
Here's to the updates, under the moon's soft sign,
May data flow smooth, like aged wine.
🌿📊🌟

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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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/coderabbit-overrides.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.

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: 1

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c5544ba and f3023e1.
Files selected for processing (2)
  • notebooks/MultipleDicotPipeline.ipynb (1 hunks)
  • pyproject.toml (1 hunks)
Additional Context Used
Additional comments not posted (3)
notebooks/MultipleDicotPipeline.ipynb (3)

4-18: The imports are well-organized and appropriate for the tasks demonstrated in the notebook.


22-30: The paths for CSV and folder locations are hardcoded, which might limit the notebook's usability in different environments or datasets. Consider making these paths configurable, for example, by using input fields or environment variables, to enhance the notebook's flexibility.


34-52: The operation to find all h5 files is correctly implemented. However, consider adding error handling or feedback for cases where no h5 files are found, to improve the user experience. For example, you could add a conditional check on all_h5s and print a message if it's empty.

pyproject.toml Outdated Show resolved Hide resolved
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

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between f3023e1 and f7d2f2f.
Files selected for processing (1)
  • notebooks/MultipleDicotPipeline.ipynb (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • notebooks/MultipleDicotPipeline.ipynb

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

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between f7d2f2f and 8ebefa3.
Files selected for processing (2)
  • notebooks/MultipleDicotPipeline.ipynb (1 hunks)
  • pyproject.toml (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • notebooks/MultipleDicotPipeline.ipynb
  • pyproject.toml

Copy link

codecov bot commented Apr 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.90%. Comparing base (cae212d) to head (77294cf).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #72   +/-   ##
=======================================
  Coverage   74.90%   74.90%           
=======================================
  Files          13       13           
  Lines        1307     1307           
=======================================
  Hits          979      979           
  Misses        328      328           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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: 5

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 8ebefa3 and fde13d2.
Files selected for processing (2)
  • README.md (7 hunks)
  • sleap_roots/series.py (1 hunks)
Additional comments not posted (1)
README.md (1)

130-149: The tutorials section is a valuable addition. Enhance its visibility by adding a table of contents at the beginning of the README with a link to this section.

README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
sleap_roots/series.py Show resolved Hide resolved
eberrigan and others added 5 commits April 3, 2024 21:26
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
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

Review Status

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between fde13d2 and bf493eb.
Files selected for processing (1)
  • README.md (7 hunks)
Additional comments not posted (4)
README.md (4)

33-34: Consider adding a brief comment above the primary_name and lateral_name parameters to explain their purpose and usage, as previously suggested.

plant = sr.Series.load(
    "tests/data/canola_7do/919QDUH.h5",
+   # Specify the names of the primary and lateral roots for trait calculation
    primary_name="primary",
    lateral_name="lateral"
)

49-50: Similar to the previous comment, consider adding explanatory comments for the primary_name and lateral_name parameters in batch processing examples, as previously suggested.

plants = [
    sr.Series.load(
        plant_path,
+       # Specify the names of the primary and lateral roots for trait calculation
        primary_name="primary",
        lateral_name="lateral",
    ) for plant_path in plant_paths]

62-62: Add a comment explaining the purpose of importing get_all_pts_array for clarity, as previously suggested.

import numpy as np
+ # Import utility for combining primary and lateral root points
from sleap_roots.points import get_all_pts_array

130-149: The new section on using Jupyter notebooks for tutorials is clear and informative. However, consider replacing "for use on your own data" with "for use with your own data" for grammatical correctness, as previously suggested.

- You can use the test data located at `tests/data` or copy the notebooks elsewhere for use on your own data!
+ You can use the test data located at `tests/data` or copy the notebooks elsewhere for use with your own data!

@eberrigan eberrigan merged commit 4091d71 into main Apr 4, 2024
5 checks passed
@eberrigan eberrigan deleted the elizabeth/Add-tutorials branch April 4, 2024 04:39
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