openforis-whisp 3.0.0a7__tar.gz → 3.0.0a9__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 (21) hide show
  1. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/PKG-INFO +38 -124
  2. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/README.md +35 -120
  3. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/pyproject.toml +2 -1
  4. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/src/openforis_whisp/advanced_stats.py +247 -175
  5. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/src/openforis_whisp/datasets.py +414 -19
  6. openforis_whisp-3.0.0a9/src/openforis_whisp/parameters/lookup_gee_datasets.csv +223 -0
  7. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/src/openforis_whisp/reformat.py +8 -6
  8. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/src/openforis_whisp/risk.py +113 -29
  9. openforis_whisp-3.0.0a7/src/openforis_whisp/parameters/lookup_gee_datasets.csv +0 -200
  10. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/LICENSE +0 -0
  11. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/src/openforis_whisp/__init__.py +0 -0
  12. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/src/openforis_whisp/data_checks.py +0 -0
  13. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/src/openforis_whisp/data_conversion.py +0 -0
  14. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/src/openforis_whisp/logger.py +0 -0
  15. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/src/openforis_whisp/parameters/__init__.py +0 -0
  16. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/src/openforis_whisp/parameters/config_runtime.py +0 -0
  17. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/src/openforis_whisp/parameters/lookup_context_and_metadata.csv +0 -0
  18. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/src/openforis_whisp/parameters/lookup_gaul1_admin.py +0 -0
  19. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/src/openforis_whisp/pd_schemas.py +0 -0
  20. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/src/openforis_whisp/stats.py +0 -0
  21. {openforis_whisp-3.0.0a7 → openforis_whisp-3.0.0a9}/src/openforis_whisp/utils.py +0 -0
@@ -1,9 +1,8 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.3
2
2
  Name: openforis-whisp
3
- Version: 3.0.0a7
3
+ Version: 3.0.0a9
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
- License-File: LICENSE
7
6
  Keywords: whisp,geospatial,data-processing
8
7
  Author: Andy Arnell
9
8
  Author-email: andrew.arnell@fao.org
@@ -17,7 +16,6 @@ Classifier: Programming Language :: Python :: 3.10
17
16
  Classifier: Programming Language :: Python :: 3.11
18
17
  Classifier: Programming Language :: Python :: 3.12
19
18
  Classifier: Programming Language :: Python :: 3.13
20
- Classifier: Programming Language :: Python :: 3.14
21
19
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
20
  Requires-Dist: country_converter (>=0.7,<2.0.0)
23
21
  Requires-Dist: earthengine-api
@@ -31,6 +29,7 @@ Requires-Dist: pydantic-core (>=2.14.0,<3.0.0)
31
29
  Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
32
30
  Requires-Dist: rsa (>=4.2,<5.0.0)
33
31
  Requires-Dist: shapely (>=2.0.2,<3.0.0)
32
+ Project-URL: Changelog, https://github.com/forestdatapartnership/whisp/releases
34
33
  Project-URL: Documentation, https://github.com/forestdatapartnership/whisp#readme
35
34
  Project-URL: Development Branch, https://github.com/forestdatapartnership/whisp/tree/main
36
35
  Project-URL: Issues, https://github.com/forestdatapartnership/whisp/issues
@@ -64,6 +63,7 @@ Description-Content-Type: text/markdown
64
63
  - [Add data layers](#whisp_add_data)
65
64
  - [Contribute to the code](#whisp_contribute)
66
65
  - [Code of conduct](#whisp_conduct)
66
+ - [Feedback](#whisp_feedback)
67
67
 
68
68
  <br>
69
69
 
@@ -71,11 +71,11 @@ Description-Content-Type: text/markdown
71
71
  ***Whisp*** can currently be used directly or implemented in your own code through three different pathways:
72
72
 
73
73
 
74
- 1. The Whisp App with its simple interface can be used [right here](https://whisp.openforis.org/) or called from other software by [API](https://whisp.openforis.org/documentation/api-guide). The Whisp App currently supports the processing of up to 3,000 geometries per job. The original JS & Python code behind the Whisp App and API can be found [here](https://github.com/forestdatapartnership/whisp-app).
74
+ 1. The Whisp App with its simple interface can be accessed [here](https://whisp.openforis.org/) or called from other software by [API](https://whisp.openforis.org/documentation/api-guide). The Whisp App currently supports the processing of up to 3,000 geometries per job. The original JS & Python code behind the Whisp App and API can be found [here](https://github.com/forestdatapartnership/whisp-app).
75
75
 
76
76
  2. [Whisp in Earthmap](https://whisp.earthmap.org/?aoi=WHISP&boundary=plot1&layers=%7B%22CocoaETH%22%3A%7B%22opacity%22%3A1%7D%2C%22JRCForestMask%22%3A%7B%22opacity%22%3A1%7D%2C%22planet_rgb%22%3A%7B%22opacity%22%3A1%2C%22date%22%3A%222020-12%22%7D%7D&map=%7B%22center%22%3A%7B%22lat%22%3A7%2C%22lng%22%3A4%7D%2C%22zoom%22%3A3%2C%22mapType%22%3A%22satellite%22%7D&statisticsOpen=true) supports the visualization of geometries on actual maps with the possibility to toggle different relevant map products around tree cover, commodities and deforestation. It is practical for demonstration purposes and spot checks of single geometries but not recommended for larger datasets.
77
77
 
78
- 3. Datasets of any size, especially when holding more than 3,000 geometries, can be analyzed with Whisp through the [python package on pip](https://pypi.org/project/openforis-whisp/). See example [Colab Notebook](https://github.com/forestdatapartnership/whisp/blob/main/notebooks/Colab_whisp_geojson_to_csv.ipynb) for implementation with a geojson input. For the detailed procedure please go to the section [Whisp notebooks](#whisp_notebooks).
78
+ 3. Datasets of any size, especially when holding more than 3,000 geometries, can be analyzed with Whisp through the [python package on pip](https://pypi.org/project/openforis-whisp/). See example [Colab Notebook](https://github.com/forestdatapartnership/whisp/blob/main/notebooks/Colab_whisp_geojson_to_csv.ipynb) for implementation with a geojson input. For further notebooks processing options see [Whisp notebooks](#whisp_notebooks).
79
79
 
80
80
 
81
81
  ## Whisp datasets <a name="whisp_datasets"></a>
@@ -98,7 +98,7 @@ Additional categories are specific for the timber commodity, considering a harve
98
98
 
99
99
  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).
100
100
 
101
- ### Whisp risk assessment <a name="whisp_risk"></a>
101
+ ### Whisp risk assessment <a name="whisp_risk"></a>
102
102
 
103
103
  Whisp checks the plots provided by the user by running zonal statistics on them to answer the following questions:
104
104
 
@@ -155,24 +155,24 @@ The **relevant risk assessment column depends on the commodity** in question:
155
155
 
156
156
  *The Whisp algorithm for **Perennial Crops** visualized:*
157
157
  ![CoE_Graphic 5](https://github.com/user-attachments/assets/007b5f50-3939-4707-95fa-98be4d56745f)
158
-
158
+
159
159
  If no treecover dataset indicates any tree cover for a plot by the end of 2020, **Whisp will categorize the deforestation risk as low.**
160
160
 
161
161
  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.**
162
162
 
163
- 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
+ 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 (European Union Deforestation Risk), and is therefore not considered high risk.
164
164
 
165
165
  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>
166
166
  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.
167
167
 
168
168
 
169
169
  ## Run Whisp python package from a notebook <a name="whisp_notebooks"></a>
170
-
170
+
171
171
  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.
172
172
 
173
- 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)
173
+ An 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)
174
174
 
175
- 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)
175
+ 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 (e.g., >100,000 features), see [whisp_ee_asset_to_drive.ipynb](https://github.com/forestdatapartnership/whisp/blob/main/notebooks/whisp_ee_asset_to_drive.ipynb)
176
176
 
177
177
  ### Requirements for running the package
178
178
 
@@ -180,8 +180,6 @@ The **relevant risk assessment column depends on the commodity** in question:
180
180
  - A registered cloud GEE project.
181
181
  - Some experience in Python or a similar language.
182
182
 
183
- More info on Whisp can be found in [here](https://openknowledge.fao.org/items/e9284dc7-4b19-4f9c-b3e1-e6c142585865)
184
-
185
183
 
186
184
  ### Python package installation
187
185
 
@@ -195,7 +193,6 @@ The **relevant risk assessment column depends on the commodity** in question:
195
193
  pip install --pre openforis-whisp
196
194
  ```
197
195
 
198
- 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).
199
196
 
200
197
  The package relies upon the google earth engine api being setup correctly using a registered cloud project.
201
198
 
@@ -242,129 +239,46 @@ Before submitting a request, consider the following:
242
239
  ---
243
240
 
244
241
 
245
-
246
242
  ### Adding your own data directly
247
243
 
244
+ The python notebooks allow the user to add custom data layers. You can edit the Prepare layers section to do this in the [Colab Notebook](https://github.com/forestdatapartnership/whisp/blob/main/notebooks/Colab_whisp_geojson_to_csv.ipynb)
245
+ To add your own data directly you will need some coding experience as well as familiarity with Google Earth Engine.
248
246
 
249
- To add your own data you will need some coding experience as well as familiarity with GitHub and Google Earth Engine.
250
-
251
- This approach is for those who want to run a bespoke analysis combining their own data with those already in Whisp.
252
-
253
- Firstly follow the steps below to install the package in editable mode.
254
-
255
- 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).
256
-
257
- ```bash
258
-
259
- git clone https://github.com/forestdatapartnership/whisp.git
260
-
261
- cd whisp/
262
-
263
- pip install -e .[dev]
264
-
265
- ```
266
- Once in editable mode you are running the Whisp package locally based on a cloned version of the code.
267
-
268
-
269
-
270
- There are two files to edit to add your own data:
271
-
272
- - `src/openforis_whisp/datasets.py`
273
-
274
- - `src/openforis_whisp/parameters/lookup_gee_datasets.csv`
275
-
276
-
277
-
278
- The `datasets.py` file is a Python script that defines functions which return GEE images composed of one or more bands.
279
-
280
-
281
-
282
- #### To add your own dataset:
283
-
284
- 1. Add code to `datasets.py` in the form of a function that returns a **single-band binary image** for your dataset. See notes at the top of the file and example functions for formatting.
285
-
286
- 2. Edit the `lookup_gee_datasets.csv` and add a row for your dataset.
287
-
288
-
289
-
290
- **NB:** You need to know what the dataset represents and define how it will be used in the different risk decision trees (if at all).
291
-
292
- For example, if it is a dataset for tree cover in 2000, then add `'treecover'` under the `Theme` column.
293
-
294
-
295
-
296
- #### Example function in `datasets.py`:
297
-
298
-
299
-
300
- ```python
301
-
302
- def my_custom_dataset_prep():
303
-
304
- image = ee.Image("MY/GEE/DATASET")
305
-
306
- binary = image.gt(10) # Example threshold
307
-
308
- return binary.rename("My_custom_dataset")
309
-
310
- ```
311
-
312
-
313
-
314
- ---
315
-
316
-
317
- 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.
318
-
319
-
320
-
321
- ---
322
-
323
-
324
-
325
- ## Contributing to the Whisp code base <a name="whisp_contribute"></a>
326
-
327
- 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
-
329
-
330
- Install the package in editable mode (see Adding your own data directly above):
331
-
332
- Then add additional dependencies required for testing and running pre-commit hooks:
333
-
334
-
335
- ```bash
336
-
337
- pre-commit install
338
247
 
339
- ```
248
+ ## Contributing <a name="whisp_contribute"></a>
340
249
 
250
+ Contributions are welcome!
251
+ - Fork the repo, make changes, and open a pull request.
252
+ - For adding new datasets to the codebase and for project-specific coding standards see [.github/copilot-instructions.md](.github/copilot-instructions.md)
341
253
 
342
- You should be able to run the Pytest suite by simply running the `pytest` command from the repo's root folder.
254
+ ## Code of Conduct <a name="whisp_conduct"></a>
343
255
 
256
+ **Purpose**
257
+ We are dedicated to maintaining a safe and respectful environment for all users. Harassment or abusive behavior will not be tolerated. <br>
344
258
 
345
- Please read the [contributing guidelines](contributing_guidelines.md) for good practice recommendations
259
+ **Scope**
260
+ This Code applies to all interactions on the repository and on the app.
346
261
 
262
+ **Expectations** <br>
263
+ *- Respect others:* Treat all contributors and users with courtesy and kindness. <br>
264
+ *- Constructive communication:* Engage respectfully, even in disagreements. <br>
265
+ *- Protect privacy:* Do not share personal information without consent.
347
266
 
348
- ## Code of Conduct <a name="whisp_conduct"></a>
267
+ **Prohibited Conduct** <br>
268
+ *- Harassment:* Unwanted or abusive communication, stalking, threats, or bullying.<br>
269
+ *- Discrimination:* Any form of hate speech or exclusion based on race, gender, orientation, or other identities.<br>
270
+ *- Inappropriate Content:* Posting offensive, harmful, or explicit material.
349
271
 
350
- **Purpose**
351
- We are dedicated to maintaining a safe and respectful environment for all users. Harassment or abusive behavior will not be tolerated. <br>
272
+ **Reporting** <br>
273
+ Users can report violations of this Code of Conduct confidentially by contacting the Open Foris team at
274
+ [open-foris@fao.org](mailto:open-foris@fao.org).
352
275
 
353
- **Scope**
354
- This Code applies to all interactions on the repository and on the app.
355
276
 
356
- **Expectations** <br>
357
- *- Respect others:* Treat all contributors and users with courtesy and kindness. <br>
358
- *- Constructive communication:* Engage respectfully, even in disagreements. <br>
359
- *- Protect privacy:* Do not share personal information without consent.
277
+ ## Feedback <a name="whisp_feedback"></a>
278
+ - For issues or feature requests [open a GitHub issue](https://github.com/forestdatapartnership/whisp/issues).
279
+ - For general questions, feedback or support, email [open-foris@fao.org](mailto:open-foris@fao.org).
360
280
 
361
- **Prohibited Conduct** <br>
362
- *- Harassment:* Unwanted or abusive communication, stalking, threats, or bullying.<br>
363
- *- Discrimination:* Any form of hate speech or exclusion based on race, gender, orientation, or other identities.<br>
364
- *- Inappropriate Content:* Posting offensive, harmful, or explicit material.
281
+ We welcome all feedback and contributions!
365
282
 
366
- **Reporting**
367
- Users can report violations directly to us by emailing the address listed in the "Contact Us" section of the website:
368
- https://openforis.org/solutions/whisp/
369
283
 
370
284
 
@@ -25,6 +25,7 @@
25
25
  - [Add data layers](#whisp_add_data)
26
26
  - [Contribute to the code](#whisp_contribute)
27
27
  - [Code of conduct](#whisp_conduct)
28
+ - [Feedback](#whisp_feedback)
28
29
 
29
30
  <br>
30
31
 
@@ -32,11 +33,11 @@
32
33
  ***Whisp*** can currently be used directly or implemented in your own code through three different pathways:
33
34
 
34
35
 
35
- 1. The Whisp App with its simple interface can be used [right here](https://whisp.openforis.org/) or called from other software by [API](https://whisp.openforis.org/documentation/api-guide). The Whisp App currently supports the processing of up to 3,000 geometries per job. The original JS & Python code behind the Whisp App and API can be found [here](https://github.com/forestdatapartnership/whisp-app).
36
+ 1. The Whisp App with its simple interface can be accessed [here](https://whisp.openforis.org/) or called from other software by [API](https://whisp.openforis.org/documentation/api-guide). The Whisp App currently supports the processing of up to 3,000 geometries per job. The original JS & Python code behind the Whisp App and API can be found [here](https://github.com/forestdatapartnership/whisp-app).
36
37
 
37
38
  2. [Whisp in Earthmap](https://whisp.earthmap.org/?aoi=WHISP&boundary=plot1&layers=%7B%22CocoaETH%22%3A%7B%22opacity%22%3A1%7D%2C%22JRCForestMask%22%3A%7B%22opacity%22%3A1%7D%2C%22planet_rgb%22%3A%7B%22opacity%22%3A1%2C%22date%22%3A%222020-12%22%7D%7D&map=%7B%22center%22%3A%7B%22lat%22%3A7%2C%22lng%22%3A4%7D%2C%22zoom%22%3A3%2C%22mapType%22%3A%22satellite%22%7D&statisticsOpen=true) supports the visualization of geometries on actual maps with the possibility to toggle different relevant map products around tree cover, commodities and deforestation. It is practical for demonstration purposes and spot checks of single geometries but not recommended for larger datasets.
38
39
 
39
- 3. Datasets of any size, especially when holding more than 3,000 geometries, can be analyzed with Whisp through the [python package on pip](https://pypi.org/project/openforis-whisp/). See example [Colab Notebook](https://github.com/forestdatapartnership/whisp/blob/main/notebooks/Colab_whisp_geojson_to_csv.ipynb) for implementation with a geojson input. For the detailed procedure please go to the section [Whisp notebooks](#whisp_notebooks).
40
+ 3. Datasets of any size, especially when holding more than 3,000 geometries, can be analyzed with Whisp through the [python package on pip](https://pypi.org/project/openforis-whisp/). See example [Colab Notebook](https://github.com/forestdatapartnership/whisp/blob/main/notebooks/Colab_whisp_geojson_to_csv.ipynb) for implementation with a geojson input. For further notebooks processing options see [Whisp notebooks](#whisp_notebooks).
40
41
 
41
42
 
42
43
  ## Whisp datasets <a name="whisp_datasets"></a>
@@ -59,7 +60,7 @@ Additional categories are specific for the timber commodity, considering a harve
59
60
 
60
61
  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).
61
62
 
62
- ### Whisp risk assessment <a name="whisp_risk"></a>
63
+ ### Whisp risk assessment <a name="whisp_risk"></a>
63
64
 
64
65
  Whisp checks the plots provided by the user by running zonal statistics on them to answer the following questions:
65
66
 
@@ -116,24 +117,24 @@ The **relevant risk assessment column depends on the commodity** in question:
116
117
 
117
118
  *The Whisp algorithm for **Perennial Crops** visualized:*
118
119
  ![CoE_Graphic 5](https://github.com/user-attachments/assets/007b5f50-3939-4707-95fa-98be4d56745f)
119
-
120
+
120
121
  If no treecover dataset indicates any tree cover for a plot by the end of 2020, **Whisp will categorize the deforestation risk as low.**
121
122
 
122
123
  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.**
123
124
 
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.
125
+ 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 (European Union Deforestation Risk), and is therefore not considered high risk.
125
126
 
126
127
  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
128
  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.
128
129
 
129
130
 
130
131
  ## Run Whisp python package from a notebook <a name="whisp_notebooks"></a>
131
-
132
+
132
133
  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.
133
134
 
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)
135
+ An 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)
135
136
 
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
+ 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 (e.g., >100,000 features), see [whisp_ee_asset_to_drive.ipynb](https://github.com/forestdatapartnership/whisp/blob/main/notebooks/whisp_ee_asset_to_drive.ipynb)
137
138
 
138
139
  ### Requirements for running the package
139
140
 
@@ -141,8 +142,6 @@ The **relevant risk assessment column depends on the commodity** in question:
141
142
  - A registered cloud GEE project.
142
143
  - Some experience in Python or a similar language.
143
144
 
144
- More info on Whisp can be found in [here](https://openknowledge.fao.org/items/e9284dc7-4b19-4f9c-b3e1-e6c142585865)
145
-
146
145
 
147
146
  ### Python package installation
148
147
 
@@ -156,7 +155,6 @@ The **relevant risk assessment column depends on the commodity** in question:
156
155
  pip install --pre openforis-whisp
157
156
  ```
158
157
 
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).
160
158
 
161
159
  The package relies upon the google earth engine api being setup correctly using a registered cloud project.
162
160
 
@@ -203,128 +201,45 @@ Before submitting a request, consider the following:
203
201
  ---
204
202
 
205
203
 
206
-
207
204
  ### Adding your own data directly
208
205
 
206
+ The python notebooks allow the user to add custom data layers. You can edit the Prepare layers section to do this in the [Colab Notebook](https://github.com/forestdatapartnership/whisp/blob/main/notebooks/Colab_whisp_geojson_to_csv.ipynb)
207
+ To add your own data directly you will need some coding experience as well as familiarity with Google Earth Engine.
209
208
 
210
- To add your own data you will need some coding experience as well as familiarity with GitHub and Google Earth Engine.
211
-
212
- This approach is for those who want to run a bespoke analysis combining their own data with those already in Whisp.
213
-
214
- Firstly follow the steps below to install the package in editable mode.
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.
228
-
229
-
230
-
231
- There are two files to edit to add your own data:
232
-
233
- - `src/openforis_whisp/datasets.py`
234
-
235
- - `src/openforis_whisp/parameters/lookup_gee_datasets.csv`
236
-
237
-
238
-
239
- The `datasets.py` file is a Python script that defines functions which return GEE images composed of one or more bands.
240
-
241
-
242
-
243
- #### To add your own dataset:
244
-
245
- 1. Add code to `datasets.py` in the form of a function that returns a **single-band binary image** for your dataset. See notes at the top of the file and example functions for formatting.
246
-
247
- 2. Edit the `lookup_gee_datasets.csv` and add a row for your dataset.
248
-
249
-
250
-
251
- **NB:** You need to know what the dataset represents and define how it will be used in the different risk decision trees (if at all).
252
-
253
- For example, if it is a dataset for tree cover in 2000, then add `'treecover'` under the `Theme` column.
254
-
255
-
256
-
257
- #### Example function in `datasets.py`:
258
-
259
-
260
-
261
- ```python
262
-
263
- def my_custom_dataset_prep():
264
-
265
- image = ee.Image("MY/GEE/DATASET")
266
-
267
- binary = image.gt(10) # Example threshold
268
-
269
- return binary.rename("My_custom_dataset")
270
-
271
- ```
272
-
273
-
274
-
275
- ---
276
-
277
-
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.
279
-
280
-
281
-
282
- ---
283
-
284
-
285
-
286
- ## Contributing to the Whisp code base <a name="whisp_contribute"></a>
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/).
289
-
290
-
291
- Install the package in editable mode (see Adding your own data directly above):
292
-
293
- Then add additional dependencies required for testing and running pre-commit hooks:
294
-
295
-
296
- ```bash
297
-
298
- pre-commit install
299
209
 
300
- ```
210
+ ## Contributing <a name="whisp_contribute"></a>
301
211
 
212
+ Contributions are welcome!
213
+ - Fork the repo, make changes, and open a pull request.
214
+ - For adding new datasets to the codebase and for project-specific coding standards see [.github/copilot-instructions.md](.github/copilot-instructions.md)
302
215
 
303
- You should be able to run the Pytest suite by simply running the `pytest` command from the repo's root folder.
216
+ ## Code of Conduct <a name="whisp_conduct"></a>
304
217
 
218
+ **Purpose**
219
+ We are dedicated to maintaining a safe and respectful environment for all users. Harassment or abusive behavior will not be tolerated. <br>
305
220
 
306
- Please read the [contributing guidelines](contributing_guidelines.md) for good practice recommendations
221
+ **Scope**
222
+ This Code applies to all interactions on the repository and on the app.
307
223
 
224
+ **Expectations** <br>
225
+ *- Respect others:* Treat all contributors and users with courtesy and kindness. <br>
226
+ *- Constructive communication:* Engage respectfully, even in disagreements. <br>
227
+ *- Protect privacy:* Do not share personal information without consent.
308
228
 
309
- ## Code of Conduct <a name="whisp_conduct"></a>
229
+ **Prohibited Conduct** <br>
230
+ *- Harassment:* Unwanted or abusive communication, stalking, threats, or bullying.<br>
231
+ *- Discrimination:* Any form of hate speech or exclusion based on race, gender, orientation, or other identities.<br>
232
+ *- Inappropriate Content:* Posting offensive, harmful, or explicit material.
310
233
 
311
- **Purpose**
312
- We are dedicated to maintaining a safe and respectful environment for all users. Harassment or abusive behavior will not be tolerated. <br>
234
+ **Reporting** <br>
235
+ Users can report violations of this Code of Conduct confidentially by contacting the Open Foris team at
236
+ [open-foris@fao.org](mailto:open-foris@fao.org).
313
237
 
314
- **Scope**
315
- This Code applies to all interactions on the repository and on the app.
316
238
 
317
- **Expectations** <br>
318
- *- Respect others:* Treat all contributors and users with courtesy and kindness. <br>
319
- *- Constructive communication:* Engage respectfully, even in disagreements. <br>
320
- *- Protect privacy:* Do not share personal information without consent.
239
+ ## Feedback <a name="whisp_feedback"></a>
240
+ - For issues or feature requests [open a GitHub issue](https://github.com/forestdatapartnership/whisp/issues).
241
+ - For general questions, feedback or support, email [open-foris@fao.org](mailto:open-foris@fao.org).
321
242
 
322
- **Prohibited Conduct** <br>
323
- *- Harassment:* Unwanted or abusive communication, stalking, threats, or bullying.<br>
324
- *- Discrimination:* Any form of hate speech or exclusion based on race, gender, orientation, or other identities.<br>
325
- *- Inappropriate Content:* Posting offensive, harmful, or explicit material.
243
+ We welcome all feedback and contributions!
326
244
 
327
- **Reporting**
328
- Users can report violations directly to us by emailing the address listed in the "Contact Us" section of the website:
329
- https://openforis.org/solutions/whisp/
330
245
 
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "openforis-whisp"
7
- version = "3.0.0a7"
7
+ version = "3.0.0a9"
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 <andrew.arnell@fao.org>"]
@@ -24,6 +24,7 @@ classifiers = [
24
24
  "Documentation" = "https://github.com/forestdatapartnership/whisp#readme"
25
25
  "Development Branch" = "https://github.com/forestdatapartnership/whisp/tree/main"
26
26
  "Issues" = "https://github.com/forestdatapartnership/whisp/issues"
27
+ "Changelog" = "https://github.com/forestdatapartnership/whisp/releases"
27
28
 
28
29
  [tool.poetry.dependencies]
29
30
  python = ">=3.10"