|
2 | 2 |
|
3 | 3 | ## Requirements |
4 | 4 |
|
5 | | -- Python: 3.12 or better |
| 5 | +- Python: 3.12 or better |
6 | 6 |
|
7 | 7 | # Contributing |
8 | 8 |
|
9 | 9 | Configure git to automatically lint your code and validate validate your commit messages: |
10 | 10 |
|
11 | 11 | ```sh |
12 | | -$ make setup-git-hooks |
| 12 | +$ make setup_git_hooks |
13 | 13 | ``` |
14 | 14 |
|
15 | 15 | Set up a virtual environment and install dependencies: |
16 | 16 |
|
17 | 17 | ```sh |
18 | 18 | $ uv venv |
19 | 19 | $ source .venv/bin/activate |
20 | | -$ make install && make install-dev |
| 20 | +$ make install && make install_dev |
21 | 21 | ``` |
22 | 22 |
|
23 | 23 | ## explanation of algorithm |
24 | 24 |
|
25 | 25 | ### terminology |
26 | 26 |
|
27 | | -- soil map unit: (possibly disjoint) geographic area that is associated with soil component percentage / arial coverage |
28 | | -- soil series: collection of related soil components |
29 | | -- soil component: description of various soil properties at specific depth intervals |
| 27 | +- soil map unit: (possibly disjoint) geographic area that is associated with soil component percentage / arial coverage |
| 28 | +- soil series: collection of related soil components |
| 29 | +- soil component: description of various soil properties at specific depth intervals |
30 | 30 |
|
31 | 31 | ### references |
32 | 32 |
|
33 | | -- equation 1 in https://landpotential.org/wp-content/uploads/2020/07/sssaj-0-0-sssaj2017.09.0337.pdf |
| 33 | +- equation 1 in https://landpotential.org/wp-content/uploads/2020/07/sssaj-0-0-sssaj2017.09.0337.pdf |
34 | 34 |
|
35 | 35 | ### dependencies |
36 | 36 |
|
37 | | -- simple features: https://r-spatial.github.io/sf/index.html |
38 | | -- well-known geometry: https://paleolimbot.github.io/wk/ |
39 | | -- R package for querying soilDB: https://ncss-tech.github.io/soilDB/ |
40 | | -- dplyr: https://dplyr.tidyverse.org/ |
| 37 | +- simple features: https://r-spatial.github.io/sf/index.html |
| 38 | +- well-known geometry: https://paleolimbot.github.io/wk/ |
| 39 | +- R package for querying soilDB: https://ncss-tech.github.io/soilDB/ |
| 40 | +- dplyr: https://dplyr.tidyverse.org/ |
41 | 41 |
|
42 | 42 | ### algorithm |
43 | 43 |
|
@@ -72,19 +72,27 @@ Input: a specific point in lat/lon, and a set of depth intervals. |
72 | 72 |
|
73 | 73 | ### Regular tests |
74 | 74 |
|
75 | | -There is a small suite of integration tests which can be run with the `make test` command, and gets run regularly by CI. |
| 75 | +There are several smaller test suites: |
| 76 | + |
| 77 | +- There is a set of "unit" tests, which really are testing the entire codebase more or less, but don't rely on any external API services, instead using snapshotted data from those services. You can run these tests with `make test_unit`. |
| 78 | + - These tests mostly produce snapshots of algorithm output rather than validating specific properties of the output, so they moreso validate that the algorithm hasn't changed (or how it has changed) rather than that it is correct. If the snapshots have changed in a desirable way, you can update them with `make test_update_unit_snapshots`. |
| 79 | +- For US only, there is a set of "integration" tests which run the algorithm against the live API services, but just confirm that the algorithm doesn't crash, they don't validate the output since it can change over time. These can be run with `make test_integration`. |
| 80 | +- The unit and integration tests can be run together with `make test` for convenience: this is what must pass for a PR to be mergeable. |
| 81 | +- The API snapshots themselves can be checked against the live API for drift using `make test_api_snapshot`. They can be updated to the new live API values using `make test_update_api_snapshots`. |
76 | 82 |
|
77 | 83 | ### Bulk test |
78 | 84 |
|
79 | 85 | There is a large suite of integration tests which takes many hours to run. It comes in the format of two scripts: |
80 | 86 |
|
81 | | -- Run `make generate_bulk_test_results` to run the algorithm over a collection of 3000 soil pits, which will accumulate the results in a log file. |
82 | | -- Run `RESULTS_FILE=$RESULTS_FILE make process_bulk_test_results` to view statistics calculated over that log file. |
| 87 | +- Run `make generate_bulk_test_results_us` or `make generate_bulk_test_results_global` to run the algorithm over a collection of thousands soil pits with soil IDs given by trained data collectors, which will accumulate the results in a log file. This can take several hours or potentially need to run overnight due (especially the US tests are slow due to the speed of external API services). |
| 88 | +- Run `RESULTS_FILE=$RESULTS_FILE make process_bulk_test_results_us` or `RESULTS_FILE=$RESULTS_FILE make process_bulk_test_results_global` to view statistics calculated over that log file. This can be run concurrently with `generate_bulk_test_results` to see statistics over the soil pits which have been run so far. |
| 89 | +- It has been nice to have these as two separate scripts because then you can iterate on the processing and display of statistics without interrupting the data collection. |
| 90 | +- It would be of value to also be able to run these US tests against snapshotted API data, it would just be much more onerous to collect and update the data. |
83 | 91 |
|
84 | 92 | ## Acknowledgements |
85 | 93 |
|
86 | | -- Beaudette, D., Roudier, P., Brown, A. (2023). [aqp: Algorithms for Quantitative Pedology](https://CRAN.R-project.org/package=aqp). R package version 2.0. |
| 94 | +- Beaudette, D., Roudier, P., Brown, A. (2023). [aqp: Algorithms for Quantitative Pedology](https://CRAN.R-project.org/package=aqp). R package version 2.0. |
87 | 95 |
|
88 | | -- Beaudette, D.E., Roudier, P., O'Geen, A.T. [Algorithms for quantitative pedology: A toolkit for soil scientists, Computers & Geosciences](http://dx.doi.org/10.1016/j.cageo.2012.10.020), Volume 52, March 2013, Pages 258-268, ISSN 0098-3004. |
| 96 | +- Beaudette, D.E., Roudier, P., O'Geen, A.T. [Algorithms for quantitative pedology: A toolkit for soil scientists, Computers & Geosciences](http://dx.doi.org/10.1016/j.cageo.2012.10.020), Volume 52, March 2013, Pages 258-268, ISSN 0098-3004. |
89 | 97 |
|
90 | | -- soilDB: Beaudette, D., Skovlin, J., Roecker, S., Brown, A. (2024). [soilDB: Soil Database Interface](https://CRAN.R-project.org/package=soilDB). R package version 2.8.3. |
| 98 | +- soilDB: Beaudette, D., Skovlin, J., Roecker, S., Brown, A. (2024). [soilDB: Soil Database Interface](https://CRAN.R-project.org/package=soilDB). R package version 2.8.3. |
0 commit comments