danforthcenter / plantcv

Plant phenotyping with image analysis
Mozilla Public License 2.0
661 stars 265 forks source link

Adding an indent to the JSON save function #1474

Open YashM8 opened 8 months ago

YashM8 commented 8 months ago

Is your feature request related to a problem? Please describe. The saved JSON files are unreadable by humans.

Describe the solution you'd like An optional parameter in the save function to add an indent parameter.

Describe alternatives you've considered Read the file again, indent and save again. This doubles the save time for saving huge batches.

YashM8 commented 8 months ago

The solution is simple and if allowed, I can add it.

nfahlgren commented 8 months ago

Hi @YashM8, definitely feel free to add it. For batch processing results in JSON we add an indent of 4 (https://github.com/danforthcenter/plantcv/blob/main/plantcv/parallel/process_results.py), but do not have the same in the Outputs class: https://github.com/danforthcenter/plantcv/blob/main/plantcv/plantcv/classes.py