@hestia-earth/engine-models 0.65.9 → 0.65.10
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/config/Cycle.json +9 -9
- package/config/Site.json +18 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.js +23 -4
- package/dist/models.d.ts +1 -1
- package/dist/models.js +3 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/model-links.json +12 -0
- package/package.json +4 -4
- package/search-results.json +914 -914
- package/src/config.spec.ts +22 -1
- package/src/config.ts +27 -12
- package/src/models.spec.ts +3 -4
- package/src/models.ts +2 -1
- package/src/version.ts +1 -1
package/config/Cycle.json
CHANGED
|
@@ -609,15 +609,7 @@
|
|
|
609
609
|
"stage": 2
|
|
610
610
|
},
|
|
611
611
|
{
|
|
612
|
-
"key": "
|
|
613
|
-
"model": "cycle",
|
|
614
|
-
"value": "energyContentLowerHeatingValue",
|
|
615
|
-
"runStrategy": "always",
|
|
616
|
-
"mergeStrategy": "list",
|
|
617
|
-
"stage": 2
|
|
618
|
-
},
|
|
619
|
-
{
|
|
620
|
-
"key": "products",
|
|
612
|
+
"key": "animals",
|
|
621
613
|
"model": "cycle",
|
|
622
614
|
"value": "milkYield",
|
|
623
615
|
"runStrategy": "always",
|
|
@@ -625,6 +617,14 @@
|
|
|
625
617
|
"stage": 2
|
|
626
618
|
}
|
|
627
619
|
],
|
|
620
|
+
{
|
|
621
|
+
"key": "inputs",
|
|
622
|
+
"model": "cycle",
|
|
623
|
+
"value": "energyContentLowerHeatingValue",
|
|
624
|
+
"runStrategy": "always",
|
|
625
|
+
"mergeStrategy": "list",
|
|
626
|
+
"stage": 2
|
|
627
|
+
},
|
|
628
628
|
{
|
|
629
629
|
"key": "products",
|
|
630
630
|
"model": "cycle",
|
package/config/Site.json
CHANGED
|
@@ -432,6 +432,24 @@
|
|
|
432
432
|
"stage": 2
|
|
433
433
|
}
|
|
434
434
|
],
|
|
435
|
+
[
|
|
436
|
+
{
|
|
437
|
+
"key": "defaultMethodClassification",
|
|
438
|
+
"model": "site",
|
|
439
|
+
"value": "defaultMethodClassification",
|
|
440
|
+
"runStrategy": "add_key_if_missing",
|
|
441
|
+
"mergeStrategy": "default",
|
|
442
|
+
"stage": 2
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
"key": "defaultMethodClassificationDescription",
|
|
446
|
+
"model": "site",
|
|
447
|
+
"value": "defaultMethodClassificationDescription",
|
|
448
|
+
"runStrategy": "add_key_if_missing",
|
|
449
|
+
"mergeStrategy": "default",
|
|
450
|
+
"stage": 2
|
|
451
|
+
}
|
|
452
|
+
],
|
|
435
453
|
[
|
|
436
454
|
{
|
|
437
455
|
"key": "measurements",
|
package/dist/config.d.ts
CHANGED
|
@@ -26,4 +26,5 @@ interface ICalculationConfigData {
|
|
|
26
26
|
}
|
|
27
27
|
export declare const loadRunConfig: (nodeType: allowedType, stage: number) => ICalculationConfigData[];
|
|
28
28
|
export declare const loadTriggerConfig: (nodeType: allowedType, stage: number) => ICalculationConfigData[];
|
|
29
|
+
export declare const getMaxStage: (nodeType: allowedType) => any;
|
|
29
30
|
export {};
|
package/dist/config.js
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var _a;
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.loadTriggerConfig = exports.loadRunConfig = exports.loadConfig = void 0;
|
|
4
|
+
exports.getMaxStage = exports.loadTriggerConfig = exports.loadRunConfig = exports.loadConfig = void 0;
|
|
4
5
|
var schema_1 = require("@hestia-earth/schema");
|
|
6
|
+
var runConfig = require("../config/run-calculations.json");
|
|
7
|
+
var triggerConfig = require("../config/trigger-calculations.json");
|
|
8
|
+
var Cycle = require("../config/Cycle.json");
|
|
9
|
+
var ImpactAssessment = require("../config/ImpactAssessment.json");
|
|
10
|
+
var Site = require("../config/Site.json");
|
|
5
11
|
var allowedTypes = [schema_1.NodeType.Cycle, schema_1.NodeType.Site, schema_1.NodeType.ImpactAssessment];
|
|
6
12
|
var validateType = function (nodeType) {
|
|
7
13
|
return allowedTypes.includes(nodeType) ||
|
|
@@ -9,6 +15,11 @@ var validateType = function (nodeType) {
|
|
|
9
15
|
throw new Error("Invalid type ".concat(nodeType, ". Allowed types: ").concat(allowedTypes.join(', ')));
|
|
10
16
|
})();
|
|
11
17
|
};
|
|
18
|
+
var typeToConfig = (_a = {},
|
|
19
|
+
_a[schema_1.NodeType.Cycle] = Cycle,
|
|
20
|
+
_a[schema_1.NodeType.ImpactAssessment] = ImpactAssessment,
|
|
21
|
+
_a[schema_1.NodeType.Site] = Site,
|
|
22
|
+
_a);
|
|
12
23
|
/**
|
|
13
24
|
* Load orchestrator configuration.
|
|
14
25
|
*
|
|
@@ -16,7 +27,7 @@ var validateType = function (nodeType) {
|
|
|
16
27
|
* @returns
|
|
17
28
|
*/
|
|
18
29
|
var loadConfig = function (nodeType) {
|
|
19
|
-
return validateType(nodeType) &&
|
|
30
|
+
return validateType(nodeType) && typeToConfig[nodeType];
|
|
20
31
|
};
|
|
21
32
|
exports.loadConfig = loadConfig;
|
|
22
33
|
var validateStage = function (config, nodeType, stage) {
|
|
@@ -28,11 +39,19 @@ var validateStage = function (config, nodeType, stage) {
|
|
|
28
39
|
};
|
|
29
40
|
var loadRunConfig = function (nodeType, stage) {
|
|
30
41
|
return validateType(nodeType) &&
|
|
31
|
-
validateStage(
|
|
42
|
+
validateStage(runConfig, nodeType, stage);
|
|
32
43
|
};
|
|
33
44
|
exports.loadRunConfig = loadRunConfig;
|
|
34
45
|
var loadTriggerConfig = function (nodeType, stage) {
|
|
35
46
|
return validateType(nodeType) &&
|
|
36
|
-
validateStage(
|
|
47
|
+
validateStage(triggerConfig, nodeType, stage);
|
|
37
48
|
};
|
|
38
49
|
exports.loadTriggerConfig = loadTriggerConfig;
|
|
50
|
+
var getMaxStage = function (nodeType) {
|
|
51
|
+
return validateType(nodeType)
|
|
52
|
+
? Math.max.apply(Math.max, Object.keys(runConfig[nodeType]).map(function (key) {
|
|
53
|
+
return Number(key.replace('stage-', ''));
|
|
54
|
+
}))
|
|
55
|
+
: null;
|
|
56
|
+
};
|
|
57
|
+
exports.getMaxStage = getMaxStage;
|
package/dist/models.d.ts
CHANGED
package/dist/models.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
var
|
|
5
|
-
exports.
|
|
3
|
+
exports.models = void 0;
|
|
4
|
+
var data = require("../model-links.json");
|
|
5
|
+
exports.models = data;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ENGINE_VERSION = "0.65.
|
|
1
|
+
export declare const ENGINE_VERSION = "0.65.10";
|
package/dist/version.js
CHANGED
package/model-links.json
CHANGED
|
@@ -2464,6 +2464,18 @@
|
|
|
2464
2464
|
"model": "site",
|
|
2465
2465
|
"term": "cationExchangeCapacityPerKgSoil"
|
|
2466
2466
|
},
|
|
2467
|
+
{
|
|
2468
|
+
"path": "hestia_earth/models/site/defaultMethodClassification.py",
|
|
2469
|
+
"docPath": "hestia_earth/models/site/defaultMethodClassification.md",
|
|
2470
|
+
"model": "site",
|
|
2471
|
+
"modelKey": "defaultMethodClassification"
|
|
2472
|
+
},
|
|
2473
|
+
{
|
|
2474
|
+
"path": "hestia_earth/models/site/defaultMethodClassificationDescription.py",
|
|
2475
|
+
"docPath": "hestia_earth/models/site/defaultMethodClassificationDescription.md",
|
|
2476
|
+
"model": "site",
|
|
2477
|
+
"modelKey": "defaultMethodClassificationDescription"
|
|
2478
|
+
},
|
|
2467
2479
|
{
|
|
2468
2480
|
"path": "hestia_earth/models/site/flowingWater.py",
|
|
2469
2481
|
"docPath": "hestia_earth/models/site/flowingWater.md",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hestia-earth/engine-models",
|
|
3
|
-
"version": "0.65.
|
|
3
|
+
"version": "0.65.10",
|
|
4
4
|
"description": "HESTIA Engine Models",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -51,9 +51,9 @@
|
|
|
51
51
|
"@hestia-earth/api": "^0.24.34",
|
|
52
52
|
"@hestia-earth/eslint-config": "^0.1.0",
|
|
53
53
|
"@hestia-earth/glossary": "^0.62.0",
|
|
54
|
-
"@hestia-earth/json-schema": "^30.
|
|
55
|
-
"@hestia-earth/schema": "^30.
|
|
56
|
-
"@hestia-earth/schema-validation": "^30.
|
|
54
|
+
"@hestia-earth/json-schema": "^30.6.0",
|
|
55
|
+
"@hestia-earth/schema": "^30.6.0",
|
|
56
|
+
"@hestia-earth/schema-validation": "^30.6.0",
|
|
57
57
|
"@hestia-earth/utils": "^0.13.0",
|
|
58
58
|
"@jest/globals": "^29.7.0",
|
|
59
59
|
"@typescript-eslint/eslint-plugin": "^5.23.0",
|