From 5611ab8db8c235fac0786f601b424c0bf1fc07c5 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Thu, 1 Feb 2024 07:58:38 +0100 Subject: [PATCH] v2024.2.1 --- .github/workflows/release.yml | 6 ++++ dev_scripts/regen_libxcfunc.py | 2 +- docs/CHANGES.md | 28 +++++++++++++++++++ .../coordination_geometries.py | 2 +- pymatgen/command_line/gulp_caller.py | 8 +++--- pymatgen/io/adf.py | 6 ++-- pymatgen/io/cssr.py | 2 +- pymatgen/io/feff/inputs.py | 6 ++-- pymatgen/io/shengbte.py | 8 +++--- pymatgen/io/xr.py | 2 +- setup.py | 2 +- 11 files changed, 53 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c2b5eb29754..0ce77e0b137 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,6 +55,12 @@ jobs: - name: Check out repo uses: actions/checkout@v4 + # TODO: remove pipx manual install if https://github.com/actions/runner-images/issues/9256 + # is resolved + - name: Install pipx + if: matrix.os == 'macos-14' + run: brew install pipx && pipx ensurepath + - name: Build wheels uses: pypa/cibuildwheel@v2.16.2 env: diff --git a/dev_scripts/regen_libxcfunc.py b/dev_scripts/regen_libxcfunc.py index 29e308ccb75..f87d026a700 100755 --- a/dev_scripts/regen_libxcfunc.py +++ b/dev_scripts/regen_libxcfunc.py @@ -85,7 +85,7 @@ def main(): xc_funcs = parse_libxc_docs(path) - # Generate new json file in pycore + # Generate new JSON file in pycore pmg_core = os.path.abspath("../pymatgen/core/") json_path = f"{pmg_core}/libxc_docs.json" write_libxc_docs_json(xc_funcs, json_path) diff --git a/docs/CHANGES.md b/docs/CHANGES.md index d44cb7b24ae..9ec45ce8c59 100644 --- a/docs/CHANGES.md +++ b/docs/CHANGES.md @@ -6,6 +6,34 @@ nav_order: 4 # Changelog +## v2024.2.1 + +### ๐Ÿ› Bug Fixes + +* Fix `Vasprun.get_potcars` search method; tweak fake POTCARs by @esoteric-ephemera in https://github.com/materialsproject/pymatgen/pull/3587 + +### ๐Ÿ›  Enhancements + +* Aims input sets by @tpurcell90 in https://github.com/materialsproject/pymatgen/pull/3482 + +### ๐Ÿ“– Documentation + +* Adding FHI-aims inputs developers by @tpurcell90 in https://github.com/materialsproject/pymatgen/pull/3592 + +### ๐Ÿงช Tests + +* Add tests for the New Vasp input sets by @Zhuoying in https://github.com/materialsproject/pymatgen/pull/3576 + +### ๐Ÿฅ Package Health + +* Switch macOS wheel building to new M1 runners by @janosh in https://github.com/materialsproject/pymatgen/pull/3596 + +### ๐Ÿคทโ€โ™‚๏ธ Other Changes + +* Fix text formatting in `bug_report.yaml` by @Andrew-S-Rosen in https://github.com/materialsproject/pymatgen/pull/3589 + +**Full Changelog**: https://github.com/materialsproject/pymatgen/compare/v2024.1.27...v2024.2.1 + ## v2024.1.26 ### ๐Ÿ› Bug Fixes diff --git a/pymatgen/analysis/chemenv/coordination_environments/coordination_geometries.py b/pymatgen/analysis/chemenv/coordination_environments/coordination_geometries.py index 5b293bead09..9156290bf71 100644 --- a/pymatgen/analysis/chemenv/coordination_environments/coordination_geometries.py +++ b/pymatgen/analysis/chemenv/coordination_environments/coordination_geometries.py @@ -397,7 +397,7 @@ def hints(self, hints_info): """ if hints_info["csm"] > self.options["csm_max"]: return [] - return object.__getattribute__(self, f"{self.hints_type}_hints")(hints_info) + return getattr(self, f"{self.hints_type}_hints")(hints_info) def single_cap_hints(self, hints_info): """Return hints for an additional neighbors set, i.e. the voronoi indices that diff --git a/pymatgen/command_line/gulp_caller.py b/pymatgen/command_line/gulp_caller.py index 634b45a5f86..8e73bfefdfc 100644 --- a/pymatgen/command_line/gulp_caller.py +++ b/pymatgen/command_line/gulp_caller.py @@ -287,7 +287,7 @@ def structure_lines( alpha, beta, gamma = lattice.angles a, b, c = lattice.lengths lat_str = f"{a:6f} {b:6f} {c:6f} {alpha:6f} {beta:6f} {gamma:6f}" - gin += lat_str + "\n" + gin += f"{lat_str}\n" if frac_flg: gin += "frac\n" @@ -308,7 +308,7 @@ def structure_lines( if symm_flg: gin += "space\n" - gin += str(SpacegroupAnalyzer(structure).get_space_group_number()) + "\n" + gin += f"{SpacegroupAnalyzer(structure).get_space_group_number()}\n" return gin @staticmethod @@ -367,7 +367,7 @@ def readable(f): if readable(fpath): gin = "library " + file_name if gin: - return gin + "\n" + return f"{gin}\n" raise GulpError("GULP library not found") def buckingham_input(self, structure: Structure, keywords, library=None, uc=True, valence_dict=None): @@ -694,7 +694,7 @@ def run(self, gin): gout = "" for line in out.split("\n"): - gout = gout + line + "\n" + gout = f"{gout}{line}\n" return gout diff --git a/pymatgen/io/adf.py b/pymatgen/io/adf.py index 24f4f89540e..1c37c959ca8 100644 --- a/pymatgen/io/adf.py +++ b/pymatgen/io/adf.py @@ -543,7 +543,7 @@ def __str__(self): for block_key in self.other_directives: if not isinstance(block_key, AdfKey): raise ValueError(f"{block_key} is not an AdfKey!") - out += str(block_key) + "\n" + out += f"{block_key}\n" return out def as_dict(self): @@ -634,8 +634,8 @@ def write_file(self, molecule, inp_file): with open(inp_file, "w+") as file: for block in mol_blocks: - file.write(str(block) + "\n") - file.write(str(self.task) + "\n") + file.write(f"{block}\n") + file.write(f"{self.task}\n") file.write("END INPUT") diff --git a/pymatgen/io/cssr.py b/pymatgen/io/cssr.py index 12d920fad65..e5d238f06f3 100644 --- a/pymatgen/io/cssr.py +++ b/pymatgen/io/cssr.py @@ -53,7 +53,7 @@ def write_file(self, filename): filename (str): Filename to write to. """ with zopen(filename, mode="wt") as file: - file.write(str(self) + "\n") + file.write(f"{self}\n") @classmethod def from_str(cls, string): diff --git a/pymatgen/io/feff/inputs.py b/pymatgen/io/feff/inputs.py index 75a76481adc..eeb01ed82bc 100644 --- a/pymatgen/io/feff/inputs.py +++ b/pymatgen/io/feff/inputs.py @@ -369,7 +369,7 @@ def write_file(self, filename="HEADER"): filename: Filename and path for file to be written to disk """ with open(filename, mode="w") as file: - file.write(str(self) + "\n") + file.write(f"{self}\n") class Atoms(MSONable): @@ -942,7 +942,7 @@ def write_file(self, filename="POTENTIALS"): filename: filename and path to write potential file to. """ with zopen(filename, mode="wt") as file: - file.write(str(self) + "\n") + file.write(f"{self}\n") class Paths(MSONable): @@ -983,7 +983,7 @@ def __str__(self): def write_file(self, filename="paths.dat"): """Write paths.dat.""" with zopen(filename, mode="wt") as file: - file.write(str(self) + "\n") + file.write(f"{self}\n") class FeffParseError(ParseError): diff --git a/pymatgen/io/shengbte.py b/pymatgen/io/shengbte.py index c5fc381b732..88171a60a10 100644 --- a/pymatgen/io/shengbte.py +++ b/pymatgen/io/shengbte.py @@ -177,19 +177,19 @@ def to_file(self, filename: str = "CONTROL"): alloc_dict = _get_subdict(self, self.allocations_keys) alloc_nml = f90nml.Namelist({"allocations": alloc_dict}) - control_str = str(alloc_nml) + "\n" + control_str = f"{alloc_nml}\n" crystal_dict = _get_subdict(self, self.crystal_keys) crystal_nml = f90nml.Namelist({"crystal": crystal_dict}) - control_str += str(crystal_nml) + "\n" + control_str += f"{crystal_nml}\n" params_dict = _get_subdict(self, self.params_keys) params_nml = f90nml.Namelist({"parameters": params_dict}) - control_str += str(params_nml) + "\n" + control_str += f"{params_nml}\n" flags_dict = _get_subdict(self, self.flags_keys) flags_nml = f90nml.Namelist({"flags": flags_dict}) - control_str += str(flags_nml) + "\n" + control_str += f"{flags_nml}\n" with open(filename, mode="w") as file: file.write(control_str) diff --git a/pymatgen/io/xr.py b/pymatgen/io/xr.py index e576f1f47e4..6fb984fa0b0 100644 --- a/pymatgen/io/xr.py +++ b/pymatgen/io/xr.py @@ -66,7 +66,7 @@ def write_file(self, filename): filename (str): name of the file to write to. """ with zopen(filename, mode="wt") as file: - file.write(str(self) + "\n") + file.write(f"{self}\n") @classmethod def from_str(cls, string, use_cores=True, thresh=1.0e-4): diff --git a/setup.py b/setup.py index 3b17636515f..d7b762634f5 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ setup( name="pymatgen", packages=find_namespace_packages(include=["pymatgen.*", "pymatgen.**.*", "cmd_line"]), - version="2024.1.27", + version="2024.2.1", python_requires=">=3.9", install_requires=[ "matplotlib>=1.5",