@hestia-earth/aggregation-engine 0.22.1 → 0.22.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/formulas.d.ts CHANGED
@@ -49,6 +49,16 @@ export interface IFormula {
49
49
  * The KaTeX source (without the `$$` delimiters).
50
50
  */
51
51
  formula: string;
52
+ /**
53
+ * The heading the formula is documented under, e.g. `Completeness`. Names what the formula
54
+ * is for, so several formulas shown together can be told apart.
55
+ */
56
+ section?: string;
57
+ /**
58
+ * The sentence that introduces the formula in the documentation. Shown above it, so a reader
59
+ * who never opens the guide still knows what it calculates and how it relates to the others.
60
+ */
61
+ context?: string;
52
62
  /**
53
63
  * The symbols in the formula, in "Where:" list order.
54
64
  */
package/esm/formulas.d.ts CHANGED
@@ -49,6 +49,16 @@ export interface IFormula {
49
49
  * The KaTeX source (without the `$$` delimiters).
50
50
  */
51
51
  formula: string;
52
+ /**
53
+ * The heading the formula is documented under, e.g. `Completeness`. Names what the formula
54
+ * is for, so several formulas shown together can be told apart.
55
+ */
56
+ section?: string;
57
+ /**
58
+ * The sentence that introduces the formula in the documentation. Shown above it, so a reader
59
+ * who never opens the guide still knows what it calculates and how it relates to the others.
60
+ */
61
+ context?: string;
52
62
  /**
53
63
  * The symbols in the formula, in "Where:" list order.
54
64
  */
@@ -1,10 +1,12 @@
1
1
  {
2
2
  "hestia_earth/aggregation/docs/crop.md": [
3
3
  {
4
- "formula": "w = O \\times I",
4
+ "formula": "w_s = O \\times I",
5
+ "section": "Aggregation stages",
6
+ "context": "Each sub-aggregation's weight is the product of its organic share and its irrigation share.",
5
7
  "bindings": [
6
8
  {
7
- "symbol": "w",
9
+ "symbol": "w_s",
8
10
  "description": "the weight of the sub-aggregation",
9
11
  "key": "weight"
10
12
  },
@@ -21,7 +23,9 @@
21
23
  ]
22
24
  },
23
25
  {
24
- "formula": "p_{org} = \\min\\left(1, \\frac{L_{org}}{100}\\right)",
26
+ "formula": "p_{org} = \\min\\left(1, \\frac{V_{org}}{100}\\right)",
27
+ "section": "Aggregation stages",
28
+ "context": "The organic share comes from the region-standardsLabels-isOrganic lookup (FiBL), averaged over the aggregation period.",
25
29
  "bindings": [
26
30
  {
27
31
  "symbol": "p_{org}",
@@ -29,19 +33,16 @@
29
33
  "key": "organic_weight"
30
34
  },
31
35
  {
32
- "symbol": "L_{org}",
36
+ "symbol": "V_{org}",
33
37
  "description": "the lookup value as a percentage, averaged over the period",
34
38
  "key": "organic_weight_lookup_value"
35
- },
36
- {
37
- "symbol": "L",
38
- "description": "the plantation lifespan in days",
39
- "key": "plantation_lifespan"
40
39
  }
41
40
  ]
42
41
  },
43
42
  {
44
43
  "formula": "p_{irr} = \\frac{A_{irr}}{A_{total}}",
44
+ "section": "Aggregation stages",
45
+ "context": "The irrigation share comes from the region-irrigated lookup (AQUASTAT).",
45
46
  "bindings": [
46
47
  {
47
48
  "symbol": "p_{irr}",
@@ -61,12 +62,14 @@
61
62
  ]
62
63
  },
63
64
  {
64
- "formula": "w = \\begin{cases} \\frac{L - N}{L} & \\text{productive phase} \\\\ \\frac{365}{L} & \\text{preparation phase} \\\\ \\frac{N - 365}{L} & \\text{non-productive phase} \\end{cases}",
65
+ "formula": "w_p = \\begin{cases} \\frac{L - N}{L} & \\text{productive phase} \\\\ \\frac{365}{L} & \\text{preparation phase} \\\\ \\frac{N - 365}{L} & \\text{non-productive phase} \\end{cases}",
66
+ "section": "Plantation weighting",
67
+ "context": "The weight for each category is then calculated from the default glossary values for plantation_lifespan and plantation_non_productive_lifespan.",
65
68
  "bindings": [
66
69
  {
67
- "symbol": "w",
68
- "description": "the weight of a Cycle, by the phase it describes",
69
- "key": "weight"
70
+ "symbol": "w_p",
71
+ "description": "the weight of a Cycle, by the phase it describes, which is not stored",
72
+ "display": true
70
73
  },
71
74
  {
72
75
  "symbol": "L",
@@ -87,6 +90,8 @@
87
90
  },
88
91
  {
89
92
  "formula": "w_c = \\min\\left(1, \\frac{P_c}{P_{world}}\\right)",
93
+ "section": "World aggregations",
94
+ "context": "World aggregations are created by combining verified country aggregations.",
90
95
  "bindings": [
91
96
  {
92
97
  "symbol": "w_c",
@@ -102,18 +107,15 @@
102
107
  "symbol": "P_{world}",
103
108
  "description": "the world production quantity of the product over the same period",
104
109
  "key": "world_production"
105
- },
106
- {
107
- "symbol": "w",
108
- "description": "the weight of the sub-aggregation",
109
- "key": "weight"
110
110
  }
111
111
  ]
112
112
  }
113
113
  ],
114
114
  "hestia_earth/aggregation/docs/general-process.md": [
115
115
  {
116
- "formula": "\\bar{v} = \\sum_i v_i \\times \\frac{w_i}{W}",
116
+ "formula": "\\bar{v} = \\sum_i v_i \\times \\frac{w_i}{W_T}",
117
+ "section": "Number values",
118
+ "context": "The simple mean is the case of the weighted mean where every weight is equal, so both are calculated the same way.",
117
119
  "bindings": [
118
120
  {
119
121
  "symbol": "\\bar{v}",
@@ -133,14 +135,16 @@
133
135
  "column": "weight"
134
136
  },
135
137
  {
136
- "symbol": "W",
138
+ "symbol": "W_T",
137
139
  "description": "the total of every $w_i$",
138
140
  "key": "total_weight"
139
141
  }
140
142
  ]
141
143
  },
142
144
  {
143
- "formula": "\\hat{w}_i = \\frac{w_i}{n_{k(i)} \\times W}",
145
+ "formula": "\\hat{w}_i = \\frac{w_i}{n_{k(i)} \\times W_T}",
146
+ "section": "Number values",
147
+ "context": "When several Cycles share the same weight, that weight is divided between them, so a group represented by many Cycles does not count more than a group represented by few: a group's share of the result is its intended weight, not its number of uploads.",
144
148
  "bindings": [
145
149
  {
146
150
  "symbol": "\\hat{w}_i",
@@ -158,7 +162,7 @@
158
162
  "display": true
159
163
  },
160
164
  {
161
- "symbol": "W",
165
+ "symbol": "W_T",
162
166
  "description": "the total of every $w_i / n_{k(i)}$",
163
167
  "display": true
164
168
  }
@@ -166,6 +170,8 @@
166
170
  },
167
171
  {
168
172
  "formula": "\\bar{v} = \\sum_i v_i \\times \\frac{w_i}{W_R + W_Z}",
173
+ "section": "Completeness",
174
+ "context": "This zero-filling is what allows a term reported by only part of the population to be averaged over the whole population rather than only where it occurs.",
169
175
  "bindings": [
170
176
  {
171
177
  "symbol": "\\bar{v}",
@@ -193,16 +199,13 @@
193
199
  "symbol": "W_Z",
194
200
  "description": "the total weight of those that are complete for the area but report no value",
195
201
  "key": "zero_filled_weight"
196
- },
197
- {
198
- "symbol": "W",
199
- "description": "the total of every $w_i$",
200
- "key": "total_weight"
201
202
  }
202
203
  ]
203
204
  },
204
205
  {
205
- "formula": "EVS = \\overline{evs} \\times \\frac{W_P}{W}",
206
+ "formula": "EVS = \\overline{evs} \\times \\frac{W_P}{W_T}",
207
+ "section": "Primary Product",
208
+ "context": "Because economicValueShare is a share of the Cycle's total revenue rather than a physical quantity, it also has to account for how prevalent the product is across the population.",
206
209
  "bindings": [
207
210
  {
208
211
  "symbol": "EVS",
@@ -220,7 +223,7 @@
220
223
  "key": "product_weight"
221
224
  },
222
225
  {
223
- "symbol": "W",
226
+ "symbol": "W_T",
224
227
  "description": "the total weight of all sub-aggregations",
225
228
  "key": "total_weight"
226
229
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hestia-earth/aggregation-engine",
3
- "version": "0.22.1",
3
+ "version": "0.22.3",
4
4
  "description": "HESTIA Aggregation Engine",
5
5
  "main": "cjs/index.js",
6
6
  "directories": {