Skip to content

Commit 227647c

Browse files
🎉 Finish residual replacement for Pymc3 plots to arviz & sigma param change
1 parent 7d3f17e commit 227647c

22 files changed

+44
-56
lines changed

examples/case_studies/BEST.ipynb

+3-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
}
2222
],
2323
"source": [
24+
"import warnings\n",
25+
"\n",
2426
"import arviz as az\n",
2527
"import matplotlib.pyplot as plt\n",
2628
"import numpy as np\n",
@@ -36,8 +38,7 @@
3638
"metadata": {},
3739
"outputs": [],
3840
"source": [
39-
"import warnings\n",
40-
"warnings.filterwarnings('ignore')"
41+
"warnings.filterwarnings(\"ignore\")"
4142
]
4243
},
4344
{

examples/case_studies/LKJ.ipynb

+2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
"outputs": [],
4141
"source": [
4242
"az.style.use(\"arviz-darkgrid\")\n",
43+
"\n",
4344
"warnings.simplefilter(action=\"ignore\", category=FutureWarning)\n",
45+
"\n",
4446
"RANDOM_SEED = 8924\n",
4547
"np.random.seed(3264602) # from random.org"
4648
]

examples/case_studies/factor_analysis.ipynb

+2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@
4040
"source": [
4141
"%config InlineBackend.figure_format = 'retina'\n",
4242
"az.style.use(\"arviz-darkgrid\")\n",
43+
"\n",
4344
"warnings.filterwarnings(\"ignore\")\n",
45+
"\n",
4446
"np.set_printoptions(precision=3, suppress=True)\n",
4547
"np.random.seed(314159)"
4648
]

examples/case_studies/multilevel_modeling.ipynb

+2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@
7676
"from theano import tensor as tt\n",
7777
"\n",
7878
"print(f\"Running on PyMC3 v{pm.__version__}\")\n",
79+
"\n",
7980
"warnings.simplefilter(action=\"ignore\", category=FutureWarning)\n",
81+
"\n",
8082
"RANDOM_SEED = 8924\n",
8183
"np.random.seed(286)"
8284
]

examples/case_studies/putting_workflow.ipynb

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
],
1616
"source": [
1717
"import io\n",
18+
"import warnings\n",
1819
"\n",
1920
"import arviz as az\n",
2021
"import matplotlib.pyplot as plt\n",
@@ -33,8 +34,6 @@
3334
"metadata": {},
3435
"outputs": [],
3536
"source": [
36-
"import warnings\n",
37-
"\n",
3837
"warnings.filterwarnings(\"ignore\")"
3938
]
4039
},

examples/diagnostics_and_criticism/Bayes_factor.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@
694694
"name": "python",
695695
"nbconvert_exporter": "python",
696696
"pygments_lexer": "ipython3",
697-
"version": "3.7.6"
697+
"version": "3.8.5"
698698
}
699699
},
700700
"nbformat": 4,

examples/gaussian_processes/GP-Latent.ipynb

+5-5
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@
104104
},
105105
"outputs": [],
106106
"source": [
107+
"import warnings\n",
108+
"\n",
107109
"import arviz as az\n",
108110
"import matplotlib.pyplot as plt\n",
109111
"import numpy as np\n",
@@ -129,8 +131,6 @@
129131
"metadata": {},
130132
"outputs": [],
131133
"source": [
132-
"import warnings\n",
133-
"\n",
134134
"# mute future warnings from theano\n",
135135
"warnings.simplefilter(action=\"ignore\", category=FutureWarning)"
136136
]
@@ -996,9 +996,9 @@
996996
"metadata": {
997997
"anaconda-cloud": {},
998998
"kernelspec": {
999-
"display_name": "Python 3",
999+
"display_name": "Python (PyMC3 Dev)",
10001000
"language": "python",
1001-
"name": "python3"
1001+
"name": "pymc3-dev"
10021002
},
10031003
"language_info": {
10041004
"codemirror_mode": {
@@ -1010,7 +1010,7 @@
10101010
"name": "python",
10111011
"nbconvert_exporter": "python",
10121012
"pygments_lexer": "ipython3",
1013-
"version": "3.8.3"
1013+
"version": "3.8.5"
10141014
}
10151015
},
10161016
"nbformat": 4,

examples/gaussian_processes/GP-MaunaLoa2.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -2500,9 +2500,9 @@
25002500
"metadata": {
25012501
"anaconda-cloud": {},
25022502
"kernelspec": {
2503-
"display_name": "dev-pymc",
2503+
"display_name": "Python (PyMC3 Dev)",
25042504
"language": "python",
2505-
"name": "dev-pymc"
2505+
"name": "pymc3-dev"
25062506
},
25072507
"language_info": {
25082508
"codemirror_mode": {
@@ -2514,7 +2514,7 @@
25142514
"name": "python",
25152515
"nbconvert_exporter": "python",
25162516
"pygments_lexer": "ipython3",
2517-
"version": "3.6.11"
2517+
"version": "3.8.5"
25182518
}
25192519
},
25202520
"nbformat": 4,

examples/gaussian_processes/GP-MeansAndCovs.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -1702,9 +1702,9 @@
17021702
"metadata": {
17031703
"anaconda-cloud": {},
17041704
"kernelspec": {
1705-
"display_name": "pymc3",
1705+
"display_name": "Python (PyMC3 Dev)",
17061706
"language": "python",
1707-
"name": "pymc3"
1707+
"name": "pymc3-dev"
17081708
},
17091709
"language_info": {
17101710
"codemirror_mode": {
@@ -1716,7 +1716,7 @@
17161716
"name": "python",
17171717
"nbconvert_exporter": "python",
17181718
"pygments_lexer": "ipython3",
1719-
"version": "3.8.6"
1719+
"version": "3.8.5"
17201720
}
17211721
},
17221722
"nbformat": 4,

examples/gaussian_processes/GP-SparseApprox.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -477,9 +477,9 @@
477477
"metadata": {
478478
"anaconda-cloud": {},
479479
"kernelspec": {
480-
"display_name": "Python 3",
480+
"display_name": "Python (PyMC3 Dev)",
481481
"language": "python",
482-
"name": "python3"
482+
"name": "pymc3-dev"
483483
},
484484
"language_info": {
485485
"codemirror_mode": {
@@ -491,7 +491,7 @@
491491
"name": "python",
492492
"nbconvert_exporter": "python",
493493
"pygments_lexer": "ipython3",
494-
"version": "3.7.7"
494+
"version": "3.8.5"
495495
}
496496
},
497497
"nbformat": 4,

examples/gaussian_processes/GP-TProcess.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@
362362
"name": "python",
363363
"nbconvert_exporter": "python",
364364
"pygments_lexer": "ipython3",
365-
"version": "3.8.2"
365+
"version": "3.8.5"
366366
}
367367
},
368368
"nbformat": 4,

examples/gaussian_processes/GP-smoothing.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,9 @@
585585
"metadata": {
586586
"anaconda-cloud": {},
587587
"kernelspec": {
588-
"display_name": "Python 3",
588+
"display_name": "Python (PyMC3 Dev)",
589589
"language": "python",
590-
"name": "python3"
590+
"name": "pymc3-dev"
591591
},
592592
"language_info": {
593593
"codemirror_mode": {
@@ -599,7 +599,7 @@
599599
"name": "python",
600600
"nbconvert_exporter": "python",
601601
"pygments_lexer": "ipython3",
602-
"version": "3.7.7"
602+
"version": "3.8.5"
603603
},
604604
"latex_envs": {
605605
"bibliofile": "biblio.bib",

examples/generalized_linear_models/GLM-hierarchical-binominal-model.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
}
2222
],
2323
"source": [
24+
"import warnings\n",
25+
"\n",
2426
"import arviz as az\n",
2527
"import matplotlib.pyplot as plt\n",
2628
"import numpy as np\n",
@@ -41,8 +43,6 @@
4143
"metadata": {},
4244
"outputs": [],
4345
"source": [
44-
"import warnings\n",
45-
"\n",
4646
"warnings.filterwarnings(\"ignore\")"
4747
]
4848
},

examples/generalized_linear_models/GLM-linear.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@
8787
}
8888
],
8989
"source": [
90+
"import warnings\n",
91+
"\n",
9092
"import arviz as az\n",
9193
"import matplotlib.pyplot as plt\n",
9294
"import numpy as np\n",
@@ -103,8 +105,6 @@
103105
"metadata": {},
104106
"outputs": [],
105107
"source": [
106-
"import warnings\n",
107-
"\n",
108108
"warnings.filterwarnings(\"ignore\")"
109109
]
110110
},

examples/generalized_linear_models/GLM-logistic.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
}
3030
],
3131
"source": [
32+
"import warnings\n",
33+
"\n",
3234
"from collections import OrderedDict\n",
3335
"from time import time\n",
3436
"\n",
@@ -53,8 +55,6 @@
5355
"metadata": {},
5456
"outputs": [],
5557
"source": [
56-
"import warnings\n",
57-
"\n",
5858
"warnings.filterwarnings(\"ignore\")"
5959
]
6060
},

examples/generalized_linear_models/GLM-model-selection.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
}
2222
],
2323
"source": [
24+
"import warnings\n",
25+
"\n",
2426
"from collections import OrderedDict\n",
2527
"\n",
2628
"import arviz as az\n",
@@ -41,8 +43,6 @@
4143
"metadata": {},
4244
"outputs": [],
4345
"source": [
44-
"import warnings\n",
45-
"\n",
4646
"warnings.filterwarnings(\"ignore\")"
4747
]
4848
},

examples/generalized_linear_models/GLM-robust-with-outlier-detection.ipynb

-2
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,6 @@
143143
"metadata": {},
144144
"outputs": [],
145145
"source": [
146-
"import warnings\n",
147-
"\n",
148146
"warnings.filterwarnings(\"ignore\")"
149147
]
150148
},

examples/mixture_models/gaussian_mixture_model.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@
218218
}
219219
],
220220
"source": [
221-
"pm.traceplot(tr, var_names=[\"p\", \"sd\", \"means\"]);"
221+
"az.plot_trace(tr, var_names=[\"p\", \"sd\", \"means\"]);"
222222
]
223223
},
224224
{
@@ -259,7 +259,7 @@
259259
],
260260
"source": [
261261
"# take a look at traceplot for some model parameters\n",
262-
"pm.plots.traceplot(tr[::5], var_names=[\"p\", \"sd\", \"means\"]);"
262+
"az.plot_trace(tr[::5], var_names=[\"p\", \"sd\", \"means\"]);"
263263
]
264264
},
265265
{
@@ -293,7 +293,7 @@
293293
],
294294
"source": [
295295
"# I prefer autocorrelation plots for serious confirmation of MCMC convergence\n",
296-
"pm.autocorrplot(tr[::5], var_names=[\"sd\"]);"
296+
"az.plot_autocorr(tr[::5], var_names=[\"sd\"]);"
297297
]
298298
},
299299
{

examples/mixture_models/marginalized_gaussian_mixture_model.ipynb

-16
Original file line numberDiff line numberDiff line change
@@ -606,22 +606,6 @@
606606
"%load_ext watermark\n",
607607
"%watermark -n -u -v -iv -w"
608608
]
609-
},
610-
{
611-
"cell_type": "code",
612-
"execution_count": null,
613-
"metadata": {
614-
"papermill": {
615-
"duration": 0.04472,
616-
"end_time": "2020-12-20T20:58:55.101908",
617-
"exception": false,
618-
"start_time": "2020-12-20T20:58:55.057188",
619-
"status": "completed"
620-
},
621-
"tags": []
622-
},
623-
"outputs": [],
624-
"source": []
625609
}
626610
],
627611
"metadata": {

examples/ode_models/ODE_API_shapes_and_benchmarking.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"source": [
3030
"import logging\n",
3131
"\n",
32+
"import arviz\n",
3233
"import matplotlib.pyplot as plt\n",
3334
"import numpy as np\n",
3435
"import pymc3 as pm\n",
@@ -40,7 +41,6 @@
4041
"# this notebook show DEBUG log messages\n",
4142
"logging.getLogger(\"pymc3\").setLevel(logging.DEBUG)\n",
4243
"\n",
43-
"import arviz\n",
4444
"import IPython.display"
4545
]
4646
},

examples/ode_models/ODE_with_manual_gradients.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"metadata": {},
77
"outputs": [],
88
"source": [
9+
"import warnings\n",
10+
"\n",
911
"import arviz as az\n",
1012
"import matplotlib.pyplot as plt\n",
1113
"import numpy as np\n",
@@ -24,8 +26,6 @@
2426
"metadata": {},
2527
"outputs": [],
2628
"source": [
27-
"import warnings\n",
28-
"\n",
2929
"warnings.filterwarnings(\"ignore\", category=FutureWarning)"
3030
]
3131
},

examples/pymc3_howto/lasso_block_update.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"metadata": {},
4242
"outputs": [],
4343
"source": [
44-
"warnings.filterwarnings(\"ignore\", category=DeprecationWarning)"
44+
"warnings.filterwarnings(\"ignore\")"
4545
]
4646
},
4747
{

0 commit comments

Comments
 (0)