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
Copy file name to clipboardexpand all lines: docs/CONTRIBUTING.md
+77-23
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,21 @@
1
-
# How to contribute
1
+
# Table of Contents for Contibution
2
+
1.[Overview of Contribution](#overview)
3
+
2.[Creating Issues](#creatingissues)
4
+
3.[Contributing Text or Code](#textcode)
5
+
*[Set-Up Development Environment](#devenvironmment)
6
+
*[Clone the Source Code](#clone)
7
+
*[Install PlantCV dependencies](#install)
8
+
*[Create a Branch](#branch)
9
+
*[Work and Commit](#commit)
10
+
*[Testing and documenting your code](#testdoc)
11
+
*[Publish and Create Pull Request](#publish)
12
+
4.[Guidelines for New Features](#newfeatures)
13
+
*[New Function Style Guide](#style)
14
+
5.[Instructions for Adding A New Tutorial](#tutorial)
15
+
*[Create Your Tutorial Repository](#repo)
16
+
*[Add Your Tutorial to the Gallery Wall](#gallery)
17
+
18
+
## Overview Of What To Contribute <aname="overview"></a>
2
19
3
20
This document aims to give an overview of how to contribute to PlantCV.
4
21
We encourage contributions in a variety of forms. There are
@@ -14,10 +31,11 @@ There are many ways to contribute:
14
31
* Add unit tests
15
32
* Revise existing code
16
33
* Add or revise documentation
34
+
* Add, update, or revise a use-case tutorial
17
35
18
36
If you need any help, please contact us.
19
37
20
-
## Creating Issues
38
+
## Creating Issues <aname="creatingissues"></a>
21
39
22
40
- Make sure you have a GitHub account.
23
41
- Search GitHub and Google to see if your issue has already been reported
@@ -27,21 +45,19 @@ If you need any help, please contact us.
27
45
- Make sure you fill in the earliest version that you know has the issue.
28
46
- Where applicable, provide the full workflow prior to the error and the image getting analyzed.
29
47
30
-
## Contributing Text or Code
31
-
32
-
### Overview
48
+
## Contributing Text Or Code <aname="textcode"></a>
33
49
34
50
When you add a significant **new feature**, please create an issue
35
51
first, to allow others to comment and give feedback.
36
52
37
-
When you have created a new feature or other changes to existing
53
+
**Adding Or Changing Code**When you have created a new feature or other changes to existing
38
54
code, create a 'pull request'.
39
55
40
-
**Branching and Pull Requests**: All contributors to PlantCV code or documentation are required to use the
56
+
**Branching And Pull Requests**: All contributors to PlantCV code or documentation are required to use the
41
57
*feature branch workflow* (below) in order to allow pull
42
58
requests, automated testing, and code review.
43
59
44
-
### Setting up a development environment
60
+
### Setting Up A Development Environment <aname="devenvironmment"></a>
45
61
46
62
!!! note
47
63
Before setting up a development environment, choose between one of two methods for working with the PlantCV
@@ -50,18 +66,18 @@ requests, automated testing, and code review.
50
66
request to be added as a collaborator on the PlantCV repository so that you can work with it directly instead of
51
67
having to manage a separate repository.
52
68
53
-
#### Clone the source code from GitHub
69
+
#### Clone The Source Code From GitHub <aname="clone"></a>
54
70
55
71
After choosing a method above for accessing PlantCV source code, create a clone of the source code GitHub repository
56
72
using one of the methods described in the
57
73
[GitHub cloning a repository guide](https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/cloning-a-repository).
#### Create A Branch To Do Your Work <aname="branch"></a>
65
81
66
82
The PlantCV default branch is protected and does not allow direct modification. A better practice is to
67
83
[create a branch](https://docs.github.com/en/free-pro-team@latest/desktop/contributing-and-collaborating-using-github-desktop/managing-branches)
@@ -70,12 +86,12 @@ number. This makes it easier to find out the issue you are trying to solve and h
70
86
the branch. Calling a branch my-work is confusing. Names of branch can not have a space, and should be replaced with
71
87
a hyphen.
72
88
73
-
#### Work and commit
89
+
#### Work And Commit <aname="commit"></a>
74
90
75
91
Do your work and commit as you see fit to check your work into your branch. Descriptive commit messages and
76
92
descriptions are helpful for understanding the purpose of changes.
77
93
78
-
#### Testing and documenting your code
94
+
#### Testing And Documenting Your Code <aname="testdoc"></a>
79
95
80
96
In addition to adding a new feature, test your code thoroughly:
81
97
@@ -87,18 +103,18 @@ the coverage the more likely we are to catch problematic pull requests). To incl
87
103
tests (to make sure they aren't broken by future pull requests) we need a 'unit test' or set of 'unit tests' (if you
88
104
need more than one test to cover function options).
89
105
90
-
Existing unit tests can be found in `tests/tests.py` as examples.
91
-
The data to support unit tests can be found in the `tests/*data/`directories.
106
+
Existing unit tests can be found in `tests/` as examples.
107
+
The data to support unit tests can be found in the `tests/testdata/`directory.
92
108
93
-
If you are updating existing code, make sure that the `test.py`
94
-
script passes on the function you modified. Testing locally can be done with pytest:
109
+
If you are updating existing code, make sure that the test(s) pass on the function you modified.
110
+
Testing locally can be done with pytest:
95
111
96
112
```bash
97
-
pytest tests/tests.py
113
+
py.test --cov=plantcv
98
114
99
115
# Or you can just run a subset of tests to save time
100
116
# This will run all tests with "analyze" in the test name
101
-
pytest tests/tests.py -k analyze
117
+
py.test --cov=plantcv -k analyze
102
118
103
119
```
104
120
@@ -108,11 +124,11 @@ be added to the `mkdocs.yml` file. You can test that your new documentation can
108
124
mkdocs from the root of your local plantcv repository.
109
125
110
126
```bash
111
-
mkdocs build --theme readthedocs --site-dir _site
127
+
mkdocs serve --theme readthedocs
112
128
113
129
```
114
130
115
-
#### Publish your branch to GitHub and create a Pull Request
131
+
#### Publish Your Branch To GitHub And Create A Pull Request <aname="publish"></a>
116
132
117
133
[Publishing your branch](https://docs.github.com/en/free-pro-team@latest/desktop/contributing-and-collaborating-using-github-desktop/managing-branches#publishing-a-branch)
118
134
to GitHub will make it available for creating a pull request between the updates and the default branch of PlantCV.
@@ -128,7 +144,7 @@ will automatically update when the branch is updated. Once tests pass, coverage
128
144
review is approved, the branch will be merged with the default branch and the updates are now part of the latest
129
145
version of PlantCV!
130
146
131
-
### Guidelines for adding new features
147
+
### Guidelines For Adding New Features <aname="newfeatures"></a>
132
148
133
149
In general, new contributions to PlantCV should benefit multiple users
134
150
and extend the image processing or trait analysis power of PlantCV.
@@ -147,7 +163,7 @@ We do hope that if you are contributing new methods to PlantCV, you are also con
147
163
tests for your functions (described below), because you understand your code/functionality best. If you have questions
148
164
or need help don't hesitate to ask [here](https://github.com/danforthcenter/plantcv/issues).
149
165
150
-
#### New function style guide
166
+
#### New function Style Guide <aname="styleguide"></a>
### Instructions for Adding A New Tutorial <aname="tutorial"></a>
283
+
284
+
We are always looking for new examples of how people are applying
285
+
PlantCV to their research. You can send us a Jupyter Notebook and any required sample data or
286
+
you can directly contrubute your tutorial. These instructions also apply to updating existing tutorials
287
+
that might break wth new versions of PlantCV.
288
+
289
+
#### Create Your Tutorial Repository <aname="repo"></a>
290
+
291
+
1. Create a new repository on GitHub (Please consider creating your repo within an instituional account rather than a personal account e.g. Danforth Center). The name should start with plantcv-tutorial. When you make this repo you can use the option to import the tutorial template from `https://github.com/danforthcenter/plantcv-tutorial-template`
292
+
293
+
2. If you don't import the tutorial template when you make your repo intitally you can clone the [tutorial template repository](https://github.com/danforthcenter/plantcv-tutorial-template) and copy the files and folders from the template repository to your tutorial repository
294
+
295
+
3. Update the `README` and `index.ipynb` files with your tutorial content, including data (make sure you are updating or using the correct documentation branch, e.g. release-4.0)
296
+
297
+
4. Add an image called `tutorial_card.png` to the repo, this will be used on the gallery webpage. The image should be approximately square and have a width of 200px.
298
+
299
+
5. Follow the instructions to create a Binder button in the readme
300
+
301
+
6. Commit the changes to your tutorial github repository
302
+
303
+
7. Go to your repo online and test the 'Launch Binder' button for your repo
304
+
305
+
#### Add Your Tutorial To the PlantCV Tutorial Gallery <aname="gallery"></a>
306
+
307
+
1. In your PlantCV repo make a new branch (make sure your branch is based off the version you are working on e.g. release-4.0)
308
+
309
+
2. Go to `/plantcv/docs/tutorials.md`, add a section for your new tutorial or update the binder links and link to your tutorial wall image
310
+
311
+
3. Either go to `/plantcv/docs/tutorials/'yourtutorialname'` and update the binder links and nb viewer links for your tutorial or go to `/plantcv/docs/tutorials/`
312
+
and add a doc with your tutorial name (use an exisiting tutorial as an example)
313
+
314
+
4. While in your plantcv directory check the build of the documentation on the command line by the command:
315
+
```
316
+
mkdocs serve --theme readthedocs
317
+
```
318
+
5. If everything looks okay then commit changes and make a pull request (make sure that pull request is for the for version you are working on).
Using [Jupyter Notebooks](jupyter.md) it is possible to interactively click to collect coordinates from an image, which can be used in various downstream applications. Left click on the image to collect a point. Right click removes the
- points - Coordinates (x,y) of the collected points as a list of tuples
16
+
17
+
-**Context:**
18
+
- Used to define a list of coordinates of interest.
19
+
- For example the [`pcv.roi.custom`](roi_custom.md) function defines a polygon Region of Interest based on a list of vertices, which can be labor intensive to define but is streamlined with the ability to click for point collection.
20
+
- The list of vertices output has also shown to be helpful while using [pcv.roi.multi](roi_multi.md) in cases where centers are defined with a custom list of vertices.
21
+
-**Example use:**
22
+
- Below
23
+
24
+
25
+
```python
26
+
from plantcv import plantcv as pcv
27
+
28
+
# Create an instance of the Points class
29
+
marker = pcv.Points(img=img, figsize=(12,6))
30
+
31
+
# Click on the plotted image to collect coordinates
32
+
33
+
# Use the identified coordinates to create a custom polygon ROI
* Object hyperspectral parameters: see the [analyze spectral](analyze_spectral.md) and [analyze index](analyze_index.md) functions.
122
+
* Object hyperspectral parameters: see the [analyze.spectral_reflectance](analyze_spectral_reflectance.md) and [analyze.spectral_index](analyze_spectral_index.md) functions.
125
123
* Morphological parameters: see the [morphology tutorial](tutorials/morphology_tutorial.md) for examples of characteristics such as stem height,
0 commit comments