Skip to content

Commit fb64f68

Browse files
authored
Update script to strip numpy typing and re-execute notebooks (#408)
1 parent 3287ec3 commit fb64f68

File tree

9 files changed

+467
-196
lines changed

9 files changed

+467
-196
lines changed

doc/source/examples/analysis/alignment_and_rms/aligning_structure_to_another.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
"name": "stdout",
242242
"output_type": "stream",
243243
"text": [
244-
"(21.712154435976014, 6.817293751703919)\n"
244+
"(np.float64(21.712154435976014), 6.817293751703919)\n"
245245
]
246246
}
247247
],
@@ -294,7 +294,7 @@
294294
"name": "stdout",
295295
"output_type": "stream",
296296
"text": [
297-
"(18.991465038265208, 16.603704620787127)\n"
297+
"(np.float64(18.991465038265208), 16.603704620787127)\n"
298298
]
299299
}
300300
],
@@ -488,7 +488,7 @@
488488
"metadata": {
489489
"celltoolbar": "Raw Cell Format",
490490
"kernelspec": {
491-
"display_name": "Python 3.9.15 ('mda-user-guide')",
491+
"display_name": "Python 3 (ipykernel)",
492492
"language": "python",
493493
"name": "python3"
494494
},
@@ -502,7 +502,7 @@
502502
"name": "python",
503503
"nbconvert_exporter": "python",
504504
"pygments_lexer": "ipython3",
505-
"version": "3.9.15"
505+
"version": "3.10.16"
506506
},
507507
"toc": {
508508
"base_numbering": 1,

doc/source/examples/analysis/polymers_and_membranes/hole2.ipynb

Lines changed: 140 additions & 57 deletions
Large diffs are not rendered by default.

doc/source/examples/analysis/structure/dihedrals.ipynb

Lines changed: 17 additions & 18 deletions
Large diffs are not rendered by default.

doc/source/examples/analysis/structure/site_specific_rdf.ipynb

Lines changed: 10 additions & 12 deletions
Large diffs are not rendered by default.

doc/source/examples/analysis/trajectory_similarity/harmonic_ensemble_similarity.ipynb

Lines changed: 27 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,17 @@
4949
"shell.execute_reply": "2021-05-19T06:01:12.662787Z"
5050
}
5151
},
52-
"outputs": [],
52+
"outputs": [
53+
{
54+
"name": "stderr",
55+
"output_type": "stream",
56+
"text": [
57+
"/Users/lily/micromamba/envs/mda-user-guide-dev/lib/python3.10/site-packages/MDAnalysis/analysis/encore/__init__.py:45: DeprecationWarning: Deprecation in version 2.8.0\n",
58+
"MDAnalysis.analysis.encore is deprecated in favour of the MDAKit mdaencore (https://www.mdanalysis.org/mdaencore/) and will be removed in MDAnalysis version 3.0.0.\n",
59+
" warnings.warn(wmsg, category=DeprecationWarning)\n"
60+
]
61+
}
62+
],
5363
"source": [
5464
"import numpy as np\n",
5565
"import matplotlib.pyplot as plt\n",
@@ -96,7 +106,7 @@
96106
"name": "stderr",
97107
"output_type": "stream",
98108
"text": [
99-
"/home/pbarletta/mambaforge/envs/mda-user-guide/lib/python3.9/site-packages/MDAnalysis/coordinates/DCD.py:165: DeprecationWarning: DCDReader currently makes independent timesteps by copying self.ts while other readers update self.ts inplace. This behaviour will be changed in 3.0 to be the same as other readers\n",
109+
"/Users/lily/micromamba/envs/mda-user-guide-dev/lib/python3.10/site-packages/MDAnalysis/coordinates/DCD.py:165: DeprecationWarning: DCDReader currently makes independent timesteps by copying self.ts while other readers update self.ts inplace. This behavior will be changed in 3.0 to be the same as other readers. Read more at https://github.com/MDAnalysis/mdanalysis/issues/3889 to learn if this change in behavior might affect you.\n",
100110
" warnings.warn(\"DCDReader currently makes independent timesteps\"\n"
101111
]
102112
}
@@ -178,7 +188,16 @@
178188
"shell.execute_reply": "2021-05-19T06:03:04.424122Z"
179189
}
180190
},
181-
"outputs": [],
191+
"outputs": [
192+
{
193+
"name": "stderr",
194+
"output_type": "stream",
195+
"text": [
196+
"/Users/lily/micromamba/envs/mda-user-guide-dev/lib/python3.10/site-packages/MDAnalysis/coordinates/memory.py:535: DeprecationWarning: asel argument to timeseries will be renamed to'atomgroup' in 3.0, see #3911\n",
197+
" warnings.warn(\n"
198+
]
199+
}
200+
],
182201
"source": [
183202
"hes, details = encore.hes([u1, u2, u3, u4],\n",
184203
" select='backbone',\n",
@@ -208,10 +227,10 @@
208227
"name": "stdout",
209228
"output_type": "stream",
210229
"text": [
211-
" 0.0 24955.7 1879874.5 145622.3 \n",
230+
" 0.0 24955.7 1879874.9 145622.3 \n",
212231
" 24955.7 0.0 1659867.5 161102.3 \n",
213-
" 1879874.5 1659867.5 0.0 9900092.7 \n",
214-
" 145622.3 161102.3 9900092.7 0.0 \n"
232+
" 1879874.9 1659867.5 0.0 9900093.4 \n",
233+
" 145622.3 161102.3 9900093.4 0.0 \n"
215234
]
216235
}
217236
],
@@ -322,42 +341,11 @@
322341
"\n",
323342
"[4] Beckstein O, Denning EJ, Perilla JR, Woolf TB. Zipping and unzipping of adenylate kinase: atomistic insights into the ensemble of open<-->closed transitions. *J Mol Biol*. 2009;394(1):160–176. [doi:10.1016/j.jmb.2009.09.009](https://dx.doi.org/10.1016%2Fj.jmb.2009.09.009)\n"
324343
]
325-
},
326-
{
327-
"cell_type": "markdown",
328-
"metadata": {},
329-
"source": [
330-
"## References\n",
331-
"\n",
332-
"[1] Oliver Beckstein, Elizabeth&nbsp;J. Denning, Juan&nbsp;R. Perilla, and Thomas&nbsp;B. Woolf.\n",
333-
"Zipping and <span class=\"bibtex-protected\">Unzipping</span> of <span class=\"bibtex-protected\">Adenylate</span> <span class=\"bibtex-protected\">Kinase</span>: <span class=\"bibtex-protected\">Atomistic</span> <span class=\"bibtex-protected\">Insights</span> into the <span class=\"bibtex-protected\">Ensemble</span> of <span class=\"bibtex-protected\">Open</span>↔<span class=\"bibtex-protected\">Closed</span> <span class=\"bibtex-protected\">Transitions</span>.\n",
334-
"<em>Journal of Molecular Biology</em>, 394(1):160–176, November 2009.\n",
335-
"00107.\n",
336-
"URL: <a href=\"https://linkinghub.elsevier.com/retrieve/pii/S0022283609011164\">https://linkinghub.elsevier.com/retrieve/pii/S0022283609011164</a>, <a href=\"https://doi.org/10.1016/j.jmb.2009.09.009\">doi:10.1016/j.jmb.2009.09.009</a>.\n",
337-
"\n",
338-
"[2] Richard&nbsp;J. Gowers, Max Linke, Jonathan Barnoud, Tyler J.&nbsp;E. Reddy, Manuel&nbsp;N. Melo, Sean&nbsp;L. Seyler, Jan Domański, David&nbsp;L. Dotson, Sébastien Buchoux, Ian&nbsp;M. Kenney, and Oliver Beckstein.\n",
339-
"<span class=\"bibtex-protected\">MDAnalysis</span>: <span class=\"bibtex-protected\">A</span> <span class=\"bibtex-protected\">Python</span> <span class=\"bibtex-protected\">Package</span> for the <span class=\"bibtex-protected\">Rapid</span> <span class=\"bibtex-protected\">Analysis</span> of <span class=\"bibtex-protected\">Molecular</span> <span class=\"bibtex-protected\">Dynamics</span> <span class=\"bibtex-protected\">Simulations</span>.\n",
340-
"<em>Proceedings of the 15th Python in Science Conference</em>, pages 98–105, 2016.\n",
341-
"00152.\n",
342-
"URL: <a href=\"https://conference.scipy.org/proceedings/scipy2016/oliver_beckstein.html\">https://conference.scipy.org/proceedings/scipy2016/oliver_beckstein.html</a>, <a href=\"https://doi.org/10.25080/Majora-629e541a-00e\">doi:10.25080/Majora-629e541a-00e</a>.\n",
343-
"\n",
344-
"[3] Naveen Michaud-Agrawal, Elizabeth&nbsp;J. Denning, Thomas&nbsp;B. Woolf, and Oliver Beckstein.\n",
345-
"<span class=\"bibtex-protected\">MDAnalysis</span>: <span class=\"bibtex-protected\">A</span> toolkit for the analysis of molecular dynamics simulations.\n",
346-
"<em>Journal of Computational Chemistry</em>, 32(10):2319–2327, July 2011.\n",
347-
"00778.\n",
348-
"URL: <a href=\"http://doi.wiley.com/10.1002/jcc.21787\">http://doi.wiley.com/10.1002/jcc.21787</a>, <a href=\"https://doi.org/10.1002/jcc.21787\">doi:10.1002/jcc.21787</a>.\n",
349-
"\n",
350-
"[4] Matteo Tiberti, Elena Papaleo, Tone Bengtsen, Wouter Boomsma, and Kresten Lindorff-Larsen.\n",
351-
"<span class=\"bibtex-protected\">ENCORE</span>: <span class=\"bibtex-protected\">Software</span> for <span class=\"bibtex-protected\">Quantitative</span> <span class=\"bibtex-protected\">Ensemble</span> <span class=\"bibtex-protected\">Comparison</span>.\n",
352-
"<em>PLOS Computational Biology</em>, 11(10):e1004415, October 2015.\n",
353-
"00031.\n",
354-
"URL: <a href=\"https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1004415\">https://journals.plos.org/ploscompbiol/article?id=10.1371/journal.pcbi.1004415</a>, <a href=\"https://doi.org/10.1371/journal.pcbi.1004415\">doi:10.1371/journal.pcbi.1004415</a>."
355-
]
356344
}
357345
],
358346
"metadata": {
359347
"kernelspec": {
360-
"display_name": "Python 3.9.15 ('mda-user-guide')",
348+
"display_name": "Python 3 (ipykernel)",
361349
"language": "python",
362350
"name": "python3"
363351
},
@@ -371,7 +359,7 @@
371359
"name": "python",
372360
"nbconvert_exporter": "python",
373361
"pygments_lexer": "ipython3",
374-
"version": "3.9.15"
362+
"version": "3.10.16"
375363
},
376364
"toc": {
377365
"base_numbering": 1,

doc/source/examples/analysis/volumetric/linear_density.ipynb

Lines changed: 250 additions & 49 deletions
Large diffs are not rendered by default.

doc/source/examples/constructing_universe.ipynb

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
"name": "stdout",
3939
"output_type": "stream",
4040
"text": [
41-
"Using MDAnalysis version 2.6.0-dev0\n"
41+
"Using MDAnalysis version 2.9.0-dev0\n"
4242
]
4343
},
4444
{
4545
"data": {
4646
"application/vnd.jupyter.widget-view+json": {
47-
"model_id": "1177615fa88e496c827928276bc1fc63",
47+
"model_id": "a7825c7b10e04802b0859664fd854a83",
4848
"version_major": 2,
4949
"version_minor": 0
5050
},
@@ -57,7 +57,7 @@
5757
"name": "stdout",
5858
"output_type": "stream",
5959
"text": [
60-
"Using NGLView version 3.0.3\n"
60+
"Using NGLView version 3.0.8\n"
6161
]
6262
}
6363
],
@@ -198,7 +198,7 @@
198198
{
199199
"data": {
200200
"text/plain": [
201-
"array(['O', 'H1', 'H2', ..., 'O', 'H1', 'H2'], dtype=object)"
201+
"array(['O', 'H1', 'H2', ..., 'O', 'H1', 'H2'], shape=(3000,), dtype=object)"
202202
]
203203
},
204204
"execution_count": 4,
@@ -235,7 +235,7 @@
235235
{
236236
"data": {
237237
"text/plain": [
238-
"array(['O', 'H', 'H', ..., 'O', 'H', 'H'], dtype=object)"
238+
"array(['O', 'H', 'H', ..., 'O', 'H', 'H'], shape=(3000,), dtype=object)"
239239
]
240240
},
241241
"execution_count": 5,
@@ -270,7 +270,8 @@
270270
{
271271
"data": {
272272
"text/plain": [
273-
"array(['SOL', 'SOL', 'SOL', ..., 'SOL', 'SOL', 'SOL'], dtype=object)"
273+
"array(['SOL', 'SOL', 'SOL', ..., 'SOL', 'SOL', 'SOL'],\n",
274+
" shape=(3000,), dtype=object)"
274275
]
275276
},
276277
"execution_count": 6,
@@ -305,7 +306,7 @@
305306
{
306307
"data": {
307308
"text/plain": [
308-
"array([ 1, 1, 1, ..., 1000, 1000, 1000])"
309+
"array([ 1, 1, 1, ..., 1000, 1000, 1000], shape=(3000,))"
309310
]
310311
},
311312
"execution_count": 7,
@@ -340,7 +341,8 @@
340341
{
341342
"data": {
342343
"text/plain": [
343-
"array(['SOL', 'SOL', 'SOL', ..., 'SOL', 'SOL', 'SOL'], dtype=object)"
344+
"array(['SOL', 'SOL', 'SOL', ..., 'SOL', 'SOL', 'SOL'],\n",
345+
" shape=(3000,), dtype=object)"
344346
]
345347
},
346348
"execution_count": 8,
@@ -1092,7 +1094,7 @@
10921094
{
10931095
"data": {
10941096
"text/plain": [
1095-
"73.23912"
1097+
"np.float32(73.23912)"
10961098
]
10971099
},
10981100
"execution_count": 33,
@@ -1245,7 +1247,7 @@
12451247
"name": "python",
12461248
"nbconvert_exporter": "python",
12471249
"pygments_lexer": "ipython3",
1248-
"version": "3.9.2"
1250+
"version": "3.10.16"
12491251
},
12501252
"toc": {
12511253
"base_numbering": 1,

doc/source/examples/quickstart.ipynb

Lines changed: 6 additions & 6 deletions
Large diffs are not rendered by default.

doc/source/scripts/gen_topologyattr_defaults.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def _default(klass: TopologyAttr) -> str:
3333
return DEFAULTS[klass.attrname]
3434
except KeyError:
3535
try:
36-
return repr(klass._gen_initial_values(1, 1, 1)[0])
36+
return repr(klass._gen_initial_values(1, 1, 1).tolist()[0])
3737
except NotImplementedError:
3838
return "No default values"
3939

0 commit comments

Comments
 (0)