Skip to content

Commit 4126160

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 40b8baf commit 4126160

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

znh5md/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""ZnH5MD: High Performance Interface for H5MD Trajectories."""
2+
23
import contextlib
34
import importlib.metadata
45

znh5md/format/__init__.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Format handler for h5md files."""
2+
23
import contextlib
34
import dataclasses
45
import typing
@@ -33,16 +34,14 @@ class GRP:
3334

3435
@staticmethod
3536
def encode_boundary(value) -> np.ndarray:
36-
return np.array(
37-
[
38-
(
39-
"periodic".encode(encoding="utf-8")
40-
if x
41-
else "none".encode(encoding="utf-8")
42-
)
43-
for x in value
44-
]
45-
)
37+
return np.array([
38+
(
39+
"periodic".encode(encoding="utf-8")
40+
if x
41+
else "none".encode(encoding="utf-8")
42+
)
43+
for x in value
44+
])
4645

4746
@staticmethod
4847
def decode_boundary(value) -> np.ndarray:

znh5md/io/base.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ def append_to_dataset(self, dataset_group: h5py.Group):
9999
self.resize_by_particle_count(dataset_group)
100100
for key in ("value", "time", "step"):
101101
dataset_group[key].resize(n_current_frames + len(self), axis=0)
102-
dataset_group[key][:] = np.concatenate(
103-
[dataset_group[key][:n_current_frames], self.value]
104-
)
102+
dataset_group[key][:] = np.concatenate([
103+
dataset_group[key][:n_current_frames], self.value
104+
])
105105

106106

107107
@dataclasses.dataclass
@@ -124,9 +124,9 @@ def append_to_dataset(self, dataset_group: h5py.Group):
124124

125125
self.resize_by_particle_count(dataset_group)
126126
dataset_group["value"].resize(n_current_frames + len(self), axis=0)
127-
dataset_group["value"][:] = np.concatenate(
128-
[dataset_group["value"][:n_current_frames], self.value]
129-
)
127+
dataset_group["value"][:] = np.concatenate([
128+
dataset_group["value"][:n_current_frames], self.value
129+
])
130130

131131

132132
CHUNK_DICT = typing.Dict[str, ExplicitStepTimeChunk]

znh5md/io/reader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@ def yield_chunks(self) -> typing.Iterator[typing.Dict[str, FixedStepTimeChunk]]:
224224
if "energy" in frame.list_properties():
225225
energy.append(np.copy(frame["energy"]).astype(float))
226226
if "pbc" in frame.list_properties():
227-
pbc.append(
228-
[True if x == "T" else False for x in frame["pbc"].split()]
229-
)
227+
pbc.append([
228+
True if x == "T" else False for x in frame["pbc"].split()
229+
])
230230

231231
if len(positions) == self.frames_per_chunk:
232232
positions = self._fill_with_nan(positions).astype(float)

0 commit comments

Comments
 (0)