billios - A Soil Library
This crate is a collection of soil related data structures and formulae.
Installation
Standard functionality, no additional dependencies are required:
[]
= "0.1.1"
Alternatively, you can install using the cargo add command:
Code Examples
Example - Sand Used
Using this formula only requires a couple lines of code.
Simply call the new() method with the desired values, then call calculate() to retrieve the result.
Use with constant sand_in_cone value:
use *;
// This constructor takes 3 arguments:
//
// cone_pre_test, cone_post_test, sand_in_cone
//
// The first two are straight forward; two float values.
// For the third we use the `None` option. The reason for this
// is becouse the `sand_in_cone` argument is a constant (mostly).
// In general this value does not change often, so we don't have to worry
// about setting it. Instead we just use `None`. If for some reason you
// needed to change the value, you simple pass in a `Some(<f64>).
let sand_used = new;
// In order to get the calculated value we call the `calculate()` method:
let result = sand_used.calculate;
assert_eq!;
Use with a custom sand_in_cone value:
use *;
let sand_used = new;
let result = sand_used.calculate;
assert_eq!;
Example - Compaction
Using this formula can a little more complicated than the last example. However it is still pretty straghtforward.
Use with a pre-existing dry_density value:
Coming soon...
Todo
- Implement GitHub Action workflow
- Create first deployment to crates.io
- Improve
README.md- Add the build/crates.io/docs badges
- Complete documentation
- Need basic docs atleast for crates.io
-
lib.rsneeds attention
- Add
Setter()methods to calculation structs - Possibly change choice enums (ex.
SandUsedChoices) toSandUsedOption - Rework the public API. Namely how things like
domain::typesare accessed - More calculations?
- Rename
utilities.rs? - Rename
calculations.rstofield_test.rs?