Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor pipelines into classes (#51)
* Reorganizing the trait_map and modify ellipse, network functions. * Update ellipse argument default setting. * Reorganize ellipse and network functions by reducing arguments. * Map convex hull traits * Change primary to lateral when monocots is True * Get tips x and y coordinates uses network map * Change "stem" to "root" * Fix tip y map * Change root width back to take lateral_pts * Changing the order of positional arguments to match others (primary is first) * Fix plotting for using sleap-io API * Make positional arguments consistent * Refactor `get_base_xs` to use graph * Map `scanline_intersection_counts` and use keyword arguments * Refactor `get_base_ys`, `get_base_length`, and `base_ct_density` to use graph and add comments. Delete duplicate `primary_depth`. * Clean up dependencies. Fix tip_ys. * Refactor `get_root_lengths_max` for use with graph * Refactor `get_base_tip_dist` to make base and tip pts or all points optional arguments * Delete `primary_depth` * Delete traitsgraph * Delete traitsgraph dependencies * Refactor base-related traits to use graph optionally * Delete traits graph dependency * Use `get_primary_pts` from series class * Delete `get_primary_depth` tests * Fix trait map for base traits * Delete test for traitsgraph.py * Standardize trait definition in trait map * Change "graph" to "trait" * Fix docstrings in `get_bases` * Use `TraitDef` class * Fix docstrings * Add argument to class `TraitDef` whether to include in csv or if scalar * Change `attr` to `attrs` * Add `lengths.py` for length-related traits. * Add `primary_max_length_pts` to trait definitions * Add `pts_all_array` and `convex_hull` trait definitions * Fix docstring * Import base-related trait to `lengths.py` * Make sure arrays of points are 2-dimensional * Streamline point-related functions * Vectorize `get_node_ind` * Add trait definitions until `lateral_lengths` * Delete unnecessary code * Use node_ind for `get_root_angle` function. * Modify base functions by assuming primary_pts as the primary_length_max. * Modify argument pts as Optional in `get_base_tip_dist` function * Modify argument pts as Optional in `get_grav_index` function * Draft the trait_definitions using the defined TraitDef class. * Uppercase the `get_root_angle` function arg description. * Add test_lengths module for lengths-related functions. * Remove lengths-related functions from test_bases. * Set pts as Optional argument for `get_grav_index` function. * Change the module name for importing lengths-related functions. * Remove importing the points functions, only keep `get_all_pts_array`. * Test ellipse-related functions. * Redo the function `get_node_ind`. * Test function `get_node_ind`. * Angle function reset node_ind to array if only one value. * Angle function return nan if all Nan node, return value if single array. * Test angle functions. * Add network_width_depth_ratio in trait_definitions. * Reorganize arguments of `get_network_distribution_ratio` function. * Add `network_length` trait before calculating `network_solidity`. * Update `primary_root_length` function with calculated lengths. * Update `get_network_solidity` function with calculated network_length. * Test network-related functions. * Test points function (`get_all_pts_array`). * Update and test scanline functions using calculated scanline counts. * Refactor `get_root_pair_widths_projections` to take in `primary_max_length_pts` * Cleanup trait map * Fix tests for base-related traits * Add test for `get_max_lengths_pts` * Refactored `get_base_ct_density` to take `primary_length_max` and `lateral_base_pts` as arguments * Fixed multi-line strings * Refactor base-related traits * Refactor base-related traits and tests * Test root-length-related traits * Test tip-related traits * Refactor convex-hull-related traits * Test convex-hull functions * Lint * Lint * Lint * Lint * Lint * Fix kwargs involving `get_tips` in trait map * Fix input for pipeline tests * Refactor network related functions * Test pipeline * Refactor scanline function * Start refactoring pipeline into classes * Finish refactoring trait pipelines into classes * Runtime fixes * More refactoring to minimize redundant code across pipeline types * Rename module and fix tests * Add missing renamed modules * Fix summary tests * Fix Series to load video directly to bypass path resolution issues * Lint * Lint --------- Co-authored-by: Lin Wang <[email protected]> Co-authored-by: Elizabeth Berrigan <[email protected]>
- Loading branch information