Skip to content

Commit

Permalink
pre-commit auto-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Dec 26, 2024
1 parent 3e9ddc4 commit 2d22309
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/pymatgen/transformations/standard_transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,13 @@ def apply_transformation(
manipulations.append([0, empty, list(group), None])

if self.algo == self.ALGO_RANDOM:
rand_structures = get_randomly_manipulated_structures(struct=struct, manipulations=manipulations, n_return=n_to_return)
rand_structures = get_randomly_manipulated_structures(
struct=struct, manipulations=manipulations, n_return=n_to_return
)
if return_ranked_list:
return [{"energy": 0.0, "energy_above_minimum": 0.0, "structure": s} for s in rand_structures[:n_to_return]]
return [
{"energy": 0.0, "energy_above_minimum": 0.0, "structure": s} for s in rand_structures[:n_to_return]
]
return rand_structures[0]

matrix = EwaldSummation(struct).total_energy_matrix
Expand Down
2 changes: 1 addition & 1 deletion tests/transformations/test_standard_transformations.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def test_random_sample(self):
assert len(output) == 3
for entry in output:
assert set(entry.keys()) == {"structure", "energy", "energy_above_minimum"}

output = trafo.apply_transformation(struct * [2, 2, 2], return_ranked_list=False)
assert output.composition.reduced_formula == struct.composition.reduced_formula

Expand Down

0 comments on commit 2d22309

Please sign in to comment.