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 all 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
1 change: 1 addition & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
git config --global user.email [email protected]
git config --global init.defaultBranch "main"
- name: prepare repo
continue-on-error: true
run: |
git clone https://github.com/PythonFZ/IPS-Examples
cd IPS-Examples
Expand Down
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()
1 change: 0 additions & 1 deletion ipsuite/configuration_comparison/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ class ConfigurationComparison(base.IPSNode):

Attributes
----------
hash used to use this Node as zn.Nodes()
reference: typing.Union[utils.helpers.UNION_ATOMS_OR_ATOMS_LST,
utils.types.SupportsAtoms]
reference configurations to compare analyte to
Expand Down
3 changes: 0 additions & 3 deletions ipsuite/configuration_selection/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Base Node for ConfigurationSelection."""
import logging
import typing
import uuid

import ase
import znflow
Expand All @@ -27,7 +26,6 @@ class ConfigurationSelection(base.ProcessAtoms):

"""

_hash = zntrack.zn.outs()
exclude_configurations: typing.Union[
typing.Dict[str, typing.List[int]], base.protocol.HasSelectedConfigurations
] = zntrack.zn.deps(None)
Expand All @@ -47,7 +45,6 @@ def _post_init_(self):

def run(self):
"""ZnTrack Node Run method."""
self._hash = str(uuid.uuid4())
if self.exclude is not None:
if self.exclude_configurations is None:
self.exclude_configurations = {}
Expand Down
4 changes: 1 addition & 3 deletions ipsuite/data_loading/add_data_h5md.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Load Data directly from a H5MD trajectory file."""
import functools
import typing
import uuid

import ase
import h5py
Expand All @@ -15,11 +14,10 @@ class AddDataH5MD(base.IPSNode):
"""Load Data directly from a H5MD trajectory file."""

file = zntrack.dvc.deps()
_hash = zntrack.zn.outs()
_atoms = None

def run(self):
self._hash = str(uuid.uuid4()) # we must have an output
pass

@property
def atoms(self) -> typing.List[ase.Atoms]:
Expand Down
4,430 changes: 2,165 additions & 2,265 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ipsuite"
version = "0.1.0a3"
version = "0.1.0a4"
description = "A suite of tools for machine learned interatomic potentials."
authors = ["zincwarecode <[email protected]>"]
keywords = ["data-version-control", "machine-learning", "reproducibility", "interatomic potentials"]
Expand All @@ -9,12 +9,12 @@ readme = "README.md"

[tool.poetry.dependencies]
# tensorflow-io-gcs-filesystem
python = ">=3.10,<3.12"
python = ">=3.10,<3.11"
# temporary version constraints
libclang = "^15"

znh5md = "^0.1.6a0"
zntrack = "^0.6.0a5"
zntrack = "^0.6.3a1"

ase = "^3.22.1"

Expand All @@ -40,7 +40,7 @@ xmltodict = "^0.13.0"

nequip = { version = "^0.5.6", optional = true }
apax = { git = "https://github.com/apax-hub/apax.git", rev = "dev", optional = true}
rdkit = "^2022.9.5"
rdkit = "^2023"
lazy-loader = "^0.2"
znflow = "^0.1.11"

Expand Down
7 changes: 5 additions & 2 deletions tests/integration/calculators/apax_md_minimal.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
temperature: 1
duration: 2.5
n_inner: 1
duration: 3 #fs
n_inner: 1 # compiled innner steps
dt: 0.5 # fs
dr_threshold: 0.5 # Neighborlist skin
sampling_rate: 1
7 changes: 4 additions & 3 deletions tests/integration/configuration_selection/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
def test_direct_selection(proj_w_data, eager, data_style):
proj, data = proj_w_data

if eager:
for node in data:
node.load()
with proj:
if data_style == "lst":
_data = data
Expand All @@ -38,6 +35,10 @@ def test_direct_selection(proj_w_data, eager, data_style):
name="selection2",
)

if eager:
for node in data:
node.load()

proj.run(eager=eager)
if not eager:
selection.load()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_atomsuite.py → tests/test_ipsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

def test_version():
"""Test 'IPSuite' version."""
assert ips.__version__ == "0.1.0a3"
assert ips.__version__ == "0.1.0a4"


def test_node_imports():
Expand Down
Loading