-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
always cast
atoms.arrays
to numpy (#162)
* always cast `atoms.arrays` to numpy * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * remove comment * update test * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b052fd6
commit ed78db8
Showing
5 changed files
with
30 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "znh5md" | ||
version = "0.4.2" | ||
version = "0.4.3" | ||
description = "ASE Interface for the H5MD format." | ||
authors = ["zincwarecode <[email protected]>"] | ||
license = "Apache-2.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import numpy as np | ||
import numpy.testing as npt | ||
import rdkit2ase | ||
|
||
import znh5md | ||
|
||
|
||
def test_pdb_repeat(tmp_path): | ||
water = rdkit2ase.smiles2conformers(smiles="O", numConfs=1)[0] | ||
water.arrays["atomtypes"] = np.array(["H", "O", "H"]) | ||
assert isinstance(water.arrays["atomtypes"], np.ndarray) | ||
|
||
io = znh5md.IO(tmp_path / "test.h5") | ||
io.append(water) | ||
|
||
atoms = io[0] | ||
assert isinstance(atoms.arrays["atomtypes"], np.ndarray) | ||
npt.assert_array_equal(atoms.arrays["atomtypes"], water.arrays["atomtypes"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters