Skip to content

Commit

Permalink
add supported formats to README
Browse files Browse the repository at this point in the history
  • Loading branch information
PythonFZ committed Dec 5, 2024
1 parent aaa128b commit 1b3c817
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 1 deletion.
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,47 @@ ZnH5MD circumvents two current limitations of the H5MD standard.
first frame. Using this feature will not typically not break ompatibility with
other H5MD tools but can lead to unexpected behaviour.

## Supported

### `atoms.arrays`

| | ZnH5MD |
| ------------- | ------------- |
| `dict[str, np.ndarray]` ||
| `dict[str, list]` ||

### `atoms.info`

| | ZnH5MD |
| ------------- | ------------- |
| `dict[str, np.ndarray]` ||
| `dict[str, float]` ||
| `dict[str, int]` ||
| `dict[str, str]` ||
| `dict[str, dict]` ||
| `dict[str, list[float]` ||
| `dict[str, list[int]` ||
| `dict[str, list[str]` ||
| `dict[str, list[np.ndarray]` ||
| `dict[str, list[dict]` ||

### `atoms.calc.results`

| | ZnH5MD |
| ------------- | ------------- |
| `dict[str, np.ndarray]` ||
| `dict[str, float]` ||
| `dict[str, int]` ||
| `dict[str, str]` ||
| `dict[str, dict]` ||
| `dict[str, list[float]` ||
| `dict[str, list[int]` ||
| `dict[str, list[str]` ||
| `dict[str, list[np.ndarray]` ||
| `dict[str, list[dict]` ||



## Current limitations

This is a not necessarily complete list of Limitations that will be fixed
Expand Down
18 changes: 17 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,16 @@ def s22_info_arrays_calc() -> list[ase.Atoms]:
"mlip_stress": np.random.rand(6),
"collection": "s22",
"metadata": {"author": "Jane Doe", "date": "2021-09-01"},
"lst": [1, 2, 3],
# "lst_str": ["Jane Doe", "John Doe"],
# "lst_array": [np.random.rand(3), np.random.rand(3)],
}
)
atoms.new_array("mlip_forces", np.random.rand(len(atoms), 3))
atoms.new_array("mlip_forces_2", np.random.rand(len(atoms), 3))
# atoms.arrays["arr_lst_arr"] = [np.random.rand(3) for _ in range(len(atoms))]
# atoms.arrays["arr_lst"] = [[1, 2, 3] for _ in range(len(atoms))]
# atoms.new_array("arr_str", np.array(["abc" for _ in range(len(atoms))]))
atoms.set_velocities(np.random.rand(len(atoms), 3))
calc = SinglePointCalculator(
atoms, energy=np.random.rand(), forces=np.random.rand(len(atoms), 3)
Expand All @@ -115,7 +121,17 @@ def s22_illegal_calc_results() -> list[ase.Atoms]:
for atoms in ase.collections.s22:
atoms.calc = SinglePointCalculator(atoms)
atoms.calc.results["mlip_energy"] = np.random.rand()

atoms.calc.results["dict"] = {"author": "Jane Doe", "date": "2021-09-01"}
atoms.calc.results["float"] = 3.14
atoms.calc.results["int"] = 42
atoms.calc.results["list"] = [1, 2, 3]
atoms.calc.results["str"] = '{"author": "Jane Doe", "date": "2021-09-01"}'
atoms.calc.results["list_array"] = [np.random.rand(3), np.random.rand(3)]
atoms.calc.results["list_str"] = ["Jane Doe", "John Doe"]
# atoms.calc.results["list_dict"] = [
# {"author": "Jane Doe", "date": "2021-09-01"},
# {"author": "John Doe", "date": "2021-09-02"},
# ]
images.append(atoms)
return images

Expand Down

1 comment on commit 1b3c817

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Write: Varying number of images

Write: Varying number of atoms

Read: Varying number of images

Read: Varying number of atoms

Please sign in to comment.