Skip to content

Commit b429a2e

Browse files
committed
Preparing for release.
1 parent 7ac9b35 commit b429a2e

26 files changed

+2770
-788
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
.hypothesis
2+
.git
23
.cache/*
34
__pycache__
45
.ipynb_checkpoints/
5-
_config.yml
6+
.pytest_cache
67
DEV*
78
TODO-fuzzy
89
box

.pytest_cache/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# pytest cache directory #
2+
3+
This directory contains data from the pytest's cache plugin,
4+
which provides the `--lf` and `--ff` options, as well as the `cache` fixture.
5+
6+
**Do not** commit this to version control.
7+
8+
See [the docs](https://docs.pytest.org/en/latest/cache.html) for more information.

.pytest_cache/v/cache/lastfailed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

.pytest_cache/v/cache/nodeids

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
[
2+
"test_functionality.py::test_array",
3+
"test_functionality.py::test_value",
4+
"test_functionality.py::test_rating",
5+
"test_units.py::Test_Functions::test_R",
6+
"test_units.py::Test_Functions::test_S",
7+
"test_units.py::Test_Functions::test_alpha",
8+
"test_units.py::Test_Functions::test_alpha_2",
9+
"test_units.py::Test_Functions::test_bounded_linear",
10+
"test_units.py::Test_Functions::test_bounded_sigmoid",
11+
"test_units.py::Test_Functions::test_constant",
12+
"test_units.py::Test_Functions::test_gauss",
13+
"test_units.py::Test_Functions::test_inv",
14+
"test_units.py::Test_Functions::test_linear",
15+
"test_units.py::Test_Functions::test_moderate",
16+
"test_units.py::Test_Functions::test_noop",
17+
"test_units.py::Test_Functions::test_normalize",
18+
"test_units.py::Test_Functions::test_rectangular",
19+
"test_units.py::Test_Functions::test_sigmoid",
20+
"test_units.py::Test_Functions::test_simple_sigmoid",
21+
"test_units.py::Test_Functions::test_singleton",
22+
"test_units.py::Test_Functions::test_trapezoid",
23+
"test_units.py::Test_Functions::test_triangular",
24+
"test_units.py::Test_Functions::test_triangular_sigmoid",
25+
"test_units.py::Test_Hedges::test_minus",
26+
"test_units.py::Test_Hedges::test_plus",
27+
"test_units.py::Test_Hedges::test_very",
28+
"test_units.py::Test_Combinators::test_MAX",
29+
"test_units.py::Test_Combinators::test_MIN",
30+
"test_units.py::Test_Combinators::test_bounded_sum",
31+
"test_units.py::Test_Combinators::test_einstein_product",
32+
"test_units.py::Test_Combinators::test_einstein_sum",
33+
"test_units.py::Test_Combinators::test_gamma_op",
34+
"test_units.py::Test_Combinators::test_hamacher_product",
35+
"test_units.py::Test_Combinators::test_hamacher_sum",
36+
"test_units.py::Test_Combinators::test_lambda_op",
37+
"test_units.py::Test_Combinators::test_lukasiewicz_AND",
38+
"test_units.py::Test_Combinators::test_lukasiewicz_OR",
39+
"test_units.py::Test_Combinators::test_product",
40+
"test_units.py::Test_Domain::test_basics",
41+
"test_units.py::Test_Set::test_complement",
42+
"test_units.py::Test_Set::test_eq",
43+
"test_units.py::Test_Set::test_normalized",
44+
"test_units.py::Test_Set::test_sub_super_set",
45+
"test_units.py::Test_Rules::test_rescale",
46+
"test_units.py::Test_Truth::test_fairly_false_and_very_true",
47+
"test_units.py::Test_Truth::test_true_and_false",
48+
"test_units.py::Test_Truth::test_very_false_and_fairly_true",
49+
"fuzzy/classes.py::fuzzy.classes.Domain",
50+
"fuzzy/combinators.py::fuzzy.combinators.simple_disjoint_sum",
51+
"fuzzy/functions.py::fuzzy.functions.bounded_linear",
52+
"fuzzy/functions.py::fuzzy.functions.bounded_sigmoid",
53+
"fuzzy/functions.py::fuzzy.functions.constant",
54+
"fuzzy/functions.py::fuzzy.functions.linear",
55+
"fuzzy/functions.py::fuzzy.functions.simple_sigmoid",
56+
"fuzzy/functions.py::fuzzy.functions.singleton",
57+
"fuzzy/functions.py::fuzzy.functions.triangular_sigmoid",
58+
"fuzzy/rules.py::fuzzy.rules.round_partial"
59+
]

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
If you want to contribute, you can do so by pull requests on github or by posting issues.
2+
Format style should follow PEP8.

Dockerfile

Lines changed: 0 additions & 8 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 Anselm Kiefner
3+
Copyright (c) 2017-2019 Anselm Kiefner
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

META.stay

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
name: fuzzylogic
3+
description: Fuzzy Logic for Python 3
4+
license: MIT
5+
url: https://github.com/amogorkon/fuzzylogic
6+
version: 0.1.1
7+
author: Anselm Kiefner
8+
author_email: fuzzylogic-pypi@anselm.kiefner.de
9+
python_requires: >3.6
10+
11+
keywords: [fuzzy logic]
12+
classifiers:::[
13+
Development Status :: 4 - Beta
14+
Intended Audience :: Developers
15+
Intended Audience :: Education
16+
Intended Audience :: Manufacturing
17+
Intended Audience :: Science/Research
18+
Natural Language :: English
19+
License :: OSI Approved :: MIT License
20+
Operating System :: OS Independent
21+
Programming Language :: Python :: 3 :: Only
22+
Topic :: Scientific/Engineering :: Artificial Intelligence
23+
Topic :: Scientific/Engineering :: Mathematics
24+
Topic :: Scientific/Engineering :: Information Analysis
25+
]:::

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# fuzzy - Fuzzy Logic for Python 3
2-
3-
Thanks to hypothesis unit tests, I'm pretty confident that things should work out of the box in most cases. This is the third or fourth time I rebuilt this library from scratch to find the sweet spot between ease of use (beautiful is better than ugly!), testability (simple is better than complex!) and potential to optimize for performance (practicality beats purity!).
2+
This is the fourth time I rebuilt this library from scratch to find the sweet spot between ease of use (beautiful is better than ugly!), testability (simple is better than complex!) and potential to optimize for performance (practicality beats purity!).
43

54
### Why a new library?
65
The first time I was confronted with fuzzy logic, I fell in love with the concept, but after reading books and checking out libraries etc. I found it frustrating how most people make fuzzy logic appear complicated, hard to handle and incorporate in code.
@@ -12,14 +11,14 @@ Finally, most education on the subject emphasize sets and membership functions,
1211
So, the idea is to have four main parts that work together: domains, sets, functions and rules. You start modelling your system by defining your domain of interest. Then you think about where your interesting points are in that domain and look for a function that might do what you want. In general, fuzzy.functions map any value to [0,1], that's all. Then simply wrap your function in a Set and assign this to the domain in question. Once assigned, you can plot that set and see if it actually looks how you imagined. Now that you have one or more sets, you also can start to combine them with set operations &, |, ~, etc. It's fairly straight forward.
1312
Finally, use the Rules to map input domain to output domain to actually control stuff.
1413

15-
### Warning: Magic!
14+
### Warning: Magic
1615
To make it possible to write fuzzy logic in the most pythonic and simplest way imaginable, it was necessary to employ some magic tricks that normally are discouraged, but at least there's no black magic involved (aka meta-programming etc.), so things are easy to debug if there is a problem. Most notably:
17-
* all functions are recursive closures (which makes it kinda hard to serialize things, if you want to do that)
16+
* all functions are recursive closures (which makes it kinda hard to serialize things, if you really want to do that)
1817
* Set uses a lot of dunder functions to implement their logic, which can be a bit daunting at first glance
1918
* Domain and Set uses an assignment trick to make it possible to instantiate Set() without passing domain and name over and over (yet still be explicit, just not the way one would normally expect). This also allows to call sets as Domain.attributes, which also normally shouldn't be possible (since they are technically not attributes). However, this allows interesting things like dangling sets (sets without domains) that can be freely combined with other sets to avoid cluttering of domain-namespaces and just have the resulting set assigned to a domain to work with.
2019

2120

22-
Check the notebook for working examples and documentation.
21+
Check the Showcase notebook for working examples and documentation.
2322

2423
Have fun!
2524
- Anselm Kiefner

Showcase.ipynb

Lines changed: 0 additions & 432 deletions
This file was deleted.

0 commit comments

Comments
 (0)