master > master: notebook - widgets

This commit is contained in:
RD 2022-10-21 22:10:11 +02:00
parent 6f24f4f635
commit 56744bd389
1 changed files with 15 additions and 18 deletions

View File

@ -38,6 +38,7 @@
"\n",
"from src.maths.diagrams import *;\n",
"from src.maths.sets import *;\n",
"from src.widgets import *;\n",
"\n",
"np.random.seed(8007253); # zur Wiederholbarkeit"
]
@ -48,6 +49,20 @@
"metadata": {},
"outputs": [],
"source": [
"FunctionDiagramWidget(\n",
" N = 2,\n",
" fnames = ['f', 'g', 'h'],\n",
" setnames = ['X', 'Y', 'Z', 'W'],\n",
").run();"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# ohne Zufallserzeugung:\n",
"X = ['a', 'b', 'c', 'd', 'e'];\n",
"Y = [2, 3, 5, 7, 11, 13, 17];\n",
"Z = ['α', 'β', 'γ', 'δ'];\n",
@ -59,24 +74,6 @@
");\n",
"comp.draw(show_labels=True);"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"X = randomset_alphabet(N=3);\n",
"Y = randomset_integers(N=5);\n",
"Z = randomset_greek(N=7);\n",
"f = random_function(X, Y, injective=True);\n",
"g = random_function(Y, Z, injective=True);\n",
"comp = Functions(\n",
" Function(name=('f', 'X', 'Y'), domain=X, codomain=Y, fct=f),\n",
" Function(name=('g', 'Y', 'Z'), domain=Y, codomain=Z, fct=g),\n",
");\n",
"comp.draw(show_labels=False);"
]
}
],
"metadata": {