Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Apr 5, 2024
1 parent 5d27076 commit 1a466e3
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions dpdata/plugins/ase.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import TYPE_CHECKING, Optional, Type, Generator, List
from typing import TYPE_CHECKING, Generator, List, Optional, Type

import numpy as np

Expand Down Expand Up @@ -298,10 +298,7 @@ def from_labeled_system(

return dict_frames

def to_system(self,
data,
file_name: str = "confs.traj",
**kwargs) -> None:
def to_system(self, data, file_name: str = "confs.traj", **kwargs) -> None:
"""Convert System to ASE Atoms object.
Parameters
Expand All @@ -310,23 +307,23 @@ def to_system(self,
path to file
"""
list_atoms = ASEStructureFormat().to_system(data, **kwargs)
traj = Trajectory(file_name, 'a')
traj = Trajectory(file_name, "a")
_ = [traj.write(atom) for atom in list_atoms]
traj.close()
return

def to_labeled_system(self,
data,
file_name: str = "labeled_confs.traj",
*args, **kwargs) -> None:
def to_labeled_system(
self, data, file_name: str = "labeled_confs.traj", *args, **kwargs
) -> None:
"""Convert System to ASE Atoms object.
Parameters
----------
file_name : str
path to file
"""
list_atoms = ASEStructureFormat().to_labeled_system(data, *args, **kwargs)
traj = Trajectory(file_name, 'a')
traj = Trajectory(file_name, "a")
_ = [traj.write(atom) for atom in list_atoms]
traj.close()
return
Expand Down

0 comments on commit 1a466e3

Please sign in to comment.