You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An issue that has come up a few times (most recently #688) is that a PlantCV workflow result file (JSON format) cannot be converted to CSV using the json2csv method in the utils subpackage (typically with the script plantcv-utils.py json2csv. The json2csv function accepts a JSON-formatted file that is output by plantcv.parallel.process_results, which is not quite the same as a workflow results file. process_results processes an input directory containing workflow results files and combines them into a single output JSON file. While processing the individual results files, process_results builds a global variable index (this allows us to fill in missing values when we export to CSV later) and combines the observations into an aggregate list of "entities" (aka one set of results per image). A workflow results file is missing the variables index and does not have a list of entities since it is only a single entity.
It is fairly common for folks to want to retrieve a table of results for a single workflow. It is currently possible to hack this together by running plantcv.parallel.process_results and then running json2csv but it is not very user-friendly.
I propose that we begin to deprecate pcv.print_results and create one or more new methods in the Outputs class. One potential option is a new method with the file format as an input option (pcv.outputs.save_results(filename, format)), or alternatively a new method for each (pcv.outputs.save_json(filename) and pcv.outputs.save_csv(filename)). For an interim period pcv.print_results() could continue to work with a deprecation warning.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
An issue that has come up a few times (most recently #688) is that a PlantCV workflow result file (JSON format) cannot be converted to CSV using the
json2csv
method in theutils
subpackage (typically with the scriptplantcv-utils.py json2csv
. Thejson2csv
function accepts a JSON-formatted file that is output byplantcv.parallel.process_results
, which is not quite the same as a workflow results file.process_results
processes an input directory containing workflow results files and combines them into a single output JSON file. While processing the individual results files,process_results
builds a global variable index (this allows us to fill in missing values when we export to CSV later) and combines the observations into an aggregate list of "entities" (aka one set of results per image). A workflow results file is missing the variables index and does not have a list of entities since it is only a single entity.It is fairly common for folks to want to retrieve a table of results for a single workflow. It is currently possible to hack this together by running
plantcv.parallel.process_results
and then runningjson2csv
but it is not very user-friendly.I propose that we begin to deprecate
pcv.print_results
and create one or more new methods in theOutputs
class. One potential option is a new method with the file format as an input option (pcv.outputs.save_results(filename, format)
), or alternatively a new method for each (pcv.outputs.save_json(filename)
andpcv.outputs.save_csv(filename)
). For an interim periodpcv.print_results()
could continue to work with a deprecation warning.Beta Was this translation helpful? Give feedback.
All reactions