Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Jupyter documentation on conversion between notebooks and scripts #199

Closed
3 tasks
nfahlgren opened this issue Nov 2, 2017 · 1 comment
Closed
3 tasks
Assignees
Labels
documentation Documentation issues or features enhancement Enhancements to existing features
Projects

Comments

@nfahlgren
Copy link
Member

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:

%matplotlib inline  # Added this line
import cv2
import plantcv as pcv
import numpy as np
import argparse

# Instead of the args inputs you could define an args class with the manual inputs
class options:
    def __init__(self):
        self.image = "image.png"
        self.debug = "plot"
        self.writeimg = False
        self.result = "test_results.txt"
        self.coresult = "test_coresults.txt"

# Parse options
args = options()

# The code below here is from the "main" function in the script
device = 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
@nfahlgren nfahlgren added documentation Documentation issues or features enhancement Enhancements to existing features labels Nov 2, 2017
@nfahlgren nfahlgren added this to the PlantCV Release v3.0 milestone Nov 2, 2017
@nfahlgren nfahlgren added this to To Do in PlantCV3 Nov 15, 2017
@nfahlgren nfahlgren moved this from To Do to Proposed in PlantCV3 Nov 15, 2017
@nfahlgren nfahlgren self-assigned this Nov 15, 2017
@nfahlgren nfahlgren moved this from Proposed to To Do in PlantCV3 Nov 15, 2017
@HaleySchuhl
Copy link
Contributor

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.

PlantCV3 automation moved this from To Do to Done Jul 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation issues or features enhancement Enhancements to existing features
Projects
No open projects
PlantCV3
  
Done
Development

No branches or pull requests

2 participants