Animal weight measurements (farmOS:animal-weight:1.0)

This thread is for discussing the draft farmOS core convention for animal weight measurements: farmOS:animal-weight:1.0. The current draft is in the wip branch of GitHub - mstenta/farmOS-conventions, copied below:


Animal weight

Version 1.0

convention_id: "farmOS:animal-weight:1.0"
dependencies:
  - farm:farm_animal
  - farm:farm_observation

Purpose

Animal weight measurements are used to track animal growth over time.

Specification

Animal weight measurements MUST be recorded as Observation (observation) logs.

The “Timestamp” (timestamp) field of the log MUST be the date when the
animal’s weight was measured.

The “Assets” (asset) field of the log MUST reference one or more Animal
(animal) assets, which represent the animal(s) being weighed. If multiple
animal assets are referenced, the weight value MUST be the average weight of all
animals (not the sum total weight of all animals). Weights MAY be estimated.

Weight MUST be recorded as a single quantity referenced by the log’s
“Quantities” (quantity) field, and the quantity type MUST be “Standard”
(standard). The quantity “Measure” (measure) must be “Weight” (weight),
and the quantity “Value” (value) must be the numeric weight value. The
quantity “Units” (units) MAY be any unit of weight measurement, but the
following recommended units SHOULD be used when possible for consistency:

If the system of measurement is “US” (us), units SHOULD be “lbs”.
If the system of measurement is “Metric” (metric), units SHOULD be “kg”.

An animal’s current weight MUST be calculated by looking at the quantity value
and units of the most recent completed (status is done) weight observation
log that references the animal. Projected weight gain MAY be simulated by
creating weight observation logs with a future date that are not completed
(status is pending).

Notable implementations

1 Like

Note: This is currently listed under “Notable implementations” but it doesn’t exist yet. I’m working on this in my 2.x-quick-birth branch, and hope to have it complete before this convention gets merged.

1 Like

Also worth noting: I’m posting this for review mostly to think through the little details of wording etc. This convention has been in use implicitly for years now, following the specification described above, both in farmOS v1 core and in the Animal Weight module in contrib. So, if there is a desire to change the way that weight measurements are represented (eg: using inventory), then that will need to be a different version. This 1.0 is still necessary to document the currently implicit convention that is already in use.

One other detail we may need to include here is “Group” weight measurements. I have to refresh on how the animal weight module worked, but I recall that it also supported recording weight observations against a group asset, as well as individual animal assets. And when it did, the assumption was that it was the average weight of all animals in that group.

Or, perhaps that should be its own convention that inherits_from this one.