|
3 | 3 | {
|
4 | 4 | "cell_type": "code",
|
5 | 5 | "execution_count": null,
|
| 6 | + "id": "ee3f55c6-5f98-4572-aea1-a66776dc7d7b", |
| 7 | + "metadata": {}, |
| 8 | + "outputs": [], |
| 9 | + "source": [] |
| 10 | + }, |
| 11 | + { |
| 12 | + "cell_type": "code", |
| 13 | + "execution_count": 1, |
6 | 14 | "id": "5df2c405",
|
7 | 15 | "metadata": {},
|
8 | 16 | "outputs": [],
|
9 | 17 | "source": [
|
10 | 18 | "from widget_code_input import WidgetCodeInput\n",
|
11 |
| - "# import importlib\n", |
12 |
| - "# importlib.reload(code_input_widget)\n", |
| 19 | + "import importlib\n", |
| 20 | + "\n", |
| 21 | + "\n", |
13 | 22 | "\n",
|
14 | 23 | "w = WidgetCodeInput(\n",
|
15 | 24 | " function_name = \"my_function\",\n",
|
16 | 25 | " function_parameters = \"a, b\",\n",
|
17 |
| - " docstring=\"\"\"\n", |
18 |
| - " Input docstring here.\n", |
19 |
| - "\"\"\",\n", |
20 |
| - " function_body=\"# Give information for the function\\nreturn a+b\",\n", |
21 |
| - " code_theme=\"basicLight\"\n", |
| 26 | + "# docstring='abc',\n", |
| 27 | + " docstring=\"abc\",\n", |
| 28 | + " code_theme=\"basicLight\",\n", |
| 29 | + " function_body=\"return a+b\"\n", |
22 | 30 | ")\n",
|
23 | 31 | "\n"
|
24 | 32 | ]
|
25 | 33 | },
|
26 | 34 | {
|
27 | 35 | "cell_type": "code",
|
28 |
| - "execution_count": null, |
| 36 | + "execution_count": 2, |
29 | 37 | "id": "e74c9c9e",
|
30 | 38 | "metadata": {
|
31 | 39 | "scrolled": true
|
32 | 40 | },
|
33 |
| - "outputs": [], |
| 41 | + "outputs": [ |
| 42 | + { |
| 43 | + "data": { |
| 44 | + "application/vnd.jupyter.widget-view+json": { |
| 45 | + "model_id": "d1679bd64f174ba6a3c248a14e9f87f5", |
| 46 | + "version_major": 2, |
| 47 | + "version_minor": 0 |
| 48 | + }, |
| 49 | + "text/plain": [ |
| 50 | + "WidgetCodeInput(code_theme='basicLight', docstring='\"\"\"abc\"\"\"', function_body='return a+b', function_name='my_…" |
| 51 | + ] |
| 52 | + }, |
| 53 | + "metadata": {}, |
| 54 | + "output_type": "display_data" |
| 55 | + } |
| 56 | + ], |
34 | 57 | "source": [
|
35 | 58 | "w"
|
36 | 59 | ]
|
37 | 60 | },
|
38 | 61 | {
|
39 | 62 | "cell_type": "code",
|
40 |
| - "execution_count": null, |
41 |
| - "id": "4d389a14", |
| 63 | + "execution_count": 3, |
| 64 | + "id": "e90010bd", |
42 | 65 | "metadata": {},
|
43 | 66 | "outputs": [],
|
44 | 67 | "source": [
|
45 |
| - "my_function = w.get_function_object()" |
| 68 | + "w.code_theme=\"solarizedLight\"" |
46 | 69 | ]
|
47 | 70 | },
|
48 | 71 | {
|
49 | 72 | "cell_type": "code",
|
50 |
| - "execution_count": null, |
51 |
| - "id": "2fc2b3ed", |
| 73 | + "execution_count": 6, |
| 74 | + "id": "22853da3-2882-4b4a-b777-bf76bf301de9", |
52 | 75 | "metadata": {},
|
53 | 76 | "outputs": [],
|
54 | 77 | "source": [
|
55 |
| - "my_function(1, 2)" |
| 78 | + "w.docstring=None" |
56 | 79 | ]
|
57 | 80 | },
|
58 | 81 | {
|
59 | 82 | "cell_type": "code",
|
60 |
| - "execution_count": null, |
61 |
| - "id": "e90010bd", |
| 83 | + "execution_count": 7, |
| 84 | + "id": "3d023823", |
62 | 85 | "metadata": {},
|
63 | 86 | "outputs": [],
|
64 | 87 | "source": [
|
65 |
| - "w.code_theme=\"solarizedLight\"" |
| 88 | + "w.docstring=\"334\"" |
66 | 89 | ]
|
67 | 90 | },
|
68 | 91 | {
|
69 | 92 | "cell_type": "code",
|
70 |
| - "execution_count": null, |
| 93 | + "execution_count": 6, |
| 94 | + "id": "5ea3d39d", |
| 95 | + "metadata": {}, |
| 96 | + "outputs": [ |
| 97 | + { |
| 98 | + "data": { |
| 99 | + "application/vnd.jupyter.widget-view+json": { |
| 100 | + "model_id": "eec6fdedac434c68ae22c7ad56283ef2", |
| 101 | + "version_major": 2, |
| 102 | + "version_minor": 0 |
| 103 | + }, |
| 104 | + "text/plain": [ |
| 105 | + "WidgetCodeInput(code_theme='basicLight', docstring='334', function_body='return a+b', function_name='my_functi…" |
| 106 | + ] |
| 107 | + }, |
| 108 | + "metadata": {}, |
| 109 | + "output_type": "display_data" |
| 110 | + } |
| 111 | + ], |
| 112 | + "source": [ |
| 113 | + "w" |
| 114 | + ] |
| 115 | + }, |
| 116 | + { |
| 117 | + "cell_type": "code", |
| 118 | + "execution_count": 7, |
| 119 | + "id": "e8e56926", |
| 120 | + "metadata": {}, |
| 121 | + "outputs": [ |
| 122 | + { |
| 123 | + "data": { |
| 124 | + "application/vnd.jupyter.widget-view+json": { |
| 125 | + "model_id": "0bc406910d7f433b975a37e36cd7f248", |
| 126 | + "version_major": 2, |
| 127 | + "version_minor": 0 |
| 128 | + }, |
| 129 | + "text/plain": [ |
| 130 | + "WidgetCodeInput(code_theme='solarizedLight', docstring='123', function_body='return a+b', function_name='my_fu…" |
| 131 | + ] |
| 132 | + }, |
| 133 | + "metadata": {}, |
| 134 | + "output_type": "display_data" |
| 135 | + } |
| 136 | + ], |
| 137 | + "source": [ |
| 138 | + "w" |
| 139 | + ] |
| 140 | + }, |
| 141 | + { |
| 142 | + "cell_type": "code", |
| 143 | + "execution_count": 8, |
71 | 144 | "id": "75900629",
|
72 | 145 | "metadata": {},
|
73 | 146 | "outputs": [],
|
74 | 147 | "source": [
|
75 |
| - "w2 = WidgetCodeInput(\n", |
76 |
| - " function_name = \"my_function\",\n", |
77 |
| - " function_parameters = \"a, b, c\",\n", |
78 |
| - " docstring=\"\"\"\n", |
79 |
| - " Input docstring here.\n", |
80 |
| - "\"\"\",\n", |
81 |
| - " function_body=\"# Give information for the function\\nreturn a+b+c\",\n", |
82 |
| - " code_theme=\"basicLight\"\n", |
83 |
| - ")\n", |
84 |
| - "w2" |
| 148 | + "# w2 = WidgetCodeInput(\n", |
| 149 | + "# function_name = \"my_function\",\n", |
| 150 | + "# function_parameters = \"a, b, c\",\n", |
| 151 | + "# docstring=\"\"\"\n", |
| 152 | + "# Input docstring here.\n", |
| 153 | + "# \"\"\",\n", |
| 154 | + "# function_body=\"# Give information for the function\\nreturn a+b+c\",\n", |
| 155 | + "# code_theme=\"basicLight\"\n", |
| 156 | + "# )\n", |
| 157 | + "# w2" |
85 | 158 | ]
|
86 | 159 | }
|
87 | 160 | ],
|
|
101 | 174 | "name": "python",
|
102 | 175 | "nbconvert_exporter": "python",
|
103 | 176 | "pygments_lexer": "ipython3",
|
104 |
| - "version": "3.10.15" |
| 177 | + "version": "3.10.12" |
105 | 178 | }
|
106 | 179 | },
|
107 | 180 | "nbformat": 4,
|
|
0 commit comments