Agri-Food module#

This module deals with food-related matter. This is only for households at the moment but will be extended to include agricultural parcels in the future.

Content#

biowaste_from_population(pop, duration[, ...])

Amount of biowaste generated in households for a given population pop over a certain duration using the food.csv database.

nitrogen_to_protein(nitrogen_mass[, food_type])

Calculate the amount of nitrogen associated to a mass of protein based on the conversion factors from [Mariotti2008].

nutrient_intake(pop, duration, nutrient[, ci, q])

Compute the amount of nutrient ingested by a given population over a certain duration using the food.csv database.

protein_to_nitrogen(protein_mass[, food_type])

Calculate the amount of nitrogen associated to a mass of protein based on Jones' factors (simply 6.25 for now).

Details#

orgmatt.agrifood.biowaste_from_population(pop: float | ndarray[Any, dtype[floating | int64]], duration: Quantity, ci: int = 0, q: list[float] | ndarray[Any, dtype[floating | int64]] | None = None, waste_type: str = 'BiodegradableWaste', **kwargs) Quantity[source]#

Amount of biowaste generated in households for a given population pop over a certain duration using the food.csv database.

Can be:

  • biodegradable waste (for any putrescible matter)

  • green waste (from gardens, etc)

  • kitchen waste (for organic components thrown during meal preparation)

  • food waste (for edible leftovers)

  • food residues (combining kitchen and food waste)

Parameters:
  • pop (float or list-like object) – Number of inhabitants.

  • duration (float [time]) – Time interval over which the nitrogen is excreted.

  • ci (int (optional, default: 0)) – Confidence interval (CI). If non-zero, the function will also return the low and high expected values corresponding to that CI.

  • q (array-like of floats (optional: default: None)) – Percentiles to compute (supersedes ci).

  • waste_type (str, optional (default: "BiodegradableWaste")) – Type of waste that should be considered among “BiodegradableWaste”, “KitchenWaste”, and “FoodWaste”.

  • **kwargs (arguments to use a subset of the database) – Additional arguments can be use to restrict the results to a subset of the full database. E.g. one can add region=”Europe” to use only values obtained from studies in European countries.

Returns:

biowaste – Mass of generated biodegradable waste if q is None or ci is 0. If q is provided, returns the values associated to each percentile in q for each entry in pop; otherwise one (low, mean, high) result per entry in pop, giving the masses expected for the requested confidence interval. The dimension D is either 3, len(q), (len(pop), 3), or (len(pop), len(q)) depending on ci and q.

Return type:

float or array of dimension D [length]**3

orgmatt.agrifood.nitrogen_to_protein(nitrogen_mass: Quantity, food_type: str | None = None) Quantity[source]#

Calculate the amount of nitrogen associated to a mass of protein based on the conversion factors from [Mariotti2008].

Parameters:
  • protein_mass (float [mass]*[nitrogen]) – Mass of protein to convert to nitrogen content.

  • food_type (str, optional (default: average conversion factor)) – Type of food considered, among: ‘dairy’, ‘meat’ (including fish and eggs), ‘cereal’ (except corn), ‘corn’, ‘soy’, ‘legume’ (except soy), and ‘vegetable’ (including mushrooms). If not specified or invalid, a default conversion factor of 5.6 g of protein per gram of nitrogen is used.

References

[Mariotti2008] (1,2)

Mariotti, Tomé, and Mirand. “Converting Nitrogen into Protein—Beyond 6.25 and Jones’ Factors.” Critical Reviews in Food Science and Nutrition 48-2 (2008): 177‑84. DOI: 10.1080/10408390701279749.

orgmatt.agrifood.nutrient_intake(pop: float | ndarray[Any, dtype[floating | int64]], duration: Quantity, nutrient: str, ci: int = 0, q: list[float] | ndarray[Any, dtype[floating | int64]] | None = None, **kwargs) Quantity[source]#

Compute the amount of nutrient ingested by a given population over a certain duration using the food.csv database.

Parameters:
  • pop (float or list-like object) – Number of inhabitants.

  • duration (float [time]) – Time interval over which the nitrogen is excreted.

  • nutrient (str) – Nutrient of interest among (‘N’, ‘K’, ‘P’, ‘Mg’, ‘Ca’).

  • ci (int (optional, default: 0)) – Confidence interval (CI). If non-zero, the function will also return the low and high expected values corresponding to that CI.

  • q (array-like of floats (optional: default: None)) – Percentiles to compute (supersedes ci).

  • **kwargs (arguments to use a subset of the database) – Additional arguments can be use to restrict the results to a subset of the full database. E.g. one can add excreta=”feces” to return only nitrogen contained in feces, or region=”Europe” to use only values obtained from studies in European countries.

Returns:

nutrient_mass – Mean mass of excreted nitrogen if q is None or ci is 0. If q is provided, returns the values associated to each percentile in q for each entry in amount; otherwise one (low, mean, high) result per entry in amount, giving the masses expected for the requested confidence interval. The dimension D is either 3, len(q), (len(amount), 3), or (len(amount), len(q)) depending on ci and q.

Return type:

float or array of dimension D [mass]

Notes

  • Nitrogen results are computed from protein data via protein_to_nitrogen() using the default value.

  • By default, only values for adults are returned, use group or age to select a specific subpopulation.

orgmatt.agrifood.protein_to_nitrogen(protein_mass: Quantity, food_type: str | None = None) Quantity[source]#

Calculate the amount of nitrogen associated to a mass of protein based on Jones’ factors (simply 6.25 for now).

Parameters:
  • protein_mass (float [mass]) – Mass of protein to convert to nitrogen content.

  • food_type (str, optional (default: average conversion factor)) – Type of food considered, among: ‘dairy’, ‘meat’ (including fish and eggs), ‘cereal’ (except corn), ‘corn’, ‘soy’, ‘legume’ (except soy), and ‘vegetable’ (including mushrooms). Currently unused, a 6.25 conversion factor is used for all food types.