pymc-devs / pymc-examples

Examples of PyMC models, including a library of Jupyter notebooks.
https://www.pymc.io/projects/examples/en/latest/
MIT License
263 stars 218 forks source link

Replace at -> pt. #485

Closed twiecki closed 1 year ago

twiecki commented 1 year ago

Following https://github.com/pymc-devs/pymc-examples/pull/481, now also renaming at->pt. This is the script:

#!/bin/bash

if [ -z "$1" ]
  then
    echo "Script to automatically convert code (*.py and *.ipynb) from PyMC3 to 4.0. Use with care."
    echo "Usage: pymc3_to_4.sh <path>"
    exit 1
fi

declare -a replace_strings=(
    "s/import pytensor\.tensor as at/import pytensor.tensor as pt/g"
     #"s/tt\./pt./g"
     "s/at\./pt./g"
)

for replace in "${replace_strings[@]}"; do
    find $1 -name "*.ipynb" -type f -exec sed -i -e "/png/n;/stat/n;/that/n;$replace" {} \;
done
review-notebook-app[bot] commented 1 year ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

drbenvincent commented 1 year ago

There's also this in conf.py

intersphinx_mapping = {
    "aesara": ("https://aesara.readthedocs.io/en/latest/", None),

and this in .pre-commit-config.yaml

      entry: >
          (?x)(arviz-devs.github.io|
               aesara.readthedocs.io|