File tree 1 file changed +30
-0
lines changed
1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ if [ -z " $1 " ]
4
+ then
5
+ echo " Usage: pymc3_to_4.sh <path>"
6
+ exit 1
7
+ fi
8
+
9
+ declare -a replace_strings=(
10
+ " s/az.from_pymc3/pm.to_inference_data/g"
11
+ " s/arviz.from_pymc3/pm.to_inference_data/g"
12
+ " s/pymc3/pymc/g"
13
+ " s/PyMC3/PyMC/g"
14
+ " s/from theano import tensor as tt/import aesara.tensor as at/g"
15
+ " s/import theano\.tensor as tt/import aesara.tensor as at/g"
16
+ " s/tt\./at./g"
17
+ " s/aet/at/g"
18
+ " s/studenat/studentt/g"
19
+ " s/theano/aesara/g"
20
+ " s/Theano/Aesara/g"
21
+ " s/pm\.sample()/pm.sample(return_inferencedata=False)/g"
22
+ " s/, return_inferencedata\=True//g"
23
+ " s/return_inferencedata\=True, //g"
24
+ " s/return_inferencedata\=True//g"
25
+ )
26
+
27
+ for replace in " ${replace_strings[@]} " ; do
28
+ find $1 -name " *.ipynb" -type f -exec sed -i -e " $replace " {} \;
29
+ find $1 -name " *.py" -type f -exec sed -i -e " $replace " {} \;
30
+ done
You can’t perform that action at this time.
0 commit comments