Skip to content

Commit

Permalink
u
Browse files Browse the repository at this point in the history
  • Loading branch information
thangckt committed May 27, 2024
1 parent 14e48f8 commit 7315d77
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.12"]
python-version: ["3.11"]
# python-version: ["3.7", "3.8", "3.12"]

steps:
Expand Down
6 changes: 3 additions & 3 deletions dpdata/plugins/ase.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Generator, List
from typing import TYPE_CHECKING, Generator

import numpy as np

Expand Down Expand Up @@ -145,7 +145,7 @@ def from_multi_systems(
frames = ase.io.read(file_name, format=ase_fmt, index=slice(begin, end, step))
yield from frames

def to_system(self, data, **kwargs) -> List[ase.Atoms]:
def to_system(self, data, **kwargs) -> list[ase.Atoms]:
"""Convert System to ASE Atom obj."""
from ase import Atoms

Expand All @@ -163,7 +163,7 @@ def to_system(self, data, **kwargs) -> List[ase.Atoms]:

return structures

def to_labeled_system(self, data, *args, **kwargs) -> List[ase.Atoms]:
def to_labeled_system(self, data, *args, **kwargs) -> list[ase.Atoms]:
"""Convert System to ASE Atoms object."""
from ase import Atoms
from ase.calculators.singlepoint import SinglePointCalculator
Expand Down
10 changes: 6 additions & 4 deletions tests/test_ase_traj.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ def setUp(self):
@unittest.skipIf(skip_ase, "skip ase related test. install ase to fix")
class TestASEtraj4(unittest.TestCase, CompSys, IsPBC):
def setUp(self):
self.system_1 = dpdata.System("ase_traj/MoS2", fmt="deepmd")
self.system_1.to(file_name="tmp.traj", fmt="ase/traj")
system_1 = dpdata.System("ase_traj/MoS2", fmt="deepmd")
system_1.to(file_name="tmp.traj", fmt="ase/traj")
self.system_2 = dpdata.System("tmp.traj", fmt="ase/traj")
self.system_1 = system_1
self.places = 6
self.e_places = 6
self.f_places = 6
Expand All @@ -82,9 +83,10 @@ def setUp(self):
@unittest.skipIf(skip_ase, "skip ase related test. install ase to fix")
class TestASEtraj4Labeled(unittest.TestCase, CompLabeledSys, IsPBC):
def setUp(self):
self.system_1 = dpdata.LabeledSystem("ase_traj/MoS2", fmt="deepmd")
self.system_1.to(file_name="tmp1.traj", fmt="ase/traj")
system_1 = dpdata.LabeledSystem("ase_traj/MoS2", fmt="deepmd")
system_1.to(file_name="tmp1.traj", fmt="ase/traj")
self.system_2 = dpdata.LabeledSystem("tmp1.traj", fmt="ase/traj")
self.system_1 = system_1
self.places = 6
self.e_places = 6
self.f_places = 6
Expand Down

0 comments on commit 7315d77

Please sign in to comment.