@hestia-earth/engine-models 0.65.1

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/package.json ADDED
@@ -0,0 +1,83 @@
1
+ {
2
+ "name": "@hestia-earth/engine-models",
3
+ "version": "0.65.1",
4
+ "description": "HESTIA Engine Models",
5
+ "main": "dist/index.js",
6
+ "typings": "dist/index.d.ts",
7
+ "directories": {
8
+ "test": "tests"
9
+ },
10
+ "scripts": {
11
+ "build:models": "node scripts/generate-models-links.js",
12
+ "build:documentation": "node scripts/generate-documentation.js",
13
+ "build": "npm run build:models && npm run build:documentation",
14
+ "build:module": "rm -rf dist && tsc -p tsconfig.dist.json",
15
+ "lint": "tsc --noEmit && eslint .",
16
+ "lint:fix": "npm run lint -- --fix",
17
+ "test": "jest --coverage",
18
+ "test:jsonld": "hestia-validate-jsonld '' tests/fixtures",
19
+ "test:terms": "node scripts/validate-terms-models.js && hestia-validate-terms tests/fixtures",
20
+ "prepare-release": "node scripts/update-package-version.js && npm run build",
21
+ "release": "standard-version -a",
22
+ "postrelease": "git push origin develop --follow-tags"
23
+ },
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+ssh://git@gitlab.com/hestia-earth/hestia-engine-models.git"
27
+ },
28
+ "keywords": [
29
+ "hestia",
30
+ "engine",
31
+ "models",
32
+ "gap-filling",
33
+ "calculation",
34
+ "python"
35
+ ],
36
+ "author": "Guillaume Royer <guillaume@hestia.earth>",
37
+ "license": "MIT",
38
+ "bugs": {
39
+ "url": "https://gitlab.com/hestia-earth/hestia-engine-models/issues"
40
+ },
41
+ "homepage": "https://gitlab.com/hestia-earth/hestia-engine-models#readme",
42
+ "peerDependencies": {
43
+ "@hestia-earth/schema": "*"
44
+ },
45
+ "devDependencies": {
46
+ "@babel/preset-typescript": "^7.26.0",
47
+ "@commitlint/cli": "^19.6.1",
48
+ "@commitlint/config-conventional": "^19.6.0",
49
+ "@hestia-earth/eslint-config": "^0.1.0",
50
+ "@hestia-earth/api": "^0.24.34",
51
+ "@hestia-earth/glossary": "^0.60.0",
52
+ "@hestia-earth/json-schema": "^30.5.0",
53
+ "@hestia-earth/schema": "^30.5.0",
54
+ "@hestia-earth/schema-validation": "^30.5.0",
55
+ "@hestia-earth/utils": "^0.13.0",
56
+ "@jest/globals": "^29.7.0",
57
+ "@typescript-eslint/eslint-plugin": "^5.23.0",
58
+ "@typescript-eslint/parser": "^5.23.0",
59
+ "aws-sdk": "^2.1608.0",
60
+ "axios": "^1.7.2",
61
+ "capitalize": "^2.0.4",
62
+ "csvtojson": "^2.0.10",
63
+ "dotenv": "^8.6.0",
64
+ "eslint": "^7.32.0",
65
+ "eslint-plugin-jsdoc": "^30.7.13",
66
+ "husky": "^4.3.8",
67
+ "jest": "^29.7.0",
68
+ "lodash.merge": "^4.6.2",
69
+ "pluralize": "^8.0.0",
70
+ "standard-version": "^9.5.0",
71
+ "ts-jest": "^29.2.5"
72
+ },
73
+ "standard-version": {
74
+ "scripts": {
75
+ "postchangelog": "npm run prepare-release && git add model-links.json && git add hestia_earth/models/**/*.md && git add hestia_earth/models/version.py"
76
+ }
77
+ },
78
+ "husky": {
79
+ "hooks": {
80
+ "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
81
+ }
82
+ }
83
+ }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './models';
@@ -0,0 +1,12 @@
1
+ import { describe, expect, test } from '@jest/globals';
2
+
3
+ import { loadModels } from './models';
4
+
5
+ describe('models', () => {
6
+ describe('loadModels', () => {
7
+ test('load models', () => {
8
+ const { links } = loadModels();
9
+ expect(links?.length > 0).toBeTruthy();
10
+ });
11
+ });
12
+ });
package/src/models.ts ADDED
@@ -0,0 +1,44 @@
1
+ import { EmissionMethodTier } from '@hestia-earth/schema';
2
+
3
+ export interface IModel {
4
+ /**
5
+ * Is model from EcoinventV3.
6
+ */
7
+ ecoinvent: boolean;
8
+ /**
9
+ * Path to the implementation (code) of the model.
10
+ */
11
+ path: string;
12
+ /**
13
+ * Path to the documentation of the model.
14
+ */
15
+ docPath: string;
16
+ /**
17
+ * Path to the API Documentation.
18
+ */
19
+ apiDocsPath?: string;
20
+ /**
21
+ * The name of the model used as `methodModel`.
22
+ */
23
+ model: string;
24
+ /**
25
+ * The term the model is associated with.
26
+ */
27
+ term?: string;
28
+ /**
29
+ * The methodTier of the Emission (if applicable).
30
+ */
31
+ methodTier?: EmissionMethodTier;
32
+ /**
33
+ * A key in the model if term does not exist.
34
+ */
35
+ modelKey?: string;
36
+ }
37
+
38
+ export interface IModelLinks {
39
+ links: IModel[];
40
+ ecoinventLinks?: IModel[];
41
+ ecoinventV3AndEmberClimateLinks?: IModel[];
42
+ }
43
+
44
+ export const loadModels = (): IModelLinks => require('../model-links.json');