Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase V4 onto current master (2dee9daf) #4579

Merged
merged 0 commits into from
Mar 29, 2021

Conversation

michaelosthege
Copy link
Member

Restores mergeability of v4 w.r.t. master.

I resolved merge conflicts by prioritizing the changes from the v4 branch.

On every commit I ran the following script to replace aet occurences:

import pathlib
import textwrap

extensions = [".py", ".rst"]
replacements = [
    ("import aesara.tensor as aet", "import aesara.tensor as at"),
    ("aet.", "at."),
]

def process_file(fp: pathlib.Path):
    with open(fp, encoding="utf8") as file:
        lines = file.readlines()

    newlines = []
    for l, line in enumerate(lines):
        newline = line
        for old, new in replacements:
            newline = newline.replace(old, new)
            if newline != line:
                print(textwrap.dedent(f"""
                L{l} in {fp}
{line.strip()}
{newline.strip()}
                """))
        newlines.append(newline)

    with open(fp, "w", encoding="utf8") as file:
        file.writelines(newlines)
    return


def run():
    for ext in extensions:
        for file in pathlib.Path(r"E:\Source\Repos\pymc3").glob(f"**/*{ext}"):
            try:
                process_file(file)
            except:
                print(file)
                raise
    pass

if __name__ == "__main__":
    run()

@brandonwillard brandonwillard merged commit 93a096d into pymc-devs:v4 Mar 29, 2021
@michaelosthege michaelosthege deleted the v4-aet-to-at branch August 7, 2021 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants