Documentation
¶
Overview ¶
Package calculiva holds what the Calculiva home improvement estimators share: the length units, the input error type and the embedded constants registry.
The estimators themselves live in the sub-packages mulch, soil, sod and asphalt. They are a line-by-line port of the engine that runs the calculators on https://calculiva.com/ and their tests reproduce the test vectors of the site, with the same tolerances, except where a value of a commercial publisher was replaced by a synthetic test value labelled as such.
Calculiva is a data house, not a trade. Nobody here claims to be a landscaper or a paver. What the module offers is arithmetic you can check and constants you can trace:
- every business constant shipped (a pallet size, a CPSC depth, a sale unit) is a named Go constant or variable whose documentation gives the id of its data sheet, the public source it was read on and the date it was verified;
- the values of commercial publishers whose terms do not allow reproduction (material and asphalt unit weights, bag and wheelbarrow sizes, sod allowances, asphalt lift rules) are not shipped: they are inputs of the user, with no default. The sources Calculiva read are listed at https://calculiva.com/data-sources/;
- nothing is rounded or invented to fill a gap: when a source is silent, the value is absent;
- the results are planning quantities. The manufacturer's instructions, the local code and the installer on site govern.
All lengths are millimetres (Inch = 25.4, Foot = 304.8). Invalid input returns an *InputError that names the offending field.
The data sheets behind the constants are listed at https://calculiva.com/data-sources/ and the registry itself is returned by ConstantsCSV.
Index ¶
Constants ¶
const Foot float64 = 304.8
Foot is one foot in millimetres (exact by definition of the international foot).
const Inch float64 = 25.4
Inch is one inch in millimetres (exact by definition of the international inch).
Variables ¶
This section is empty.
Functions ¶
func ConstantsCSV ¶
func ConstantsCSV() string
ConstantsCSV returns the Calculiva home improvement constants registry (CSV, UTF-8), licensed CC BY 4.0.
One row per data sheet: id, label, status, scope, source_name, source_url, verified_at, expires_at, sample_size.
Types ¶
type InputError ¶
type InputError struct {
// Message is human-readable, in English.
Message string
// Field identifies the offending field (for example "a1-depth" or "bag").
Field string
}
InputError is an invalid input, with the name of the field that caused it.
func (*InputError) Error ¶
func (e *InputError) Error() string
Error returns the message followed by the field in parentheses.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package asphalt estimates hot mix asphalt by zone and by course.
|
Package asphalt estimates hot mix asphalt by zone and by course. |
|
internal
|
|
|
num
Package num holds the number helpers shared by the estimators: tolerant rounding, range checks and the number formats used in error messages.
|
Package num holds the number helpers shared by the estimators: tolerant rounding, range checks and the number formats used in error messages. |
|
Package mulch estimates mulch by area: beds, tree rings, known areas, play structures and swings (CPSC).
|
Package mulch estimates mulch by area: beds, tree rings, known areas, play structures and swings (CPSC). |
|
Package sod estimates sod by area: staggered layout of rectangles with offcut reuse, areas by square footage with an allowance, plugs (UF/IFAS Table 3), soil preparation, pallets, cost and weight.
|
Package sod estimates sod by area: staggered layout of rectangles with offcut reuse, areas by square footage with an allowance, plugs (UF/IFAS Table 3), soil preparation, pallets, cost and weight. |
|
Package soil estimates topsoil and fill dirt by area: volume, bags, bulk, weight and hauling.
|
Package soil estimates topsoil and fill dirt by area: volume, bags, bulk, weight and hauling. |