|
17 | 17 | "metadata": {}, |
18 | 18 | "outputs": [], |
19 | 19 | "source": [ |
20 | | - "!pip install --quiet ipywidgets" |
| 20 | + "import subprocess\n", |
| 21 | + "for package in ('ipywidgets', 'matplotlib'):\n", |
| 22 | + " subprocess.check_call([sys.executable, \"-m\", \"pip\", \"install\", \"--quiet\", package])" |
21 | 23 | ] |
22 | 24 | }, |
23 | 25 | { |
|
26 | 28 | "metadata": {}, |
27 | 29 | "outputs": [], |
28 | 30 | "source": [ |
29 | | - "import PyPartMC as ppmc\n", |
30 | 31 | "from ipywidgets import Tab, SelectMultiple, IntSlider, FloatSlider, HTML, HBox, VBox, Output\n", |
31 | 32 | "from matplotlib import pyplot\n", |
32 | | - "from IPython.display import display, clear_output\n", |
33 | | - "\n", |
34 | | - "%matplotlib widget" |
| 33 | + "from IPython.display import display\n", |
| 34 | + "import PyPartMC as ppmc" |
35 | 35 | ] |
36 | 36 | }, |
37 | 37 | { |
|
40 | 40 | "metadata": {}, |
41 | 41 | "outputs": [], |
42 | 42 | "source": [ |
| 43 | + "%matplotlib widget\n", |
| 44 | + "\n", |
43 | 45 | "if \"google.colab\" in sys.modules:\n", |
44 | | - " hack = (\n", |
| 46 | + " HACK = (\n", |
45 | 47 | " \"<link\"\n", |
46 | 48 | " ' rel=\"stylesheet\"'\n", |
47 | 49 | " ' href=\"https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css\"'\n", |
48 | 50 | " \"> \"\n", |
49 | 51 | " )\n", |
50 | | - " display(HTML(hack))" |
| 52 | + " display(HTML(HACK))" |
51 | 53 | ] |
52 | 54 | }, |
53 | 55 | { |
|
126 | 128 | { |
127 | 129 | "data": { |
128 | 130 | "application/vnd.jupyter.widget-view+json": { |
129 | | - "model_id": "1eeaf25a187441b0a2d4ff0e16158319", |
| 131 | + "model_id": "c9630f899d514ecb9c13641d56706dde", |
130 | 132 | "version_major": 2, |
131 | 133 | "version_minor": 0 |
132 | 134 | }, |
|
161 | 163 | }, |
162 | 164 | { |
163 | 165 | "cell_type": "code", |
164 | | - "execution_count": 13, |
| 166 | + "execution_count": 12, |
165 | 167 | "metadata": {}, |
166 | 168 | "outputs": [ |
167 | 169 | { |
168 | 170 | "name": "stdout", |
169 | 171 | "output_type": "stream", |
170 | 172 | "text": [ |
171 | | - "[\"H2SO4\",\"HNO3\",\"HCl\",\"NO\",\"NO2\"]\n" |
| 173 | + "[\"H2SO4\",\"HNO3\",\"HCl\",\"NH3\",\"NO\",\"NO2\"]\n" |
172 | 174 | ] |
173 | 175 | } |
174 | 176 | ], |
|
0 commit comments