From 0a233ef87a3e618a306483c176d8647add174aff Mon Sep 17 00:00:00 2001 From: Shyue Ping Ong Date: Mon, 9 Oct 2023 07:39:44 -0700 Subject: [PATCH] Fix changelog code. --- docs/changelog.md | 22 +++++++++++++++++++++ tasks.py | 49 +++++++++++++++++++++++++++-------------------- 2 files changed, 50 insertions(+), 21 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index e5198df3..999b354b 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -6,6 +6,28 @@ nav_order: 2 # Change Log +## 2023.10.9 +* PR #293 from @samblau (#293) + A bug was introduced during the recent Minor Q-Chem updates PR: + ```diff + - os.mkdir(local_scratch, exist_ok=True) + + os.makedirs(local_scratch, exist_ok=True) + ``` + I would appreciate it if a new version could please be released after this PR is merged. Thanks! +* PR #292 from @samblau (#292) + This PR fixes a few bugs in the Q-Chem error handlers, adds one new handler, adds some additional tests, and slightly extends post processing scratch file handling. +* PR #285 from @janosh (#285) + 7b0c061a fix `MeshSymmetryErrorHandler` treating `ISYM=-1` as symmetry ON + 72ac1213 `PositiveEnergyErrorHandler` don't decrease `POTIM` for static calcs +* PR #284 from @janosh (#284) + 225a1e8d UnconvergedErrorHandler only set algo to normal if ISMEAR>=0 + 608530b2 mv custodian/feff/tests/test_handler{,s}.py + c11ab49e tweak bravais error handling in VaspErrorHandler + 283fe9d2 improve den-/tet error handling in case of not using kspacing + bc022852 fix VaspErrorHandlerTest.test_bravais +* PR #283 from @janosh (#283) + When running VASP with `INCAR` tag `kspacing` instead of a `KPOINTS` file and encountering `brmix` 2 or 3 times. Reported by @esoteric-ephemera in atomate2 r2SCAN workflow. + ## v2023.7.22 - Fix for LargeSigmaHandler. Now defaults to ISMEAR=1 and fallback to ISMEAR=0 if SIGMA has been modified diff --git a/tasks.py b/tasks.py index a49f8d43..60d75e32 100755 --- a/tasks.py +++ b/tasks.py @@ -100,33 +100,40 @@ def update_changelog(ctx, version=None, sim=False): lines = [] misc = [] for line in output.decode("utf-8").strip().split("\n"): - m = re.match(r"Merge pull request \#(\d+) from (.*)", line) + m = re.search(r"\(\#(\d+)\)", line) if m: pr_number = m.group(1) - contrib, pr_name = m.group(2).split("/", 1) + pr_name = m.group().rsplit(r"\(", 1)[0] response = requests.get(f"https://api.github.com/repos/materialsproject/custodian/pulls/{pr_number}") - lines.append(f"* PR #{pr_number} from @{contrib} {pr_name}") - if "body" in response.json(): - for ll in response.json()["body"].split("\n"): - ll = ll.strip() - if ll in ["", "## Summary"]: - continue - if ll.startswith(("## Checklist", "## TODO")): - break - lines.append(f" {ll}") - misc.append(line) - with open("docs_rst/changelog.md") as f: + try: + d = response.json() + contrib = d["user"]["login"] + lines.append(f"* PR #{pr_number} from @{contrib} {pr_name}") + if "body" in response.json(): + for ll in response.json()["body"].split("\n"): + ll = ll.strip() + if ll in ["", "## Summary"]: + continue + if ll.startswith(("## Checklist", "## TODO")): + break + lines.append(f" {ll}") + except: + pass + else: + misc.append("- " + line) + with open("docs/changelog.md") as f: contents = f.read() - line = "==========" - toks = contents.split(line) - head = f"\n\nv{version}\n" + "-" * (len(version) + 1) + "\n" - toks.insert(-1, head + "\n".join(lines)) + head = "# Change Log" + i = contents.find(head) + i += len(head) + + contents = contents[0:i] + f"\n\n## {NEW_VER}\n" + "\n".join(lines) + contents[i:] if not sim: - with open("docs_rst/changelog.md", "w") as f: - f.write(toks[0] + line + "".join(toks[1:])) - ctx.run("open docs_rst/changelog.md") + with open("docs/changelog.md", "w") as f: + f.write(contents) + ctx.run("open docs/changelog.md") else: - print(toks[0] + line + "".join(toks[1:])) + print(contents) print("The following commit messages were not included...") print("\n".join(misc))