Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

poetry update & new version #160

Merged
merged 6 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions ipsuite/calculators/apax_jax_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import typing

import ase.io
import h5py
import yaml
import znh5md
import zntrack.utils
from zntrack import dvc, zn

Expand Down Expand Up @@ -92,5 +94,13 @@ def run(self):
@functools.cached_property
def atoms(self) -> typing.List[ase.Atoms]:
# filename should be changeable
with self.state.fs.open((self.sim_dir / "md.traj").as_posix()) as f:
return list(ase.io.iread(f))
def file_handle(filename):
file = self.state.fs.open(filename, "rb")
return h5py.File(file)

return znh5md.ASEH5MD(
self.sim_dir / "md.h5",
format_handler=functools.partial(
znh5md.FormatHandler, file_handle=file_handle
),
).get_atoms_list()
Loading
Loading