Skip to content

Json2csv update: handle lists of coordinates#1652

Closed
HaleySchuhl wants to merge 5 commits intomainfrom
json2csv_handle_lists_of_coordinates
Closed

Json2csv update: handle lists of coordinates#1652
HaleySchuhl wants to merge 5 commits intomainfrom
json2csv_handle_lists_of_coordinates

Conversation

@HaleySchuhl
Copy link
Contributor

@HaleySchuhl HaleySchuhl commented Jan 17, 2025

Describe your changes
Adjust the json2csv utility function to handle lists of coordinates e.g. leaf tip coordinates from the morphology subpackage.

Type of update
Is this a:

  • Bug fix (previously json2csv would run but would have squished syntax, and this bad syntax would throw an error while reading the resulting csv in with pandas as a dataframe)
image
  • feature enhancement
  • Work in progress

Associated issues

Additional context
Changes the formatting for coordinate-type outputs, where we have multi-value traits that are lists of points. Updated output format looks like this:
image

For the reviewer
See this page for instructions on how to review the pull request.

  • PR functionality reviewed in a Jupyter Notebook
  • All tests pass
  • Test coverage remains 100%
  • Documentation tested
  • New documentation pages added to plantcv/mkdocs.yml
  • Changes to function input/output signatures added to updating.md
  • Code reviewed
  • PR approved

@HaleySchuhl HaleySchuhl added enhancement Enhancements to existing features bugfix Bug fixes work in progress Mark work in progress update Updates an existing feature/method labels Jan 17, 2025
@HaleySchuhl HaleySchuhl added this to the PlantCV v4.7 milestone Jan 17, 2025
@HaleySchuhl HaleySchuhl self-assigned this Jan 17, 2025
@deepsource-io
Copy link

deepsource-io bot commented Jan 17, 2025

Here's the code health analysis summary for commits c6105a7..f6d1944. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Python LogoPython✅ SuccessView Check ↗
DeepSource Test coverage LogoTest coverage✅ SuccessView Check ↗

Code Coverage Report

MetricAggregatePython
Branch Coverage100%100%
Composite Coverage100%100%
Line Coverage100%100%
New Branch Coverage100%100%
New Composite Coverage100%100%
New Line Coverage100%, ✅ Above Threshold100%, ✅ Above Threshold

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@HaleySchuhl HaleySchuhl added ready to review and removed work in progress Mark work in progress labels Jan 21, 2025
@HaleySchuhl HaleySchuhl marked this pull request as draft February 7, 2025 15:27
@HaleySchuhl HaleySchuhl added the work in progress Mark work in progress label Feb 7, 2025
@HaleySchuhl
Copy link
Contributor Author

Need to refine these updates for handling lists of coordinates. The changes so far resolve the fatal error when trying to read the csv output in Python with pandas but would require more data wrangling in R since the syntax [x y] is handled as a character dtype.

Refine based on the downstream use case, such as calculating distance matrices with leaf tip coordinates (for segment ID assignment between timepoints for example).

@HaleySchuhl
Copy link
Contributor Author

Closing in favor of a different approach described in #1857

@github-project-automation github-project-automation bot moved this from Pull Requests to Done in PlantCV4 Dec 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Bug fixes enhancement Enhancements to existing features update Updates an existing feature/method work in progress Mark work in progress

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants