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
Converting from a Jupyter notebook to a Python script for PlantCV processing purposes requires some reformatting (some of which is unavoidable). One shortcut that could help is to define an options processing class in Jupyter that would prevent the need to do variable renaming in scripts. This is discussed in issue #198.
Details
The idea would be to format inputs like this in notebooks:
%matplotlibinline# Added this lineimportcv2importplantcvaspcvimportnumpyasnpimportargparse# Instead of the args inputs you could define an args class with the manual inputsclassoptions:
def__init__(self):
self.image="image.png"self.debug="plot"self.writeimg=Falseself.result="test_results.txt"self.coresult="test_coresults.txt"# Parse optionsargs=options()
# The code below here is from the "main" function in the scriptdevice=0# Read image (note that args.image and args.debut are replaced with image and debug)img, path, filename=pcv.readimage(filename=args.image, debug=args.debug)
Completion Criteria
Update documentation
Test mkdocs build
Pull request and merge
The text was updated successfully, but these errors were encountered:
Documentation for conversion to Jupyter notebooks to Python scripts has been updated to reflect the current version of PlantCV in pull request #388 . The documentation now contains slightly more detail and links to the various tutorial pages which contain full, correctly formatted scripts at the bottom as further examples.
Description
Converting from a Jupyter notebook to a Python script for PlantCV processing purposes requires some reformatting (some of which is unavoidable). One shortcut that could help is to define an options processing class in Jupyter that would prevent the need to do variable renaming in scripts. This is discussed in issue #198.
Details
The idea would be to format inputs like this in notebooks:
Completion Criteria
The text was updated successfully, but these errors were encountered: