Functional Weave
Code in Python

agri.spray-mix@1.0.1

README.md

3,110 bytes · view raw

# agri.spray-mix

**Status: needs review by a qualified agronomist/BASIS adviser before it is
published; always follow the product label.**

How to fill a sprayer for a job: how many tank fills, and how much product
and water go into each full tank and into the last, part-filled one. 24 ha at
a water volume of 200 L/ha with a product at 2.5 L/ha and a 1000 L tank is 5
fills: four full tanks of 12.5 L product and 987.5 L water, each covering
5 ha, and a last tank of 10 L product and 790 L water for the remaining 4 ha.

## Terms

- **Water volume** (the application rate) is the total spray liquid applied
  per hectare, product included, as sprayer calibration sets it.
- **Dose** is the label rate of product per hectare, in litres for a liquid
  or kilograms for a solid (`doseUnit`).
- **Water** in a tank is the spray volume less the product for a liquid,
  since the product takes up room; for a solid it is the whole spray volume
  (the powder or granules dissolve or disperse into it).

## Exactness

Inputs are taken to 0.0001 ha, 0.1 L/ha, 0.001 L or kg per ha and 0.1 L
(`math.round-float`) and held as integers, so the job's total spray volume is
exact and the full-tank count is a whole-number division. In floating point,
129.2 ha x 250 L/ha is 32299.999999999996, which makes 18 full 1700 L tanks
and a sliver; this gives exactly 19.

Each load's area, spray, product and water are worked out from its own spray
volume and rounded half up (area to 0.0001 ha, liquids and product to 0.001).
Water is the rounded spray less the rounded product, so each load adds up.

## What it does not do

It does not check the dose, water volume, number of applications or
buffer zones against the label, account for rinsate, the tank's unusable
residue (give the usable capacity) or a tank-mix order, or convert units.

## Limits

Area more than 0 and at most 100,000 ha; water volume 0.1 to 10,000 L/ha;
dose 0 to 100 per ha, and for a liquid less than the water volume; tank 0.1
to 100,000 L.

## Before you rely on this

**Not professional advice.** This capability calculates pesticide figures from published rules. It is a software component for developers, not agronomic advice. Rules change and every rate here has an effective date. Check that the dates cover your case. Verify results against the official sources listed above, and have a BASIS-qualified agronomist review how you use it, before anyone relies on the output. Provided "as is" under its licence, without warranty.

**Unreviewed.** This capability's implementations agree in every language and pass its published test vectors, which were worked out from the official sources cited. But no qualified BASIS-qualified agronomist has yet checked those vectors, or confirmed that the capability covers the cases it claims. Treat it as a draft. Do not use it for real people, money or decisions without your own expert review. Once a qualified reviewer signs off, this notice is replaced with their name, qualification and the date. Each new version needs fresh sign-off.

1.0.1 marks it unreviewed. The code and the tests are unchanged.