@thi.ng/gp 0.3.8 → 0.4.2

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.
Files changed (4) hide show
  1. package/CHANGELOG.md +81 -40
  2. package/README.md +1 -1
  3. package/mep.js +1 -1
  4. package/package.json +105 -100
package/CHANGELOG.md CHANGED
@@ -1,77 +1,118 @@
1
1
  # Change Log
2
2
 
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [0.3.8](https://github.com/thi-ng/umbrella/compare/@thi.ng/gp@0.3.7...@thi.ng/gp@0.3.8) (2021-11-03)
7
-
8
- **Note:** Version bump only for package @thi.ng/gp
9
-
3
+ - **Last updated**: 2021-11-21T17:09:28Z
4
+ - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
10
5
 
6
+ All notable changes to this project will be documented in this file.
7
+ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelines.
11
8
 
9
+ **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
+ and/or version bumps of transitive dependencies.
12
11
 
12
+ ## [0.4.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/gp@0.4.0) (2021-11-17)
13
13
 
14
- ## [0.3.5](https://github.com/thi-ng/umbrella/compare/@thi.ng/gp@0.3.4...@thi.ng/gp@0.3.5) (2021-10-27)
14
+ #### 🚀 Features
15
15
 
16
+ - Using workspaces for local tools ([bf7a404](https://github.com/thi-ng/umbrella/commit/bf7a404))
17
+ Improving the overall build ergonomics
18
+ - introduced a tools workspaces
19
+ - imported it in all needed packages/examples
20
+ - inclusive project root
16
21
 
17
- ### Bug Fixes
22
+ #### ♻️ Refactoring
18
23
 
19
- * **gp:** limit AST.mutate() to max tree depth ([afcdda0](https://github.com/thi-ng/umbrella/commit/afcdda0e10bd7d824af68dd4e79ceb749d16181b))
24
+ - testrunner to binary ([4ebbbb2](https://github.com/thi-ng/umbrella/commit/4ebbbb2))
25
+ this commit reverts (partly) changes made in:
26
+ ef346d7a8753590dc9094108a3d861a8dbd5dd2c
27
+ overall purpose is better testament ergonomics:
28
+ instead of having to pass NODE_OPTIONS with every invocation
29
+ having a binary to handle this for us.
20
30
 
31
+ ### [0.3.9](https://github.com/thi-ng/umbrella/tree/@thi.ng/gp@0.3.9) (2021-11-10)
21
32
 
33
+ #### ♻️ Refactoring
22
34
 
35
+ - update all countdown loops ([a5f374b](https://github.com/thi-ng/umbrella/commit/a5f374b))
23
36
 
37
+ ### [0.3.5](https://github.com/thi-ng/umbrella/tree/@thi.ng/gp@0.3.5) (2021-10-27)
24
38
 
25
- # [0.3.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/gp@0.2.30...@thi.ng/gp@0.3.0) (2021-10-12)
39
+ #### 🩹 Bug fixes
26
40
 
41
+ - limit AST.mutate() to max tree depth ([afcdda0](https://github.com/thi-ng/umbrella/commit/afcdda0))
42
+ - always respect max tree depth to avoid overly complex trees
43
+ due to repeated mutation
44
+ - update docs
27
45
 
28
- ### Build System
46
+ ### [0.3.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/gp@0.3.1) (2021-10-13)
29
47
 
30
- * major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea9fab2a645d6c5f2bf2591459b939c09b6))
48
+ #### ♻️ Refactoring
31
49
 
50
+ - update imports in all tests/pkgs ([effd591](https://github.com/thi-ng/umbrella/commit/effd591))
51
+ - update imports in all pkgs ([5fa2b6f](https://github.com/thi-ng/umbrella/commit/5fa2b6f))
52
+ - add .js suffix for all relative imports
32
53
 
33
- ### BREAKING CHANGES
54
+ ## [0.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/gp@0.3.0) (2021-10-12)
34
55
 
35
- * discontinue CommonJS & UMD versions
56
+ #### 🛑 Breaking changes
36
57
 
37
- - only ESM modules will be published from now on
38
- - CJS obsolete due to ESM support in recent versions of node:
39
- - i.e. launch NodeJS via:
40
- - `node --experimental-specifier-resolution=node --experimental-repl-await`
41
- - in the node REPL use `await import(...)` instead of `require()`
42
- - UMD obsolete due to widespread browser support for ESM
58
+ - major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea))
59
+ - BREAKING CHANGE: discontinue CommonJS & UMD versions
60
+ - only ESM modules will be published from now on
61
+ - CJS obsolete due to ESM support in recent versions of node:
62
+ - i.e. launch NodeJS via:
63
+ - `node --experimental-specifier-resolution=node --experimental-repl-await`
64
+ - in the node REPL use `await import(...)` instead of `require()`
65
+ - UMD obsolete due to widespread browser support for ESM
66
+ Also:
67
+ - normalize/restructure/reorg all package.json files
68
+ - cleanup all build scripts, remove obsolete
69
+ - switch from mocha to [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament) for all tests
43
70
 
44
- Also:
45
- - normalize/restructure/reorg all package.json files
46
- - cleanup all build scripts, remove obsolete
47
- - switch from mocha to @thi.ng/testament for all tests
71
+ #### ♻️ Refactoring
48
72
 
73
+ - minor pkg restructure (various) ([47f88d2](https://github.com/thi-ng/umbrella/commit/47f88d2))
74
+ - update deps & imports in various pkgs ([e1cf29e](https://github.com/thi-ng/umbrella/commit/e1cf29e))
75
+ - largely related to recent updates/restructuring of these packages:
76
+ - api
77
+ - defmulti
78
+ - errors
79
+ - logger
80
+ - update imports (transducers) ([d2c6ead](https://github.com/thi-ng/umbrella/commit/d2c6ead))
81
+ - update imports ([138571a](https://github.com/thi-ng/umbrella/commit/138571a))
82
+ - update all tests in _all_ pkgs ([8b582bc](https://github.com/thi-ng/umbrella/commit/8b582bc))
83
+ - update all to use [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament)
49
84
 
85
+ ## [0.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/gp@0.2.0) (2020-12-22)
50
86
 
87
+ #### 🛑 Breaking changes
51
88
 
89
+ - fix [#256](https://github.com/thi-ng/umbrella/issues/256) replace enum w/ type alias ([6fd4291](https://github.com/thi-ng/umbrella/commit/6fd4291))
90
+ - BREAKING CHANGE: replace GeneType w/ type alias
52
91
 
92
+ ### [0.1.9](https://github.com/thi-ng/umbrella/tree/@thi.ng/gp@0.1.9) (2020-04-05)
53
93
 
54
- # [0.2.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/gp@0.1.35...@thi.ng/gp@0.2.0) (2020-12-22)
94
+ #### ♻️ Refactoring
55
95
 
56
- ### Code Refactoring
96
+ - switch to non-const enums ([5bc8a4e](https://github.com/thi-ng/umbrella/commit/5bc8a4e))
57
97
 
58
- - **gp:** fix [#256](https://github.com/thi-ng/umbrella/issues/256) replace enum w/ type alias ([6fd4291](https://github.com/thi-ng/umbrella/commit/6fd4291eb2be4baae93b3f365478f73990e044b0))
98
+ ### [0.1.3](https://github.com/thi-ng/umbrella/tree/@thi.ng/gp@0.1.3) (2020-02-25)
59
99
 
60
- ### BREAKING CHANGES
100
+ #### ♻️ Refactoring
61
101
 
62
- - **gp:** replace GeneType w/ type alias
102
+ - update imports ([8d1698c](https://github.com/thi-ng/umbrella/commit/8d1698c))
63
103
 
64
- # 0.1.0 (2019-11-30)
104
+ ## [0.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/gp@0.1.0) (2019-11-30)
65
105
 
66
- ### Bug Fixes
106
+ #### 🚀 Features
67
107
 
68
- - **gp:** update ASTNode as recursive type (TS3.7) ([33fbd7f](https://github.com/thi-ng/umbrella/commit/33fbd7f152df370270690e5b1381a86f647f9b6b))
108
+ - update MEP.decodeChromosome, tests, add docs ([e339925](https://github.com/thi-ng/umbrella/commit/e339925))
109
+ - update crossover/mutation for both AST/MEP, add tests ([9852631](https://github.com/thi-ng/umbrella/commit/9852631))
110
+ - add opt min depth filter for MEP.decodeChromosome() ([921fcdd](https://github.com/thi-ng/umbrella/commit/921fcdd))
111
+ - add MEP, refactor all as classes, add/update types, tests ([d9061b1](https://github.com/thi-ng/umbrella/commit/d9061b1))
112
+ - add support for arbitrary op arities, simplify ([8e71a88](https://github.com/thi-ng/umbrella/commit/8e71a88))
113
+ - update ASTOpts
114
+ - import as new package ([dcfee15](https://github.com/thi-ng/umbrella/commit/dcfee15))
69
115
 
70
- ### Features
116
+ #### 🩹 Bug fixes
71
117
 
72
- - **gp:** add MEP, refactor all as classes, add/update types, tests ([d9061b1](https://github.com/thi-ng/umbrella/commit/d9061b17a6aa89f690a0c97c12825c077f45e38b))
73
- - **gp:** add opt min depth filter for MEP.decodeChromosome() ([921fcdd](https://github.com/thi-ng/umbrella/commit/921fcdd4e1c1919e4539c033df591782b63cff0a))
74
- - **gp:** add support for arbitrary op arities, simplify ([8e71a88](https://github.com/thi-ng/umbrella/commit/8e71a88fb7b1ca36e7b89b5f2923a198c974c575))
75
- - **gp:** import as new package ([dcfee15](https://github.com/thi-ng/umbrella/commit/dcfee156c8b196c6c4a4f2b5f0f7986e19bacee8))
76
- - **gp:** update crossover/mutation for both AST/MEP, add tests ([9852631](https://github.com/thi-ng/umbrella/commit/9852631e227d9704c41f9dbe8a6b2cce10bd8fa9))
77
- - **gp:** update MEP.decodeChromosome, tests, add docs ([e339925](https://github.com/thi-ng/umbrella/commit/e339925bc1fcbf2f7787e6453d2e29922adb3836))
118
+ - update ASTNode as recursive type (TS3.7) ([33fbd7f](https://github.com/thi-ng/umbrella/commit/33fbd7f))
package/README.md CHANGED
@@ -86,7 +86,7 @@ node --experimental-repl-await
86
86
  > const gp = await import("@thi.ng/gp");
87
87
  ```
88
88
 
89
- Package sizes (gzipped, pre-treeshake): ESM: 1.25 KB
89
+ Package sizes (gzipped, pre-treeshake): ESM: 1.29 KB
90
90
 
91
91
  ## Dependencies
92
92
 
package/mep.js CHANGED
@@ -82,7 +82,7 @@ export class MEP {
82
82
  mutate(chromo) {
83
83
  const { rnd, probMutate } = this.opts;
84
84
  const res = new Array(chromo.length);
85
- for (let i = chromo.length; --i >= 0;) {
85
+ for (let i = chromo.length; i-- > 0;) {
86
86
  res[i] = rnd.float() < probMutate ? this.randomGene(i) : chromo[i];
87
87
  }
88
88
  return res;
package/package.json CHANGED
@@ -1,107 +1,112 @@
1
1
  {
2
- "name": "@thi.ng/gp",
3
- "version": "0.3.8",
4
- "description": "Genetic programming helpers & strategies (tree based & multi-expression programming)",
5
- "type": "module",
6
- "module": "./index.js",
7
- "typings": "./index.d.ts",
8
- "sideEffects": false,
9
- "repository": {
10
- "type": "git",
11
- "url": "https://github.com/thi-ng/umbrella.git"
2
+ "name": "@thi.ng/gp",
3
+ "version": "0.4.2",
4
+ "description": "Genetic programming helpers & strategies (tree based & multi-expression programming)",
5
+ "type": "module",
6
+ "module": "./index.js",
7
+ "typings": "./index.d.ts",
8
+ "sideEffects": false,
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/thi-ng/umbrella.git"
12
+ },
13
+ "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/gp#readme",
14
+ "funding": [
15
+ {
16
+ "type": "github",
17
+ "url": "https://github.com/sponsors/postspectacular"
12
18
  },
13
- "homepage": "https://github.com/thi-ng/umbrella/tree/develop/packages/gp#readme",
14
- "funding": [
15
- {
16
- "type": "github",
17
- "url": "https://github.com/sponsors/postspectacular"
18
- },
19
- {
20
- "type": "patreon",
21
- "url": "https://patreon.com/thing_umbrella"
22
- }
23
- ],
24
- "author": "Karsten Schmidt <k+npm@thi.ng>",
25
- "license": "Apache-2.0",
26
- "scripts": {
27
- "build": "yarn clean && tsc --declaration",
28
- "clean": "rimraf *.js *.d.ts *.map doc",
29
- "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
- "doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
31
- "doc:readme": "yarn doc:stats && ../../scripts/node-esm ../../tools/src/readme.ts",
32
- "doc:stats": "../../scripts/node-esm ../../tools/src/module-stats.ts",
33
- "pub": "yarn build && yarn publish --access public",
34
- "test": "testament test"
19
+ {
20
+ "type": "patreon",
21
+ "url": "https://patreon.com/thing_umbrella"
22
+ }
23
+ ],
24
+ "author": "Karsten Schmidt <k+npm@thi.ng>",
25
+ "license": "Apache-2.0",
26
+ "scripts": {
27
+ "build": "yarn clean && tsc --declaration",
28
+ "clean": "rimraf '*.js' '*.d.ts' '*.map' doc",
29
+ "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
+ "doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
31
+ "doc:readme": "yarn doc:stats && tools:readme",
32
+ "doc:stats": "tools:module-stats",
33
+ "pub": "yarn npm publish --access public",
34
+ "test": "testament test"
35
+ },
36
+ "dependencies": {
37
+ "@thi.ng/api": "^8.3.2",
38
+ "@thi.ng/errors": "^2.1.2",
39
+ "@thi.ng/math": "^5.1.2",
40
+ "@thi.ng/random": "^3.2.2",
41
+ "@thi.ng/transducers": "^8.1.2",
42
+ "@thi.ng/zipper": "^2.1.2"
43
+ },
44
+ "devDependencies": {
45
+ "@microsoft/api-extractor": "^7.18.19",
46
+ "@thi.ng/testament": "^0.2.2",
47
+ "rimraf": "^3.0.2",
48
+ "tools": "^0.0.1",
49
+ "typedoc": "^0.22.9",
50
+ "typescript": "^4.5.2"
51
+ },
52
+ "keywords": [
53
+ "agent",
54
+ "array",
55
+ "ast",
56
+ "codegen",
57
+ "crossover",
58
+ "datastructure",
59
+ "evolutionary",
60
+ "generative",
61
+ "genetic",
62
+ "mep",
63
+ "multi-expression",
64
+ "mutation",
65
+ "phenotype",
66
+ "self-organization",
67
+ "tree",
68
+ "typescript"
69
+ ],
70
+ "publishConfig": {
71
+ "access": "public"
72
+ },
73
+ "engines": {
74
+ "node": ">=12.7"
75
+ },
76
+ "files": [
77
+ "*.js",
78
+ "*.d.ts"
79
+ ],
80
+ "exports": {
81
+ ".": {
82
+ "import": "./index.js"
35
83
  },
36
- "dependencies": {
37
- "@thi.ng/api": "^8.1.0",
38
- "@thi.ng/errors": "^2.0.6",
39
- "@thi.ng/math": "^5.0.7",
40
- "@thi.ng/random": "^3.1.3",
41
- "@thi.ng/transducers": "^8.0.7",
42
- "@thi.ng/zipper": "^2.0.7"
84
+ "./api": {
85
+ "import": "./api.js"
43
86
  },
44
- "devDependencies": {
45
- "@thi.ng/testament": "^0.1.6"
87
+ "./ast": {
88
+ "import": "./ast.js"
46
89
  },
47
- "keywords": [
48
- "agent",
49
- "array",
50
- "ast",
51
- "codegen",
52
- "crossover",
53
- "datastructure",
54
- "evolutionary",
55
- "generative",
56
- "genetic",
57
- "mep",
58
- "multi-expression",
59
- "mutation",
60
- "phenotype",
61
- "self-organization",
62
- "tree",
63
- "typescript"
90
+ "./mep": {
91
+ "import": "./mep.js"
92
+ }
93
+ },
94
+ "thi.ng": {
95
+ "blog": [
96
+ {
97
+ "title": "Evolutionary failures (Part 1)",
98
+ "url": "https://medium.com/@thi.ng/evolutionary-failures-part-1-54522c69be37"
99
+ }
64
100
  ],
65
- "publishConfig": {
66
- "access": "public"
67
- },
68
- "engines": {
69
- "node": ">=12.7"
70
- },
71
- "files": [
72
- "*.js",
73
- "*.d.ts"
101
+ "related": [
102
+ "defmulti",
103
+ "pointfree",
104
+ "sexpr",
105
+ "shader-ast",
106
+ "zipper"
74
107
  ],
75
- "exports": {
76
- ".": {
77
- "import": "./index.js"
78
- },
79
- "./api": {
80
- "import": "./api.js"
81
- },
82
- "./ast": {
83
- "import": "./ast.js"
84
- },
85
- "./mep": {
86
- "import": "./mep.js"
87
- }
88
- },
89
- "thi.ng": {
90
- "blog": [
91
- {
92
- "title": "Evolutionary failures (Part 1)",
93
- "url": "https://medium.com/@thi.ng/evolutionary-failures-part-1-54522c69be37"
94
- }
95
- ],
96
- "related": [
97
- "defmulti",
98
- "pointfree",
99
- "sexpr",
100
- "shader-ast",
101
- "zipper"
102
- ],
103
- "status": "alpha",
104
- "year": 2019
105
- },
106
- "gitHead": "852cd2450617c86d15d18477dc634f17f04202eb"
107
- }
108
+ "status": "alpha",
109
+ "year": 2019
110
+ },
111
+ "gitHead": "e8a7c2a40191b391cef182c2978e5a6c85987a87\n"
112
+ }