Skip to content

Commit edfb501

Browse files
committed
bugfix?
1 parent 09a311f commit edfb501

20 files changed

+179
-119
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
.git
33
.cache/*
44
__pycache__
5+
.pytest_cache/*
56
.ipynb_checkpoints/
67
.pytest_cache
8+
dist/*
79
DEV*
810
TODO-fuzzy
911
box
12+

.pytest_cache/v/cache/lastfailed

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
{}
1+
{
2+
"test/test_functionality.py": true,
3+
"test/test_units.py": true
4+
}

.pytest_cache/v/cache/nodeids

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1 @@
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-
]
1+
[]

src/CODE fuzzy.ipynb renamed to CODE fuzzy.ipynb

Lines changed: 59 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"metadata": {},
77
"outputs": [],
88
"source": [
9-
"%%writefile fuzzy/rules.py\n",
9+
"%%writefile fuzzylogic/rules.py\n",
1010
"\"\"\"Functions to evaluate, infer and defuzzify.\"\"\"\n",
1111
"\n",
1212
"from math import isinf\n",
@@ -94,7 +94,7 @@
9494
"metadata": {},
9595
"outputs": [],
9696
"source": [
97-
"%%writefile fuzzy/hedges.py\n",
97+
"%%writefile fuzzylogic/hedges.py\n",
9898
"\n",
9999
"\"\"\"\n",
100100
"Lingual hedges modify curves of membership values.\n",
@@ -134,19 +134,19 @@
134134
},
135135
{
136136
"cell_type": "code",
137-
"execution_count": 13,
137+
"execution_count": 11,
138138
"metadata": {},
139139
"outputs": [
140140
{
141141
"name": "stdout",
142142
"output_type": "stream",
143143
"text": [
144-
"Overwriting fuzzy/combinators.py\n"
144+
"Overwriting fuzzylogic/combinators.py\n"
145145
]
146146
}
147147
],
148148
"source": [
149-
"%%writefile fuzzy/combinators.py\n",
149+
"%%writefile fuzzylogic/combinators.py\n",
150150
"\n",
151151
"\"\"\"\n",
152152
"Combine two linguistic terms.\n",
@@ -165,7 +165,7 @@
165165
"from functools import reduce\n",
166166
"from numpy import multiply\n",
167167
"\n",
168-
"from fuzzy.functions import noop\n",
168+
"from .functions import noop\n",
169169
"\n",
170170
"\n",
171171
"\n",
@@ -351,7 +351,7 @@
351351
"metadata": {},
352352
"outputs": [],
353353
"source": [
354-
"%%writefile fuzzy/classes.py\n",
354+
"%%writefile fuzzylogic/classes.py\n",
355355
"\n",
356356
"\"\"\"\n",
357357
"Domain and Set classes for fuzzy logic.\n",
@@ -730,17 +730,28 @@
730730
},
731731
{
732732
"cell_type": "code",
733-
"execution_count": null,
733+
"execution_count": 6,
734734
"metadata": {
735735
"scrolled": true
736736
},
737-
"outputs": [],
737+
"outputs": [
738+
{
739+
"data": {
740+
"text/plain": [
741+
"6.9"
742+
]
743+
},
744+
"execution_count": 6,
745+
"metadata": {},
746+
"output_type": "execute_result"
747+
}
748+
],
738749
"source": [
739750
"%matplotlib inline\n",
740751
"\n",
741-
"from fuzzy.classes import Domain, Set\n",
742-
"from fuzzy.functions import bounded_linear\n",
743-
"from fuzzy.rules import rescale, round_partial\n",
752+
"from fuzzylogic.classes import Domain, Set\n",
753+
"from fuzzylogic.functions import bounded_linear\n",
754+
"from fuzzylogic.rules import rescale, round_partial\n",
744755
"\n",
745756
"rating = Domain(\"ratings\", 1, 10, res=0.1)\n",
746757
"rating.norm = Set(bounded_linear(1,10))\n",
@@ -774,7 +785,7 @@
774785
"metadata": {},
775786
"outputs": [],
776787
"source": [
777-
"%%writefile fuzzy/truth.py\n",
788+
"%%writefile fuzzylogic/truth.py\n",
778789
"\n",
779790
"\"\"\"\n",
780791
"Functions that transform a given membership value to a truth value.\n",
@@ -812,14 +823,27 @@
812823
},
813824
{
814825
"cell_type": "code",
815-
"execution_count": null,
826+
"execution_count": 7,
816827
"metadata": {},
817-
"outputs": [],
828+
"outputs": [
829+
{
830+
"data": {
831+
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAEzBJREFUeJzt3X2MXFd5x/HvM7N+gYS8kQWC7WCjGoqFoIlWIRSk0iZQJ2rtP0qrWK1I2wgLlRRaUKtEVKFN/wqtCkVKo7hAaVGbNKQIrMjFrUIQUkXSOIKGvLlZzEuWBLIhIUkDfln76R9z1x7P3Ls7tseePZPvR1rt3DvHM8/da/327Lln7onMRJI0XlqjLkCSNHyGuySNIcNdksaQ4S5JY8hwl6QxZLhL0hgy3CVpDBnukjSGDHdJGkMTo3rjc889N9euXTuqt5ekIt13331PZebkYu1GFu5r165l165do3p7SSpSRHxvkHYOy0jSGFo03CPiMxHxZEQ80PB8RMQnI2I6Iu6PiAuHX6Yk6VgM0nP/LLBxgecvA9ZXX1uBm068LEnSiVg03DPza8D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9f0XVbFx+Dp8A/hQ4VG2/HPhJZs5V293HddQi7MD8IuwleS0wC/xDNRT1qYg4jTE+z5n5A+Cvge8DT9A5b/cx3ud53rGe16Ge79LCfaCFuEsVEacD/wb8UWY+t1DTmn1F/Rwi4teAJzPzvu7dNU1zgOdKMQFcCNyUmRcAL3DkT/U6xR9zNaywGVgHvBo4jc6wRK9xOs+LaTrGoR57aeE+yGLdRYqIZXSC/Z8z8wvV7h9FxHnV8+cBT1b7x+Hn8DZgU0R8F7iVztDMJ4CzqkXW4ejjOnzMCy3CvsTNADOZeU+1fTudsB/n83wp8J3MnM3MA8AXgF9kvM/zvGM9r0M936WF+yCLdRcnIoLOOrQPZ+bfdD3VvfD4lXTG4uf3v6e66n4x8Oz8n3+lyMxrM3N1Zq6lcx6/kpm/DdxFZ5F16D/mohdhz8wfAo9FxOurXZcADzHG55nOcMzFEfHS6v/5/DGP7XnucqzndSfwrog4u/qL513VvuMz6osQx3HR4nLgf4FvAx8ZdT1DOqa30/nz637gm9XX5XTGGu8EHq2+n1O1Dzqzhr4NfIvOTISRH8cJHP87gDuqx68F/huYBj4PrKj2r6y2p6vnXzvquo/zWH8B2FWd6y8CZ4/7eQb+AngEeAD4HLBi3M4zcAudawoH6PTArzqe8wr8fnXs08DvnUhNfkJVksZQacMykqQBGO6SNIYMd0kaQ4a7JI0hw12SxpDhLkljyHCXpDFkuEvSGPp/MUxCdespPgAAAAAASUVORK5CYII=\n",
832+
"text/plain": [
833+
"<Figure size 432x288 with 1 Axes>"
834+
]
835+
},
836+
"metadata": {
837+
"needs_background": "light"
838+
},
839+
"output_type": "display_data"
840+
}
841+
],
818842
"source": [
819843
"%matplotlib inline\n",
820844
"\n",
821-
"from fuzzy.classes import Domain, Set\n",
822-
"from fuzzy.functions import R, S, bounded_sigmoid\n",
845+
"from fuzzylogic.classes import Domain, Set\n",
846+
"from fuzzylogic.functions import R, S, bounded_sigmoid\n",
823847
"\n",
824848
"dist = Domain(\"distance\", 0, 1000, res=0.1)\n",
825849
"dist.close = Set(bounded_sigmoid(3, 10, inverse=True))\n",
@@ -829,19 +853,19 @@
829853
},
830854
{
831855
"cell_type": "code",
832-
"execution_count": 2,
856+
"execution_count": 8,
833857
"metadata": {},
834858
"outputs": [
835859
{
836860
"name": "stdout",
837861
"output_type": "stream",
838862
"text": [
839-
"Overwriting fuzzy/functions.py\n"
863+
"Overwriting fuzzylogic/functions.py\n"
840864
]
841865
}
842866
],
843867
"source": [
844-
"%%writefile fuzzy/functions.py\n",
868+
"%%writefile fuzzylogic/functions.py\n",
845869
"\n",
846870
"\"\"\"\n",
847871
"General-purpose functions that map R -> [0,1].\n",
@@ -1271,6 +1295,20 @@
12711295
" return 1 / (1 + 9 * r)\n",
12721296
" return f\n",
12731297
"\n",
1298+
"def bounded_exponential(k=0.1, limit=1):\n",
1299+
" \"\"\"Function that goes through the origin and approaches a limit.\n",
1300+
" k determines the steepness. The function defined for [0, +inf).\n",
1301+
" Useful for things that can't be below 0 but may not have a limit like temperature\n",
1302+
" or time, so values are always defined.\n",
1303+
" f(x)=limit-limit/e^(k*x)\n",
1304+
"\n",
1305+
" Again: This function assumes x >= 0, there are no checks for this assumption!\n",
1306+
" \"\"\"\n",
1307+
" assert limit > 0\n",
1308+
" assert k > 0\n",
1309+
" def f(x):\n",
1310+
" return limit - limit/exp(k*x)\n",
1311+
" return f\n",
12741312
"\n",
12751313
"def simple_sigmoid(k=0.229756):\n",
12761314
" \"\"\"Sigmoid variant with only one parameter (steepness).\n",
@@ -1377,7 +1415,7 @@
13771415
"name": "python",
13781416
"nbconvert_exporter": "python",
13791417
"pygments_lexer": "ipython3",
1380-
"version": "3.7.0"
1418+
"version": "3.7.3"
13811419
}
13821420
},
13831421
"nbformat": 4,

META.stay

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: fuzzylogic
33
description: Fuzzy Logic for Python 3
44
license: MIT
55
url: https://github.com/amogorkon/fuzzylogic
6-
version: 0.1.1post1
6+
version: 0.1.1post2
77
author: Anselm Kiefner
88
author_email: fuzzylogic-pypi@anselm.kiefner.de
99
python_requires: >3.6
@@ -22,4 +22,4 @@ classifiers:::[
2222
Topic :: Scientific/Engineering :: Artificial Intelligence
2323
Topic :: Scientific/Engineering :: Mathematics
2424
Topic :: Scientific/Engineering :: Information Analysis
25-
]:::
25+
]:::
16.3 KB
Binary file not shown.

dist/fuzzylogic-0.1.1.post1.tar.gz

18.2 KB
Binary file not shown.
3.89 KB
Binary file not shown.

dist/fuzzylogic-0.1.1.post2.tar.gz

6.17 KB
Binary file not shown.

fuzzylogic-0.1.1.post1/setup.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
import os, sys
3+
here = (os.path.abspath(os.path.dirname(__file__)))
4+
src = os.path.join(here, "src")
5+
sys.path.append(src)
6+
7+
from stay import load
8+
from setuptools import setup, find_packages
9+
10+
with open("META.stay") as f:
11+
for meta in load(f):
12+
pass
13+
14+
with open("README.md") as f:
15+
LONG_DESCRIPTION = f.read()
16+
17+
setup(
18+
packages=find_packages(where="src"),
19+
package_dir={"": "src"},
20+
long_description=LONG_DESCRIPTION,
21+
long_description_content_type="text/markdown",
22+
zip_safe=False,
23+
**meta
24+
)

0 commit comments

Comments
 (0)