diff --git a/mdgo/coordination.py b/mdgo/coordination.py index dddb7b37..c142ae2e 100644 --- a/mdgo/coordination.py +++ b/mdgo/coordination.py @@ -1043,6 +1043,7 @@ def concat_coord_array( and the corresponding values are the selection language. run_start: Start frame of analysis. run_end: End frame of analysis. + kwargs: Keyword arguments in the func. Returns: A diction containing the coordination number sequence of each specified neighbor species diff --git a/mdgo/msd.py b/mdgo/msd.py index b0c4e97a..b3a50412 100644 --- a/mdgo/msd.py +++ b/mdgo/msd.py @@ -285,7 +285,7 @@ def parse_msd_type(msd_type: DIM) -> list[int]: dim = keys[msd_type_str] except KeyError: raise ValueError( - f"invalid msd_type: {msd_type_str} specified, please specify one of xyz, " "xy, xz, yz, x, y, z" + f"invalid msd_type: {msd_type_str} specified, please specify one of xyz, xy, xz, yz, x, y, z" ) return dim diff --git a/mdgo/residence_time.py b/mdgo/residence_time.py index 876928ba..5808ee6a 100644 --- a/mdgo/residence_time.py +++ b/mdgo/residence_time.py @@ -125,9 +125,9 @@ def calc_neigh_corr( Args: nvt_run: An MDAnalysis ``Universe``. - distance_dict: - select_dict: - time_step: + distance_dict: A dict of coordination cutoff distance of the neighbor species. + select_dict: A dictionary of atom species selection. + time_step: Timestep between each frame, in ps. run_start: Start frame of analysis. run_end: End frame of analysis. center_atom: The center atom to calculate the ACF for. Default to "cation". @@ -158,8 +158,7 @@ def calc_neigh_corr( run_end, ) acfs = calc_acf(adjacency_matrix) - for acf in acfs: - acf_all.append(acf) + acf_all.extend(list(acfs)) acf_avg[kw] = np.mean(acf_all, axis=0) return times, acf_avg diff --git a/tasks.py b/tasks.py index d3f563d8..0f46e223 100644 --- a/tasks.py +++ b/tasks.py @@ -1,5 +1,8 @@ """ Pyinvoke tasks.py file for automating releases and admin stuff. + +To cut a new mdgo release, use `invoke update-changelog` followed by `invoke release`. + Author: Tingzheng Hou """ from __future__ import annotations @@ -179,8 +182,8 @@ def update_changelog(ctx, version, sim=False): output = subprocess.check_output(["git", "log", "--pretty=format:%s", "v%s..HEAD" % CURRENT_VER]) lines = [] misc = [] - for l in output.decode("utf-8").strip().split("\n"): - m = re.match(r"Merge pull request \#(\d+) from (.*)", l) + for line in output.decode("utf-8").strip().split("\n"): + m = re.match(r"Merge pull request \#(\d+) from (.*)", line) if m: pr_number = m.group(1) contrib, pr_name = m.group(2).split("/", 1) @@ -191,22 +194,22 @@ def update_changelog(ctx, version, sim=False): ll = ll.strip() if ll in ["", "## Summary"]: continue - elif ll.startswith(("## Checklist", "## TODO")): + if ll.startswith(("## Checklist", "## TODO")): break lines.append(f" {ll}") - misc.append(l) + misc.append(line) with open("CHANGES.rst") as f: contents = f.read() - l = "==========" - toks = contents.split(l) + line = "==========" + toks = contents.split(line) head = "\n\nv%s\n" % version + "-" * (len(version) + 1) + "\n" toks.insert(-1, head + "\n".join(lines)) if not sim: with open("CHANGES.rst", "w") as f: - f.write(toks[0] + l + "".join(toks[1:])) + f.write(toks[0] + line + "".join(toks[1:])) ctx.run("open CHANGES.rst") else: - print(toks[0] + l + "".join(toks[1:])) + print(toks[0] + line + "".join(toks[1:])) print("The following commit messages were not included...") print("\n".join(misc))