Rothamsted-Ecoinformatics / farm_rothamsted

Custom farmOS features for Rothamsted Research.
GNU General Public License v2.0
6 stars 1 forks source link

Define a nutrient field on material terms #65

Open paul121 opened 2 years ago

paul121 commented 2 years ago

The fertiliser spreadsheet specifies multiple "Nutrient inputs". The process for entering a single nutrient input is as follows:

  1. Select the product type (parent terms under "Nutrients" in materials taxonomy)
  2. Select the product (child term under the previously selected product type term)
  3. Enter product volume (number) + units (specified list)

Phase 2 will expand on step 2 to include a "calculator" that can be used to calculate the product volume. This requires additional information about each product:

Calculator: once a product is selected, we can use its nutrient information in the "calculator" to derive the final "product volume":

@aislinnpearson can you confirm that I am understanding this correctly? :smile:

Once again I saw in the notes that this Nutrient info is a "Property of the product" - which makes sense! The spreadsheet mentioned saving these nutrients as "grand child terms" under the product material... but that is going to get crazy. I'd like to propose we save nutrient info as a field on each material term itself. This will make it easier to pull this info in for the calculator.

Related issues:

paul121 commented 2 years ago

I'd like to point out:

As such the nutrient is really a property of the product and doesn't need to be listed in the taxonomy.

Yes! This should be added as a field in phase 2!

More info from @aislinnpearson in this comment: https://github.com/Rothamsted-Ecoinformatics/farm_rothamsted/issues/41#issuecomment-993449621

aislinnpearson commented 2 years ago

Hi @paul121

Yes, all of this is correct, but with one correction and one caveat.

The correction is that there needs to be a product area on the quick form... Only it isn't an area per product, it's the area over which the combination of products is applied, similar to the current spraying quick form.

The caveat is that I need to double check my calculations with our agronomist, Ian Shield.

I was going to suggest we talk through these calculations in our next meeting actually. It is very complicated and an intermediary step might be that the user enters all the information themselves, including the nutrient rate (that is how most online calculators currently work).

mstenta commented 2 years ago

Estimating this as medium/large because it might depend on how deep we go on the "calculator" side of things (where these values get used). Adding the actual storage is pretty easy I think. @paul121 and I discussed perhaps just adding a Quantity field to Material terms.

aislinnpearson commented 2 years ago

It occurred to me that this is related to the challenge of adding calculations at a per plot level as per https://github.com/Rothamsted-Ecoinformatics/farm_rothamsted/issues/72#issuecomment-1070678169 so I think the estimation of this as medium/ large is probably correct.

If we can get it to work though, it would be a great bit of functionality.