@thi.ng/fuzzy 2.0.7 → 2.1.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 (3) hide show
  1. package/CHANGELOG.md +117 -64
  2. package/README.md +1 -1
  3. package/package.json +100 -95
package/CHANGELOG.md CHANGED
@@ -1,67 +1,120 @@
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
- ## [2.0.7](https://github.com/thi-ng/umbrella/compare/@thi.ng/fuzzy@2.0.6...@thi.ng/fuzzy@2.0.7) (2021-11-03)
7
-
8
- **Note:** Version bump only for package @thi.ng/fuzzy
9
-
10
-
11
-
12
-
13
-
14
- # [2.0.0](https://github.com/thi-ng/umbrella/compare/@thi.ng/fuzzy@1.0.4...@thi.ng/fuzzy@2.0.0) (2021-10-12)
15
-
16
-
17
- ### Build System
18
-
19
- * major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea9fab2a645d6c5f2bf2591459b939c09b6))
20
-
21
-
22
- ### BREAKING CHANGES
23
-
24
- * discontinue CommonJS & UMD versions
3
+ - **Last updated**: 2021-11-21T17:09:28Z
4
+ - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
25
5
 
26
- - only ESM modules will be published from now on
27
- - CJS obsolete due to ESM support in recent versions of node:
28
- - i.e. launch NodeJS via:
29
- - `node --experimental-specifier-resolution=node --experimental-repl-await`
30
- - in the node REPL use `await import(...)` instead of `require()`
31
- - UMD obsolete due to widespread browser support for ESM
32
-
33
- Also:
34
- - normalize/restructure/reorg all package.json files
35
- - cleanup all build scripts, remove obsolete
36
- - switch from mocha to @thi.ng/testament for all tests
37
-
38
-
39
-
40
-
41
-
42
-
43
- ## [1.0.4](https://github.com/thi-ng/umbrella/compare/@thi.ng/fuzzy@1.0.3...@thi.ng/fuzzy@1.0.4) (2021-09-03)
44
-
45
- **Note:** Version bump only for package @thi.ng/fuzzy
46
-
47
- # 0.1.0 (2020-12-22)
48
-
49
- ### Features
50
-
51
- - **fuzzy:** add alphaCut() & implication() fns ([8ec15fa](https://github.com/thi-ng/umbrella/commit/8ec15fa5c0f33fd7342c4047a5523e9fd0597ed1))
52
- - **fuzzy:** add evaluate() ([0ffc9d0](https://github.com/thi-ng/umbrella/commit/0ffc9d01f9bd40ba616d1f59e3ced74fa7c0dc7f))
53
- - **fuzzy:** add maxima(), compose(), restructure ([f15d8d7](https://github.com/thi-ng/umbrella/commit/f15d8d73df2a438d4866d57fc25fed625acd7a8a))
54
- - **fuzzy:** add min true threshold for classify() ([6f49a30](https://github.com/thi-ng/umbrella/commit/6f49a308c62a598f6d0a0e6e5046cd8e24d81eab))
55
- - **fuzzy:** add shapes, strongAnd(), update combineTerms() ([5bf8f0c](https://github.com/thi-ng/umbrella/commit/5bf8f0c01541afeb367eff21cb45118a1b62549a))
56
- - **fuzzy:** add strict arg for classify(), update docs ([b39248f](https://github.com/thi-ng/umbrella/commit/b39248f359aa0148ff72c484d78175f8f435fe97))
57
- - **fuzzy:** add/update/migrate defuzz strategies ([c1ee15f](https://github.com/thi-ng/umbrella/commit/c1ee15fdce2b08176c5bc97ba9ca7a56a84817c7))
58
- - **fuzzy:** import as new pkg, refactor ([a578194](https://github.com/thi-ng/umbrella/commit/a57819454f38de4c35095b64b9e7028d9ac21454))
59
- - **fuzzy:** make lvar, rules, defuzz() typesafe ([0b210c3](https://github.com/thi-ng/umbrella/commit/0b210c3841ce9184b8dfb83ca2dde5ceca0a3b6e))
60
- - **fuzzy:** migrate t-norms from [@thi](https://github.com/thi).ng/math pkg ([f8993e0](https://github.com/thi-ng/umbrella/commit/f8993e0dc1aed0243629a21d36ee85e91b2e938d))
61
- - **fuzzy:** update defuzz() & strategies ([cf337f3](https://github.com/thi-ng/umbrella/commit/cf337f36dbf24a9cfc4c6f364c3aea82428b5940))
62
- - **fuzzy:** update defuzz() output prep ([81abe8c](https://github.com/thi-ng/umbrella/commit/81abe8cb718ce335940234aecf693ba53564a715))
63
- - **fuzzy:** update types, update compose ([566469d](https://github.com/thi-ng/umbrella/commit/566469d5c420cc2c4fdc3b107e04b52929b61915))
64
-
65
- ### Performance Improvements
66
-
67
- - **fuzzy:** update defuzz() ([60030dd](https://github.com/thi-ng/umbrella/commit/60030dd9a5ceb02d58ad89766e14f80019f6f72f))
6
+ All notable changes to this project will be documented in this file.
7
+ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelines.
8
+
9
+ **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
+ and/or version bumps of transitive dependencies.
11
+
12
+ ## [2.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/fuzzy@2.1.0) (2021-11-17)
13
+
14
+ #### 🚀 Features
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
21
+
22
+ #### ♻️ Refactoring
23
+
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.
30
+
31
+ ### [2.0.1](https://github.com/thi-ng/umbrella/tree/@thi.ng/fuzzy@2.0.1) (2021-10-13)
32
+
33
+ #### ♻️ Refactoring
34
+
35
+ - update imports in all tests/pkgs ([effd591](https://github.com/thi-ng/umbrella/commit/effd591))
36
+ - update imports in all pkgs ([5fa2b6f](https://github.com/thi-ng/umbrella/commit/5fa2b6f))
37
+ - add .js suffix for all relative imports
38
+
39
+ # [2.0.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/fuzzy@2.0.0) (2021-10-12)
40
+
41
+ #### 🛑 Breaking changes
42
+
43
+ - major update of ALL pkgs (export maps, ESM only) ([0d1d6ea](https://github.com/thi-ng/umbrella/commit/0d1d6ea))
44
+ - BREAKING CHANGE: discontinue CommonJS & UMD versions
45
+ - only ESM modules will be published from now on
46
+ - CJS obsolete due to ESM support in recent versions of node:
47
+ - i.e. launch NodeJS via:
48
+ - `node --experimental-specifier-resolution=node --experimental-repl-await`
49
+ - in the node REPL use `await import(...)` instead of `require()`
50
+ - UMD obsolete due to widespread browser support for ESM
51
+ Also:
52
+ - normalize/restructure/reorg all package.json files
53
+ - cleanup all build scripts, remove obsolete
54
+ - switch from mocha to [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament) for all tests
55
+
56
+ #### ♻️ Refactoring
57
+
58
+ - update imports ([3d46498](https://github.com/thi-ng/umbrella/commit/3d46498))
59
+ - update all tests in _all_ pkgs ([8b582bc](https://github.com/thi-ng/umbrella/commit/8b582bc))
60
+ - update all to use [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament)
61
+
62
+ ### [0.1.3](https://github.com/thi-ng/umbrella/tree/@thi.ng/fuzzy@0.1.3) (2021-02-20)
63
+
64
+ #### ♻️ Refactoring
65
+
66
+ - update to use new Range type ([1cc23c6](https://github.com/thi-ng/umbrella/commit/1cc23c6))
67
+ - use clamp0() ([2825130](https://github.com/thi-ng/umbrella/commit/2825130))
68
+
69
+ ## [0.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/fuzzy@0.1.0) (2020-12-22)
70
+
71
+ #### 🚀 Features
72
+
73
+ - add/update/migrate defuzz strategies ([c1ee15f](https://github.com/thi-ng/umbrella/commit/c1ee15f))
74
+ - move to /strategies subdir
75
+ - make centroidStrategy() default
76
+ - rename & optimize bisectorStrategy()
77
+ - add docstrings w/ diagrams for all strats
78
+ - update tests
79
+ - update types, update compose ([566469d](https://github.com/thi-ng/umbrella/commit/566469d))
80
+ - add new LVar types
81
+ - remove combineTerms(), merge into compose()
82
+ - remove implication(), merge into compose()
83
+ - update compose() to return optimized fns
84
+ - add intersect()/union() syntax sugar
85
+ - update defuzz()
86
+ - make lvar, rules, defuzz() typesafe ([0b210c3](https://github.com/thi-ng/umbrella/commit/0b210c3))
87
+ - add/update types (Rule, LVar, LVar helpers)
88
+ - update variable() & rule factories (add generics)
89
+ - make defuzz() generic, infer return type
90
+ - update tests
91
+ - update defuzz() & strategies ([cf337f3](https://github.com/thi-ng/umbrella/commit/cf337f3))
92
+ - simplify DefuzzStrategy to take single FuzzyFn
93
+ - add `combine` s-norm arg to defuzz() and compose output sets before
94
+ handing them to the strategy impl
95
+ - split maximaStrategy() into individual fns
96
+ - simplify/rename strategy opts
97
+ - update strategy interval iteration to minimize floating point errors
98
+ - update tests
99
+ - update defuzz() output prep ([81abe8c](https://github.com/thi-ng/umbrella/commit/81abe8c))
100
+ - add support for custom implications of rule outputs
101
+ - update/optimize rule weight handling
102
+ - add alphaCut() & implication() fns ([8ec15fa](https://github.com/thi-ng/umbrella/commit/8ec15fa))
103
+ - add min true threshold for classify() ([6f49a30](https://github.com/thi-ng/umbrella/commit/6f49a30))
104
+ - update docs
105
+ - migrate t-norms from [@thi.ng/math](https://github.com/thi-ng/umbrella/tree/main/packages/math) pkg ([f8993e0](https://github.com/thi-ng/umbrella/commit/f8993e0))
106
+ - add maxima(), compose(), restructure ([f15d8d7](https://github.com/thi-ng/umbrella/commit/f15d8d7))
107
+ - add strict arg for classify(), update docs ([b39248f](https://github.com/thi-ng/umbrella/commit/b39248f))
108
+ - add shapes, strongAnd(), update combineTerms() ([5bf8f0c](https://github.com/thi-ng/umbrella/commit/5bf8f0c))
109
+ - add evaluate() ([0ffc9d0](https://github.com/thi-ng/umbrella/commit/0ffc9d0))
110
+ - import as new pkg, refactor ([a578194](https://github.com/thi-ng/umbrella/commit/a578194))
111
+ - re-use T-norms migrated to [@thi.ng/maths](https://github.com/thi-ng/umbrella/tree/main/packages/maths)
112
+ - add variable() factory
113
+ - add classify()
114
+ - fix off-by-one error in trapezoid()
115
+ - add docstrings
116
+
117
+ #### ⏱ Performance improvements
118
+
119
+ - update defuzz() ([60030dd](https://github.com/thi-ng/umbrella/commit/60030dd))
120
+ - skip preparation of rule outputs which aren't requested
package/README.md CHANGED
@@ -89,7 +89,7 @@ node --experimental-repl-await
89
89
  > const fuzzy = await import("@thi.ng/fuzzy");
90
90
  ```
91
91
 
92
- Package sizes (gzipped, pre-treeshake): ESM: 1.66 KB
92
+ Package sizes (gzipped, pre-treeshake): ESM: 1.73 KB
93
93
 
94
94
  ## Dependencies
95
95
 
package/package.json CHANGED
@@ -1,104 +1,109 @@
1
1
  {
2
- "name": "@thi.ng/fuzzy",
3
- "version": "2.0.7",
4
- "description": "Fuzzy logic operators & configurable rule inferencing engine",
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/fuzzy",
3
+ "version": "2.1.2",
4
+ "description": "Fuzzy logic operators & configurable rule inferencing engine",
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/master/packages/fuzzy#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/master/packages/fuzzy#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 strategies",
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 strategies",
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/math": "^5.1.2"
39
+ },
40
+ "devDependencies": {
41
+ "@microsoft/api-extractor": "^7.18.19",
42
+ "@thi.ng/testament": "^0.2.2",
43
+ "rimraf": "^3.0.2",
44
+ "tools": "^0.0.1",
45
+ "typedoc": "^0.22.9",
46
+ "typescript": "^4.5.2"
47
+ },
48
+ "keywords": [
49
+ "agent",
50
+ "functional",
51
+ "math",
52
+ "fuzzy",
53
+ "inference",
54
+ "logic",
55
+ "rule",
56
+ "t-norm",
57
+ "typescript"
58
+ ],
59
+ "publishConfig": {
60
+ "access": "public"
61
+ },
62
+ "engines": {
63
+ "node": ">=12.7"
64
+ },
65
+ "files": [
66
+ "*.js",
67
+ "*.d.ts",
68
+ "strategies"
69
+ ],
70
+ "exports": {
71
+ ".": {
72
+ "import": "./index.js"
35
73
  },
36
- "dependencies": {
37
- "@thi.ng/api": "^8.1.0",
38
- "@thi.ng/math": "^5.0.7"
74
+ "./api": {
75
+ "import": "./api.js"
39
76
  },
40
- "devDependencies": {
41
- "@thi.ng/testament": "^0.1.6"
77
+ "./defuzz": {
78
+ "import": "./defuzz.js"
42
79
  },
43
- "keywords": [
44
- "agent",
45
- "functional",
46
- "math",
47
- "fuzzy",
48
- "inference",
49
- "logic",
50
- "rule",
51
- "t-norm",
52
- "typescript"
53
- ],
54
- "publishConfig": {
55
- "access": "public"
80
+ "./rules": {
81
+ "import": "./rules.js"
56
82
  },
57
- "engines": {
58
- "node": ">=12.7"
83
+ "./shapes": {
84
+ "import": "./shapes.js"
59
85
  },
60
- "files": [
61
- "*.js",
62
- "*.d.ts",
63
- "strategies"
64
- ],
65
- "exports": {
66
- ".": {
67
- "import": "./index.js"
68
- },
69
- "./api": {
70
- "import": "./api.js"
71
- },
72
- "./defuzz": {
73
- "import": "./defuzz.js"
74
- },
75
- "./rules": {
76
- "import": "./rules.js"
77
- },
78
- "./shapes": {
79
- "import": "./shapes.js"
80
- },
81
- "./strategies/bisector": {
82
- "import": "./strategies/bisector.js"
83
- },
84
- "./strategies/centroid": {
85
- "import": "./strategies/centroid.js"
86
- },
87
- "./strategies/maxima": {
88
- "import": "./strategies/maxima.js"
89
- },
90
- "./strategies/opts": {
91
- "import": "./strategies/opts.js"
92
- },
93
- "./tnorms": {
94
- "import": "./tnorms.js"
95
- },
96
- "./var": {
97
- "import": "./var.js"
98
- }
86
+ "./strategies/bisector": {
87
+ "import": "./strategies/bisector.js"
99
88
  },
100
- "thi.ng": {
101
- "year": 2020
89
+ "./strategies/centroid": {
90
+ "import": "./strategies/centroid.js"
102
91
  },
103
- "gitHead": "852cd2450617c86d15d18477dc634f17f04202eb"
104
- }
92
+ "./strategies/maxima": {
93
+ "import": "./strategies/maxima.js"
94
+ },
95
+ "./strategies/opts": {
96
+ "import": "./strategies/opts.js"
97
+ },
98
+ "./tnorms": {
99
+ "import": "./tnorms.js"
100
+ },
101
+ "./var": {
102
+ "import": "./var.js"
103
+ }
104
+ },
105
+ "thi.ng": {
106
+ "year": 2020
107
+ },
108
+ "gitHead": "e8a7c2a40191b391cef182c2978e5a6c85987a87\n"
109
+ }