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

**URL:** <https://farmos.discourse.group/t/animal-weight-measurements-farmos1-0/1559>\
**Category:** Conventions\
**Tags:** convention-proposal\
**Created:** [March 9, 2023, 2:50pm UTC](https://farmos.discourse.group/t/animal-weight-measurements-farmos1-0/1559 "2023-03-09T14:50:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [March 9, 2023, 2:50pm UTC](https://farmos.discourse.group/t/animal-weight-measurements-farmos1-0/1559/1 "2023-03-09T14:50:20Z")

</div>

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](https://github.com/mstenta/farmOS-conventions/), copied below:

* * *

# Animal weight

**Version 1.0**

```yml
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

- Birth quick form
- [Animal weight module](https://www.drupal.org/project/farm_animal_weight)

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [March 9, 2023, 2:51pm UTC](https://farmos.discourse.group/t/animal-weight-measurements-farmos1-0/1559/2 "2023-03-09T14:51:58Z")

</div>

> [@mstenta](#):
>
> Birth quick form

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.

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [March 9, 2023, 2:54pm UTC](https://farmos.discourse.group/t/animal-weight-measurements-farmos1-0/1559/3 "2023-03-09T14:54:57Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mstenta](https://yyz2.discourse-cdn.com/free1/user_avatar/farmos.discourse.group/mstenta/32/4_2.png) [@mstenta](https://farmos.discourse.group/u/mstenta)\
**Post date:** [March 9, 2023, 3:00pm UTC](https://farmos.discourse.group/t/animal-weight-measurements-farmos1-0/1559/4 "2023-03-09T15:00:03Z")

</div>

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.
