Skip to content

Commit 5bba0f7

Browse files
committed
v2024.2.1
1 parent adf5af6 commit 5bba0f7

File tree

11 files changed

+53
-19
lines changed

11 files changed

+53
-19
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,12 @@ jobs:
120120
- name: Check out repo
121121
uses: actions/checkout@v4
122122

123+
# TODO: remove pipx manual install if https://github.com/actions/runner-images/issues/9256
124+
# is resolved
125+
- name: Install pipx
126+
if: matrix.os == 'macos-14'
127+
run: brew install pipx && pipx ensurepath
128+
123129
- name: Build wheels
124130
uses: pypa/cibuildwheel@v2.16.2
125131
env:

dev_scripts/regen_libxcfunc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def main():
8585

8686
xc_funcs = parse_libxc_docs(path)
8787

88-
# Generate new json file in pycore
88+
# Generate new JSON file in pycore
8989
pmg_core = os.path.abspath("../pymatgen/core/")
9090
json_path = f"{pmg_core}/libxc_docs.json"
9191
write_libxc_docs_json(xc_funcs, json_path)

docs/CHANGES.md

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pymatgen/analysis/chemenv/coordination_environments/coordination_geometries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def hints(self, hints_info):
397397
"""
398398
if hints_info["csm"] > self.options["csm_max"]:
399399
return []
400-
return object.__getattribute__(self, f"{self.hints_type}_hints")(hints_info)
400+
return getattr(self, f"{self.hints_type}_hints")(hints_info)
401401

402402
def single_cap_hints(self, hints_info):
403403
"""Return hints for an additional neighbors set, i.e. the voronoi indices that

pymatgen/command_line/gulp_caller.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def structure_lines(
287287
alpha, beta, gamma = lattice.angles
288288
a, b, c = lattice.lengths
289289
lat_str = f"{a:6f} {b:6f} {c:6f} {alpha:6f} {beta:6f} {gamma:6f}"
290-
gin += lat_str + "\n"
290+
gin += f"{lat_str}\n"
291291

292292
if frac_flg:
293293
gin += "frac\n"
@@ -308,7 +308,7 @@ def structure_lines(
308308

309309
if symm_flg:
310310
gin += "space\n"
311-
gin += str(SpacegroupAnalyzer(structure).get_space_group_number()) + "\n"
311+
gin += f"{SpacegroupAnalyzer(structure).get_space_group_number()}\n"
312312
return gin
313313

314314
@staticmethod
@@ -367,7 +367,7 @@ def readable(f):
367367
if readable(fpath):
368368
gin = "library " + file_name
369369
if gin:
370-
return gin + "\n"
370+
return f"{gin}\n"
371371
raise GulpError("GULP library not found")
372372

373373
def buckingham_input(self, structure: Structure, keywords, library=None, uc=True, valence_dict=None):
@@ -694,7 +694,7 @@ def run(self, gin):
694694

695695
gout = ""
696696
for line in out.split("\n"):
697-
gout = gout + line + "\n"
697+
gout = f"{gout}{line}\n"
698698
return gout
699699

700700

pymatgen/io/adf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ def __str__(self):
543543
for block_key in self.other_directives:
544544
if not isinstance(block_key, AdfKey):
545545
raise ValueError(f"{block_key} is not an AdfKey!")
546-
out += str(block_key) + "\n"
546+
out += f"{block_key}\n"
547547
return out
548548

549549
def as_dict(self):
@@ -634,8 +634,8 @@ def write_file(self, molecule, inp_file):
634634

635635
with open(inp_file, "w+") as file:
636636
for block in mol_blocks:
637-
file.write(str(block) + "\n")
638-
file.write(str(self.task) + "\n")
637+
file.write(f"{block}\n")
638+
file.write(f"{self.task}\n")
639639
file.write("END INPUT")
640640

641641

pymatgen/io/cssr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def write_file(self, filename):
5353
filename (str): Filename to write to.
5454
"""
5555
with zopen(filename, mode="wt") as file:
56-
file.write(str(self) + "\n")
56+
file.write(f"{self}\n")
5757

5858
@classmethod
5959
def from_str(cls, string):

pymatgen/io/feff/inputs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def write_file(self, filename="HEADER"):
369369
filename: Filename and path for file to be written to disk
370370
"""
371371
with open(filename, mode="w") as file:
372-
file.write(str(self) + "\n")
372+
file.write(f"{self}\n")
373373

374374

375375
class Atoms(MSONable):
@@ -942,7 +942,7 @@ def write_file(self, filename="POTENTIALS"):
942942
filename: filename and path to write potential file to.
943943
"""
944944
with zopen(filename, mode="wt") as file:
945-
file.write(str(self) + "\n")
945+
file.write(f"{self}\n")
946946

947947

948948
class Paths(MSONable):
@@ -983,7 +983,7 @@ def __str__(self):
983983
def write_file(self, filename="paths.dat"):
984984
"""Write paths.dat."""
985985
with zopen(filename, mode="wt") as file:
986-
file.write(str(self) + "\n")
986+
file.write(f"{self}\n")
987987

988988

989989
class FeffParseError(ParseError):

pymatgen/io/shengbte.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,19 +177,19 @@ def to_file(self, filename: str = "CONTROL"):
177177

178178
alloc_dict = _get_subdict(self, self.allocations_keys)
179179
alloc_nml = f90nml.Namelist({"allocations": alloc_dict})
180-
control_str = str(alloc_nml) + "\n"
180+
control_str = f"{alloc_nml}\n"
181181

182182
crystal_dict = _get_subdict(self, self.crystal_keys)
183183
crystal_nml = f90nml.Namelist({"crystal": crystal_dict})
184-
control_str += str(crystal_nml) + "\n"
184+
control_str += f"{crystal_nml}\n"
185185

186186
params_dict = _get_subdict(self, self.params_keys)
187187
params_nml = f90nml.Namelist({"parameters": params_dict})
188-
control_str += str(params_nml) + "\n"
188+
control_str += f"{params_nml}\n"
189189

190190
flags_dict = _get_subdict(self, self.flags_keys)
191191
flags_nml = f90nml.Namelist({"flags": flags_dict})
192-
control_str += str(flags_nml) + "\n"
192+
control_str += f"{flags_nml}\n"
193193

194194
with open(filename, mode="w") as file:
195195
file.write(control_str)

pymatgen/io/xr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def write_file(self, filename):
6666
filename (str): name of the file to write to.
6767
"""
6868
with zopen(filename, mode="wt") as file:
69-
file.write(str(self) + "\n")
69+
file.write(f"{self}\n")
7070

7171
@classmethod
7272
def from_str(cls, string, use_cores=True, thresh=1.0e-4):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
setup(
2626
name="pymatgen",
2727
packages=find_namespace_packages(include=["pymatgen.*", "pymatgen.**.*", "cmd_line"]),
28-
version="2024.1.27",
28+
version="2024.2.1",
2929
python_requires=">=3.9",
3030
install_requires=[
3131
"matplotlib>=1.5",

0 commit comments

Comments
 (0)