-
Notifications
You must be signed in to change notification settings - Fork 0
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
Implement Younger Monocot Pipeline #64
Conversation
WalkthroughThe changes primarily focus on enhancing the functionality of the Changes
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 4
Files selected for processing (4)
- sleap_roots/lengths.py (2 hunks)
- sleap_roots/trait_pipelines.py (1 hunks)
- tests/test_lengths.py (2 hunks)
- tests/test_trait_pipelines.py (2 hunks)
Additional comments (Suppressed): 11
tests/test_trait_pipelines.py (1)
- 1-5: The import of
YoungerMonocotPipeline
andfind_all_series
is new. Ensure that these classes/functions are correctly implemented and tested.tests/test_lengths.py (6)
165-166: This test case for scalar inputs in the
get_grav_index
function is well written and covers an important scenario.169-174: This test case for array inputs in the
get_grav_index
function is well written and covers an important scenario.177-183: This test case correctly checks for a ValueError when there is a shape mismatch between the input arrays to the
get_grav_index
function.186-191: This test case correctly checks the handling of NaN values in the
get_grav_index
function.194-199: This test case correctly checks the handling of zero lengths in the
get_grav_index
function.202-206: These test cases correctly check the handling of invalid scalar values in the
get_grav_index
function.sleap_roots/trait_pipelines.py (3)
904-905: The new
YoungerMonocotPipeline
class is a subclass of thePipeline
class and is designed to compute traits for younger monocot plants. This is a good addition as it allows for more specific trait computation for different types of plants.920-1343: The
define_traits
method has been overridden in theYoungerMonocotPipeline
class to define the trait computation pipeline specific to younger monocot plants. The method returns a list ofTraitDef
objects representing the traits to be computed. EachTraitDef
object includes a name, a function (fn
) that computes the trait, a list of input traits required for computing the trait, flags indicating whether the trait is scalar or should be included in downstream CSV files, additional keyword arguments for the computation function, and a description of the trait. This is a comprehensive set of traits for younger monocot plants and covers various aspects such as root lengths, angles, intersections, network length, etc.1345-1373: The
get_initial_frame_traits
method has been updated to return initial traits for a plant frame. It takes aplant
Series object and aframe_idx
as inputs and returns a dictionary of initial traits with keys: "primary_pts" and "main_pts". The method handles cases where there are no instances for primary and main roots by returning arrays with NaN values. This is a good practice as it ensures that the output shape is consistent regardless of the input.sleap_roots/lengths.py (1)
- 1-6: The import statement for
get_base_tip_dist
has been removed. Ensure that this function is no longer used in the codebase or has been replaced with an equivalent functionality.
Codecov Report
@@ Coverage Diff @@
## main #64 +/- ##
==========================================
+ Coverage 77.05% 78.30% +1.24%
==========================================
Files 13 13
Lines 789 802 +13
==========================================
+ Hits 608 628 +20
+ Misses 181 174 -7
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
Review Status
Actionable comments generated: 2
Files selected for processing (4)
- sleap_roots/lengths.py (2 hunks)
- sleap_roots/trait_pipelines.py (1 hunks)
- tests/test_lengths.py (2 hunks)
- tests/test_trait_pipelines.py (2 hunks)
Files skipped from review due to trivial changes (2)
- sleap_roots/trait_pipelines.py
- tests/test_lengths.py
Additional comments (Suppressed): 2
tests/test_trait_pipelines.py (1)
- 1-5: The import of
YoungerMonocotPipeline
andfind_all_series
is new in this hunk. Ensure that these classes/functions are correctly implemented and tested elsewhere in the codebase.sleap_roots/lengths.py (1)
- 1-6: The import of
get_base_tip_dist
fromsleap_roots.bases
has been removed. Ensure that this function is not used elsewhere in the code or if it's used, it's imported correctly.
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.
Review Status
Actionable comments generated: 2
Files selected for processing (1)
- tests/test_trait_pipelines.py (2 hunks)
Additional comments (Suppressed): 1
tests/test_trait_pipelines.py (1)
- 1-5: The import of
YoungerMonocotPipeline
andfind_all_series
is new in this hunk. Ensure that these classes/functions are correctly implemented and tested elsewhere in the codebase.
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.
Review Status
Actionable comments generated: 1
Files selected for processing (2)
- sleap_roots/lengths.py (2 hunks)
- tests/test_lengths.py (2 hunks)
Files skipped from review due to trivial changes (1)
- tests/test_lengths.py
Additional comments (Suppressed): 1
sleap_roots/lengths.py (1)
- 1-6: The import of
get_base_tip_dist
fromsleap_roots.bases
has been removed. Ensure that this function is no longer used in the codebase or has been replaced appropriately.
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 great to me!
* Start `YoungerMonocotPipeline` * Add `main_grav_indices` * Add younger monocot data * Edit `YoungMonocotPipeline` * Test `YoungerMonocotPipeline` * Fix trait definitions * Fix description of `main_grav_indices` * Test gravitropism index * Fixed test for `grav_index` for NaN values * Add tests for `get_grav_index` for expected output shape
YoungerMonocotPipeline
as subclass ofPipeline
YoungerMonocotPipeline
Summary by CodeRabbit
YoungerMonocotPipeline
class for trait computation of younger monocot plants, including root lengths, angles, intersections, and network length.get_grav_index
function insleap_roots/lengths.py
to handle both scalar and array inputs uniformly, improving code flexibility and robustness.get_grav_index
function covering various scenarios such as scalar inputs, array inputs, shape mismatch, NaN values, and zero lengths.test_younger_monocot_pipeline
to validate the functionality of the newly introducedYoungerMonocotPipeline
class.