openforis-whisp 2.0.0a3__tar.gz → 2.0.0a5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (17) hide show
  1. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/PKG-INFO +60 -73
  2. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/README.md +59 -72
  3. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/pyproject.toml +1 -1
  4. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/src/openforis_whisp/data_conversion.py +176 -54
  5. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/src/openforis_whisp/datasets.py +7 -17
  6. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/src/openforis_whisp/parameters/config_runtime.py +1 -1
  7. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/src/openforis_whisp/parameters/lookup_context_and_metadata.csv +1 -1
  8. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/src/openforis_whisp/parameters/lookup_gee_datasets.csv +2 -3
  9. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/src/openforis_whisp/risk.py +24 -30
  10. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/src/openforis_whisp/stats.py +206 -25
  11. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/src/openforis_whisp/utils.py +3 -3
  12. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/LICENSE +0 -0
  13. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/src/openforis_whisp/__init__.py +0 -0
  14. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/src/openforis_whisp/logger.py +0 -0
  15. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/src/openforis_whisp/parameters/__init__.py +0 -0
  16. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/src/openforis_whisp/pd_schemas.py +0 -0
  17. {openforis_whisp-2.0.0a3 → openforis_whisp-2.0.0a5}/src/openforis_whisp/reformat.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openforis-whisp
3
- Version: 2.0.0a3
3
+ Version: 2.0.0a5
4
4
  Summary: Whisp (What is in that plot) is an open-source solution which helps to produce relevant forest monitoring information and support compliance with deforestation-related regulations.
5
5
  License: MIT
6
6
  Keywords: whisp,geospatial,data-processing
@@ -59,7 +59,6 @@ Description-Content-Type: text/markdown
59
59
  - [Whisp pathways](#whisp_pathways)
60
60
  - [Whisp datasets](#whisp_datasets)
61
61
  - [Whisp notebooks](#whisp_notebooks)
62
- - [System setup](#whisp_setup)
63
62
  - [Add data layers](#whisp_add_data)
64
63
  - [Contribute to the code](#whisp_contribute)
65
64
  - [Code of conduct](#whisp_conduct)
@@ -78,8 +77,6 @@ Description-Content-Type: text/markdown
78
77
 
79
78
 
80
79
  ## Whisp datasets <a name="whisp_datasets"></a>
81
- All output columns from Whisp are described in [this excel file](https://github.com/forestdatapartnership/whisp/blob/main/whisp_columns.xlsx)
82
-
83
80
  ***Whisp*** implements the convergence of evidence approach by providing a transparent and public processing flow using datasets covering the following categories:
84
81
 
85
82
  1) Tree and forest cover (at the end of 2020);
@@ -87,27 +84,39 @@ Description-Content-Type: text/markdown
87
84
  3) Disturbances **before 2020** (i.e., degradation or deforestation until 2020-12-31);
88
85
  4) Disturbances **after 2020** (i.e., degradation or deforestation from 2021-01-01 onward).
89
86
 
87
+ Additional categories are specific for the timber commodity, considering a harvesting date in 2023:
88
+
89
+ 5) Primary forests in 2020;
90
+ 6) Naturally regenerating forests in 2020;
91
+ 7) Planted and plantation forests in 2020;
92
+ 8) Planted and plantation forests in 2023;
93
+ 9) Treecover in 2023;
94
+ 10) Commodities or croplands in 2023.
95
+ 11) Logging concessions;
96
+
90
97
  There are multiple datasets for each category. Find the full current [list of datasets used in Whisp here](https://github.com/forestdatapartnership/whisp/blob/main/layers_description.md).
91
- Whisp checks the plots provided by the user by running zonal statistics on them to answer the following questions:
98
+
99
+ ### Whisp risk assessment <a name="whisp_risk"></a>
100
+
101
+ Whisp checks the plots provided by the user by running zonal statistics on them to answer the following questions:
92
102
 
93
103
  1) Was there tree cover in 2020?
94
104
  2) Were there commodity plantations or other agricultural uses in 2020?
95
105
  3) Were there disturbances until 2020-12-31?
96
106
  4) Were there disturbances after 2020-12-31 / starting 2021-01-01?
97
107
 
98
- If no treecover dataset indicates any tree cover for a plot by the end of 2020, **Whisp will categorize the deforestation risk as low.**
99
-
100
- If one or more treecover datasets indicate tree cover on a plot by the end of 2020, but a commodity dataset indicates agricultural use by the end of 2020, **Whisp will categorize the deforestation risk as low.**
101
-
102
- If treecover datasets indicate tree cover on a plot by late 2020, no commodity datasets indicate agricultural use, but a disturbance dataset indicates disturbances before the end of 2020, **Whisp will categorize the deforestation risk as <u>low</u>.** Such deforestation has happened before 2020, which aligns with the cutoff date for legislation such as EUDR, and is therefore not considered high risk.
103
-
104
- Now, if the datasets under 1., 2. & 3. indicate that there was tree cover, but no agriculture and no disturbances before or by the end of 2020, the Whisp algorithm checks whether degradation or deforestation have been reported in a disturbance dataset after 2020-12-31. If they have, **Whisp will categorize the deforestation risk as <u>high</u>.** <br>
105
- However, under the same circumstances but with <u>no</u> disturbances reported after 2020-12-31 there is insufficient evidence and the **Whisp output will be "More info needed".** Such can be the case for, e.g., cocoa or coffee grown under the shade of treecover or agroforestry.
108
+ And specifically for the timber commodity, considering a harvesting date in 2023:
106
109
 
110
+ 5) Were there primary forests in 2020?
111
+ 6) Were there naturally regenerating forests in 2020?
112
+ 7) Were there planted and plantation forests in 2020?
113
+ 8) Were there planted and plantation forests in 2023?
114
+ 9) Was there treecover in 2023?
115
+ 10) Were there commodity plantations or other agricultural uses in 2023?
116
+ 11) Is it part of a logging concession?
107
117
 
108
- *The Whisp algorithm for **Perennial Crops** visualized:*
109
- ![CoE_Graphic 5](https://github.com/user-attachments/assets/007b5f50-3939-4707-95fa-98be4d56745f)
110
118
  The Whisp algorithm outputs multiple statistical columns with disaggregated data from the input datasets, followed by aggregated indicator columns, and the final risk assessment columns.
119
+ All output columns from Whisp are described in [this excel file](https://github.com/forestdatapartnership/whisp/blob/main/whisp_columns.xlsx)
111
120
 
112
121
  The **relevant risk assessment column depends on the commodity** in question:
113
122
 
@@ -142,47 +151,28 @@ The **relevant risk assessment column depends on the commodity** in question:
142
151
  </tr>
143
152
  </table>
144
153
 
145
- The decision tree for the timber risk assessment slightly differs from the above. For more information see below.
146
-
147
-
154
+ *The Whisp algorithm for **Perennial Crops** visualized:*
155
+ ![CoE_Graphic 5](https://github.com/user-attachments/assets/007b5f50-3939-4707-95fa-98be4d56745f)
156
+
157
+ If no treecover dataset indicates any tree cover for a plot by the end of 2020, **Whisp will categorize the deforestation risk as low.**
148
158
 
159
+ If one or more treecover datasets indicate tree cover on a plot by the end of 2020, but a commodity dataset indicates agricultural use by the end of 2020, **Whisp will categorize the deforestation risk as low.**
149
160
 
150
- ## Whisp datasets for timber <a name="whisp_datasets_timber"></a>
151
- ***Whisp*** implements the convergence of evidence approach by providing a transparent and public processing flow using datasets covering the following categories:
152
- 1) Tree and forest cover (at the end of 2020);
153
- 2) Commodities (i.e., crop plantations and other agricultural uses at the end of 2020);
154
- 3) Disturbances **before 2020** (i.e., degradation or deforestation until 2020-12-31);
155
- 4) Disturbances **after 2020** (i.e., degradation or deforestation from 2021-01-01 onward).
156
- 5) Primary forests in 2020;
157
- 6) Naturally regenerating forests in 2020;
158
- 7) Planted and plantation forests in 2020;
159
- 8) Planted and plantation forests in 2023;
160
- 9) Treecover in 2023;
161
- 10) Commodities or croplands in 2023.
162
- 11) Logging concessions;
161
+ If treecover datasets indicate tree cover on a plot by late 2020, no commodity datasets indicate agricultural use, but a disturbance dataset indicates disturbances before the end of 2020, **Whisp will categorize the deforestation risk as <u>low</u>.** Such deforestation has happened before 2020, which aligns with the cutoff date for legislation such as EUDR, and is therefore not considered high risk.
163
162
 
164
- There are multiple datasets for each category. Find the full current [list of datasets used in Whisp here](https://github.com/forestdatapartnership/whisp/blob/main/layers_description.md).
165
- Whisp checks the plots provided by the user by running zonal statistics on them to answer the following questions:
163
+ Now, if the datasets under 1., 2. & 3. indicate that there was tree cover, but no agriculture and no disturbances before or by the end of 2020, the Whisp algorithm checks whether degradation or deforestation have been reported in a disturbance dataset after 2020-12-31. If they have, **Whisp will categorize the deforestation risk as <u>high</u>.** <br>
164
+ However, under the same circumstances but with <u>no</u> disturbances reported after 2020-12-31 there is insufficient evidence and the **Whisp output will be "More info needed".** Such can be the case for, e.g., cocoa or coffee grown under the shade of treecover or agroforestry.
166
165
 
167
- 1) Was there tree cover in 2020?
168
- 2) Were there commodity plantations or other agricultural uses in 2020?
169
- 3) Were there disturbances until 2020-12-31?
170
- 4) Were there disturbances after 2020-12-31 / starting 2021-01-01?
171
- 5) Were there primary forests in 2020?
172
- 6) Were there naturally regenerating forests in 2020?
173
- 7) Were there planted and plantation forests in 2020?
174
- 8) Were there planted and plantation forests in 2023?
175
- 9) Was there treecover in 2023?
176
- 10) Were there commodity plantations or other agricultural uses in 2023?
177
- 11) Were there logging concessions?
178
166
 
179
- # Run Whisp python package from a notebook
167
+ ## Run Whisp python package from a notebook <a name="whisp_notebooks"></a>
180
168
 
181
169
  For most users we suggest using the Whisp App to process their plot data. But for some, using the python package directly will fit their workflow.
182
170
 
183
171
  A simple example of the package functionality can be seen in this [Colab Notebook](https://github.com/forestdatapartnership/whisp/blob/main/notebooks/Colab_whisp_geojson_to_csv.ipynb)
184
172
 
185
- ## Requirements for running the package
173
+ For an example notebook adapted for running locally (or in Sepal), see: [whisp_geojson_to_csv.ipynb](https://github.com/forestdatapartnership/whisp/blob/main/notebooks/whisp_geojson_to_csv.ipynb) or if datasets are very large, see [whisp_geojson_to_drive.ipynb](https://github.com/forestdatapartnership/whisp/blob/main/notebooks/whisp_geojson_to_drive.ipynb)
174
+
175
+ ### Requirements for running the package
186
176
 
187
177
  - A Google Earth Engine (GEE) account.
188
178
  - A registered cloud GEE project.
@@ -190,7 +180,8 @@ The **relevant risk assessment column depends on the commodity** in question:
190
180
 
191
181
  More info on Whisp can be found in [here](https://openknowledge.fao.org/items/e9284dc7-4b19-4f9c-b3e1-e6c142585865)
192
182
 
193
- ## Python package installation
183
+
184
+ ### Python package installation
194
185
 
195
186
  The Whisp package is available on pip
196
187
  https://pypi.org/project/openforis-whisp/
@@ -202,15 +193,15 @@ The **relevant risk assessment column depends on the commodity** in question:
202
193
  pip install --pre openforis-whisp
203
194
  ```
204
195
 
205
- If running locally we recommend a [virtual environment](https://docs.python.org/3/library/venv.html) to keep your main python installation clean.
196
+ If running the package locally we recommend a [virtual environment](https://docs.python.org/3/library/venv.html) to keep your main python installation clean. For users running the package in Sepal see [here](https://docs.sepal.io/en/latest/cli/python.html#virtual-environment).
206
197
 
207
198
  The package relies upon the google earth engine api being setup correctly using a registered cloud project.
208
199
 
209
- More info on Whisp can be found in [here](https://openknowledge.fao.org/items/e9284dc7-4b19-4f9c-b3e1-e6c142585865)
200
+ More info on Whisp can be found [here](https://openknowledge.fao.org/items/e9284dc7-4b19-4f9c-b3e1-e6c142585865)
210
201
 
211
202
 
212
203
 
213
- ## How to add data layers to Whisp
204
+ ## How to add data layers to Whisp <a name="whisp_add_data"></a>
214
205
 
215
206
 
216
207
 
@@ -253,12 +244,24 @@ Before submitting a request, consider the following:
253
244
  ### Adding your own data directly
254
245
 
255
246
 
256
-
257
247
  To add your own data you will need some coding experience as well as familiarity with GitHub and Google Earth Engine.
258
248
 
249
+ This approach is for those who want to run a bespoke analysis combining their own data with those already in Whisp.
259
250
 
260
- Firstly follow the steps to install the package in editable mode (as detailed below in Contributing to the Whisp code base). Once in editable mode you are running the Whisp package locally based on a cloned version of the code. This approach is for those who want to run a bespoke analysis combining their own data with those already in Whisp. If, however, you think the datasets are of use to the wider community and you have the code running smoothly, you can make a pull request from a forked repository.
251
+ Firstly follow the steps below to install the package in editable mode.
261
252
 
253
+ As with the regular pip installation, we recommend a separate [virtual environment](https://docs.python.org/3/library/venv.html) for running in editable mode. For Sepal users see [here](https://docs.sepal.io/en/latest/cli/python.html#virtual-environment).
254
+
255
+ ```bash
256
+
257
+ git clone https://github.com/forestdatapartnership/whisp.git
258
+
259
+ cd whisp/
260
+
261
+ pip install -e .[dev]
262
+
263
+ ```
264
+ Once in editable mode you are running the Whisp package locally based on a cloned version of the code.
262
265
 
263
266
 
264
267
 
@@ -294,7 +297,7 @@ For example, if it is a dataset for tree cover in 2000, then add `'treecover'` u
294
297
 
295
298
  ```python
296
299
 
297
- def nBR_my_custom_dataset_prep():
300
+ def my_custom_dataset_prep():
298
301
 
299
302
  image = ee.Image("MY/GEE/DATASET")
300
303
 
@@ -309,7 +312,6 @@ return binary.rename("My_custom_dataset")
309
312
  ---
310
313
 
311
314
 
312
-
313
315
  We are working on ways to make this process smoother. However, in the meantime do contact us through the [issues page on GitHub](https://github.com/forestdatapartnership/whisp/issues), or via the Open Foris email, if this functionality is useful to you or you need help.
314
316
 
315
317
 
@@ -318,28 +320,14 @@ We are working on ways to make this process smoother. However, in the meantime d
318
320
 
319
321
 
320
322
 
321
- ## Contributing to the Whisp code base
322
-
323
-
324
-
325
- Contributions to the Whisp code in GitHub are welcome. They can be made by forking the repository, making and pushing the required changes, then making a pull request to the Whisp repository. After briefly reviewing the request, we can make a branch for which to make a new pull request to. After final checks, we can then incorporate the code into the main branch. If in doubt, get in contact first or log as an issue [here](https://github.com/forestdatapartnership/whisp/issues/).
326
-
323
+ ## Contributing to the Whisp code base <a name="whisp_contribute"></a>
327
324
 
325
+ Contributions to the Whisp code in GitHub are welcome. These could be additional functionality, datasets or just cleaner code! Contributions can be made by forking the repository, making and pushing the required changes, then making a pull request to the Whisp repository. After briefly reviewing the request, we can make a branch for which to make a new pull request to. After final checks, we can then incorporate the code into the main branch. If in doubt, get in contact first or log as an issue [here](https://github.com/forestdatapartnership/whisp/issues/).
328
326
 
329
- Install the package in editable mode:
330
327
 
328
+ Install the package in editable mode (see Adding your own data directly above):
331
329
 
332
- ```bash
333
-
334
- git clone https://github.com/forestdatapartnership/whisp.git
335
-
336
- cd whisp/
337
-
338
- pip install -e .[dev]
339
-
340
- ```
341
-
342
- Add additional dependencies required for testing and running pre-commit hooks:
330
+ Then add additional dependencies required for testing and running pre-commit hooks:
343
331
 
344
332
 
345
333
  ```bash
@@ -352,7 +340,6 @@ pre-commit install
352
340
  You should be able to run the Pytest suite by simply running the `pytest` command from the repo's root folder.
353
341
 
354
342
 
355
-
356
343
  Please read the [contributing guidelines](contributing_guidelines.md) for good practice recommendations
357
344
 
358
345
 
@@ -22,7 +22,6 @@
22
22
  - [Whisp pathways](#whisp_pathways)
23
23
  - [Whisp datasets](#whisp_datasets)
24
24
  - [Whisp notebooks](#whisp_notebooks)
25
- - [System setup](#whisp_setup)
26
25
  - [Add data layers](#whisp_add_data)
27
26
  - [Contribute to the code](#whisp_contribute)
28
27
  - [Code of conduct](#whisp_conduct)
@@ -41,8 +40,6 @@
41
40
 
42
41
 
43
42
  ## Whisp datasets <a name="whisp_datasets"></a>
44
- All output columns from Whisp are described in [this excel file](https://github.com/forestdatapartnership/whisp/blob/main/whisp_columns.xlsx)
45
-
46
43
  ***Whisp*** implements the convergence of evidence approach by providing a transparent and public processing flow using datasets covering the following categories:
47
44
 
48
45
  1) Tree and forest cover (at the end of 2020);
@@ -50,27 +47,39 @@
50
47
  3) Disturbances **before 2020** (i.e., degradation or deforestation until 2020-12-31);
51
48
  4) Disturbances **after 2020** (i.e., degradation or deforestation from 2021-01-01 onward).
52
49
 
50
+ Additional categories are specific for the timber commodity, considering a harvesting date in 2023:
51
+
52
+ 5) Primary forests in 2020;
53
+ 6) Naturally regenerating forests in 2020;
54
+ 7) Planted and plantation forests in 2020;
55
+ 8) Planted and plantation forests in 2023;
56
+ 9) Treecover in 2023;
57
+ 10) Commodities or croplands in 2023.
58
+ 11) Logging concessions;
59
+
53
60
  There are multiple datasets for each category. Find the full current [list of datasets used in Whisp here](https://github.com/forestdatapartnership/whisp/blob/main/layers_description.md).
54
- Whisp checks the plots provided by the user by running zonal statistics on them to answer the following questions:
61
+
62
+ ### Whisp risk assessment <a name="whisp_risk"></a>
63
+
64
+ Whisp checks the plots provided by the user by running zonal statistics on them to answer the following questions:
55
65
 
56
66
  1) Was there tree cover in 2020?
57
67
  2) Were there commodity plantations or other agricultural uses in 2020?
58
68
  3) Were there disturbances until 2020-12-31?
59
69
  4) Were there disturbances after 2020-12-31 / starting 2021-01-01?
60
70
 
61
- If no treecover dataset indicates any tree cover for a plot by the end of 2020, **Whisp will categorize the deforestation risk as low.**
62
-
63
- If one or more treecover datasets indicate tree cover on a plot by the end of 2020, but a commodity dataset indicates agricultural use by the end of 2020, **Whisp will categorize the deforestation risk as low.**
64
-
65
- If treecover datasets indicate tree cover on a plot by late 2020, no commodity datasets indicate agricultural use, but a disturbance dataset indicates disturbances before the end of 2020, **Whisp will categorize the deforestation risk as <u>low</u>.** Such deforestation has happened before 2020, which aligns with the cutoff date for legislation such as EUDR, and is therefore not considered high risk.
66
-
67
- Now, if the datasets under 1., 2. & 3. indicate that there was tree cover, but no agriculture and no disturbances before or by the end of 2020, the Whisp algorithm checks whether degradation or deforestation have been reported in a disturbance dataset after 2020-12-31. If they have, **Whisp will categorize the deforestation risk as <u>high</u>.** <br>
68
- However, under the same circumstances but with <u>no</u> disturbances reported after 2020-12-31 there is insufficient evidence and the **Whisp output will be "More info needed".** Such can be the case for, e.g., cocoa or coffee grown under the shade of treecover or agroforestry.
71
+ And specifically for the timber commodity, considering a harvesting date in 2023:
69
72
 
73
+ 5) Were there primary forests in 2020?
74
+ 6) Were there naturally regenerating forests in 2020?
75
+ 7) Were there planted and plantation forests in 2020?
76
+ 8) Were there planted and plantation forests in 2023?
77
+ 9) Was there treecover in 2023?
78
+ 10) Were there commodity plantations or other agricultural uses in 2023?
79
+ 11) Is it part of a logging concession?
70
80
 
71
- *The Whisp algorithm for **Perennial Crops** visualized:*
72
- ![CoE_Graphic 5](https://github.com/user-attachments/assets/007b5f50-3939-4707-95fa-98be4d56745f)
73
81
  The Whisp algorithm outputs multiple statistical columns with disaggregated data from the input datasets, followed by aggregated indicator columns, and the final risk assessment columns.
82
+ All output columns from Whisp are described in [this excel file](https://github.com/forestdatapartnership/whisp/blob/main/whisp_columns.xlsx)
74
83
 
75
84
  The **relevant risk assessment column depends on the commodity** in question:
76
85
 
@@ -105,47 +114,28 @@ The **relevant risk assessment column depends on the commodity** in question:
105
114
  </tr>
106
115
  </table>
107
116
 
108
- The decision tree for the timber risk assessment slightly differs from the above. For more information see below.
109
-
110
-
117
+ *The Whisp algorithm for **Perennial Crops** visualized:*
118
+ ![CoE_Graphic 5](https://github.com/user-attachments/assets/007b5f50-3939-4707-95fa-98be4d56745f)
119
+
120
+ If no treecover dataset indicates any tree cover for a plot by the end of 2020, **Whisp will categorize the deforestation risk as low.**
111
121
 
122
+ If one or more treecover datasets indicate tree cover on a plot by the end of 2020, but a commodity dataset indicates agricultural use by the end of 2020, **Whisp will categorize the deforestation risk as low.**
112
123
 
113
- ## Whisp datasets for timber <a name="whisp_datasets_timber"></a>
114
- ***Whisp*** implements the convergence of evidence approach by providing a transparent and public processing flow using datasets covering the following categories:
115
- 1) Tree and forest cover (at the end of 2020);
116
- 2) Commodities (i.e., crop plantations and other agricultural uses at the end of 2020);
117
- 3) Disturbances **before 2020** (i.e., degradation or deforestation until 2020-12-31);
118
- 4) Disturbances **after 2020** (i.e., degradation or deforestation from 2021-01-01 onward).
119
- 5) Primary forests in 2020;
120
- 6) Naturally regenerating forests in 2020;
121
- 7) Planted and plantation forests in 2020;
122
- 8) Planted and plantation forests in 2023;
123
- 9) Treecover in 2023;
124
- 10) Commodities or croplands in 2023.
125
- 11) Logging concessions;
124
+ If treecover datasets indicate tree cover on a plot by late 2020, no commodity datasets indicate agricultural use, but a disturbance dataset indicates disturbances before the end of 2020, **Whisp will categorize the deforestation risk as <u>low</u>.** Such deforestation has happened before 2020, which aligns with the cutoff date for legislation such as EUDR, and is therefore not considered high risk.
126
125
 
127
- There are multiple datasets for each category. Find the full current [list of datasets used in Whisp here](https://github.com/forestdatapartnership/whisp/blob/main/layers_description.md).
128
- Whisp checks the plots provided by the user by running zonal statistics on them to answer the following questions:
126
+ Now, if the datasets under 1., 2. & 3. indicate that there was tree cover, but no agriculture and no disturbances before or by the end of 2020, the Whisp algorithm checks whether degradation or deforestation have been reported in a disturbance dataset after 2020-12-31. If they have, **Whisp will categorize the deforestation risk as <u>high</u>.** <br>
127
+ However, under the same circumstances but with <u>no</u> disturbances reported after 2020-12-31 there is insufficient evidence and the **Whisp output will be "More info needed".** Such can be the case for, e.g., cocoa or coffee grown under the shade of treecover or agroforestry.
129
128
 
130
- 1) Was there tree cover in 2020?
131
- 2) Were there commodity plantations or other agricultural uses in 2020?
132
- 3) Were there disturbances until 2020-12-31?
133
- 4) Were there disturbances after 2020-12-31 / starting 2021-01-01?
134
- 5) Were there primary forests in 2020?
135
- 6) Were there naturally regenerating forests in 2020?
136
- 7) Were there planted and plantation forests in 2020?
137
- 8) Were there planted and plantation forests in 2023?
138
- 9) Was there treecover in 2023?
139
- 10) Were there commodity plantations or other agricultural uses in 2023?
140
- 11) Were there logging concessions?
141
129
 
142
- # Run Whisp python package from a notebook
130
+ ## Run Whisp python package from a notebook <a name="whisp_notebooks"></a>
143
131
 
144
132
  For most users we suggest using the Whisp App to process their plot data. But for some, using the python package directly will fit their workflow.
145
133
 
146
134
  A simple example of the package functionality can be seen in this [Colab Notebook](https://github.com/forestdatapartnership/whisp/blob/main/notebooks/Colab_whisp_geojson_to_csv.ipynb)
147
135
 
148
- ## Requirements for running the package
136
+ For an example notebook adapted for running locally (or in Sepal), see: [whisp_geojson_to_csv.ipynb](https://github.com/forestdatapartnership/whisp/blob/main/notebooks/whisp_geojson_to_csv.ipynb) or if datasets are very large, see [whisp_geojson_to_drive.ipynb](https://github.com/forestdatapartnership/whisp/blob/main/notebooks/whisp_geojson_to_drive.ipynb)
137
+
138
+ ### Requirements for running the package
149
139
 
150
140
  - A Google Earth Engine (GEE) account.
151
141
  - A registered cloud GEE project.
@@ -153,7 +143,8 @@ The **relevant risk assessment column depends on the commodity** in question:
153
143
 
154
144
  More info on Whisp can be found in [here](https://openknowledge.fao.org/items/e9284dc7-4b19-4f9c-b3e1-e6c142585865)
155
145
 
156
- ## Python package installation
146
+
147
+ ### Python package installation
157
148
 
158
149
  The Whisp package is available on pip
159
150
  https://pypi.org/project/openforis-whisp/
@@ -165,15 +156,15 @@ The **relevant risk assessment column depends on the commodity** in question:
165
156
  pip install --pre openforis-whisp
166
157
  ```
167
158
 
168
- If running locally we recommend a [virtual environment](https://docs.python.org/3/library/venv.html) to keep your main python installation clean.
159
+ If running the package locally we recommend a [virtual environment](https://docs.python.org/3/library/venv.html) to keep your main python installation clean. For users running the package in Sepal see [here](https://docs.sepal.io/en/latest/cli/python.html#virtual-environment).
169
160
 
170
161
  The package relies upon the google earth engine api being setup correctly using a registered cloud project.
171
162
 
172
- More info on Whisp can be found in [here](https://openknowledge.fao.org/items/e9284dc7-4b19-4f9c-b3e1-e6c142585865)
163
+ More info on Whisp can be found [here](https://openknowledge.fao.org/items/e9284dc7-4b19-4f9c-b3e1-e6c142585865)
173
164
 
174
165
 
175
166
 
176
- ## How to add data layers to Whisp
167
+ ## How to add data layers to Whisp <a name="whisp_add_data"></a>
177
168
 
178
169
 
179
170
 
@@ -216,12 +207,24 @@ Before submitting a request, consider the following:
216
207
  ### Adding your own data directly
217
208
 
218
209
 
219
-
220
210
  To add your own data you will need some coding experience as well as familiarity with GitHub and Google Earth Engine.
221
211
 
212
+ This approach is for those who want to run a bespoke analysis combining their own data with those already in Whisp.
222
213
 
223
- Firstly follow the steps to install the package in editable mode (as detailed below in Contributing to the Whisp code base). Once in editable mode you are running the Whisp package locally based on a cloned version of the code. This approach is for those who want to run a bespoke analysis combining their own data with those already in Whisp. If, however, you think the datasets are of use to the wider community and you have the code running smoothly, you can make a pull request from a forked repository.
214
+ Firstly follow the steps below to install the package in editable mode.
224
215
 
216
+ As with the regular pip installation, we recommend a separate [virtual environment](https://docs.python.org/3/library/venv.html) for running in editable mode. For Sepal users see [here](https://docs.sepal.io/en/latest/cli/python.html#virtual-environment).
217
+
218
+ ```bash
219
+
220
+ git clone https://github.com/forestdatapartnership/whisp.git
221
+
222
+ cd whisp/
223
+
224
+ pip install -e .[dev]
225
+
226
+ ```
227
+ Once in editable mode you are running the Whisp package locally based on a cloned version of the code.
225
228
 
226
229
 
227
230
 
@@ -257,7 +260,7 @@ For example, if it is a dataset for tree cover in 2000, then add `'treecover'` u
257
260
 
258
261
  ```python
259
262
 
260
- def nBR_my_custom_dataset_prep():
263
+ def my_custom_dataset_prep():
261
264
 
262
265
  image = ee.Image("MY/GEE/DATASET")
263
266
 
@@ -272,7 +275,6 @@ return binary.rename("My_custom_dataset")
272
275
  ---
273
276
 
274
277
 
275
-
276
278
  We are working on ways to make this process smoother. However, in the meantime do contact us through the [issues page on GitHub](https://github.com/forestdatapartnership/whisp/issues), or via the Open Foris email, if this functionality is useful to you or you need help.
277
279
 
278
280
 
@@ -281,28 +283,14 @@ We are working on ways to make this process smoother. However, in the meantime d
281
283
 
282
284
 
283
285
 
284
- ## Contributing to the Whisp code base
285
-
286
-
287
-
288
- Contributions to the Whisp code in GitHub are welcome. They can be made by forking the repository, making and pushing the required changes, then making a pull request to the Whisp repository. After briefly reviewing the request, we can make a branch for which to make a new pull request to. After final checks, we can then incorporate the code into the main branch. If in doubt, get in contact first or log as an issue [here](https://github.com/forestdatapartnership/whisp/issues/).
289
-
286
+ ## Contributing to the Whisp code base <a name="whisp_contribute"></a>
290
287
 
288
+ Contributions to the Whisp code in GitHub are welcome. These could be additional functionality, datasets or just cleaner code! Contributions can be made by forking the repository, making and pushing the required changes, then making a pull request to the Whisp repository. After briefly reviewing the request, we can make a branch for which to make a new pull request to. After final checks, we can then incorporate the code into the main branch. If in doubt, get in contact first or log as an issue [here](https://github.com/forestdatapartnership/whisp/issues/).
291
289
 
292
- Install the package in editable mode:
293
290
 
291
+ Install the package in editable mode (see Adding your own data directly above):
294
292
 
295
- ```bash
296
-
297
- git clone https://github.com/forestdatapartnership/whisp.git
298
-
299
- cd whisp/
300
-
301
- pip install -e .[dev]
302
-
303
- ```
304
-
305
- Add additional dependencies required for testing and running pre-commit hooks:
293
+ Then add additional dependencies required for testing and running pre-commit hooks:
306
294
 
307
295
 
308
296
  ```bash
@@ -315,7 +303,6 @@ pre-commit install
315
303
  You should be able to run the Pytest suite by simply running the `pytest` command from the repo's root folder.
316
304
 
317
305
 
318
-
319
306
  Please read the [contributing guidelines](contributing_guidelines.md) for good practice recommendations
320
307
 
321
308
 
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "openforis-whisp"
7
- version = "2.0.0a3"
7
+ version = "2.0.0a5"
8
8
  description = "Whisp (What is in that plot) is an open-source solution which helps to produce relevant forest monitoring information and support compliance with deforestation-related regulations."
9
9
  repository = "https://github.com/forestdatapartnership/whisp"
10
10
  authors = ["Andy Arnell <and.arnell@fao.org>"]