Skip to content

Commit

Permalink
Format black
Browse files Browse the repository at this point in the history
  • Loading branch information
pyiron-runner committed Apr 15, 2024
1 parent 0f7ee74 commit 4107558
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pyiron_base/storage/flattenedstorage.py
Expand Up @@ -31,6 +31,7 @@

_CHARSIZE = np.dtype("U1").itemsize


def _ensure_str_array_size(array, strlen):
"""
Ensures that the given array can store at least string of length `strlen`.
Expand Down Expand Up @@ -943,7 +944,9 @@ def extend(self, other: "FlattenedStorage"):
name=k, dtype=dtype, shape=a.shape[1:], fill=fill, per="chunk"
)
elif a.dtype.char == "U":
self._per_chunk_arrays[k] = _ensure_str_array_size(self._per_chunk_arrays[k], a)
self._per_chunk_arrays[k] = _ensure_str_array_size(
self._per_chunk_arrays[k], a
)
self._per_chunk_arrays[k][self.num_chunks : combined_num_chunks] = a[
0 : other.num_chunks
]
Expand All @@ -955,7 +958,9 @@ def extend(self, other: "FlattenedStorage"):
name=k, shape=a.shape[1:], dtype=dtype, fill=fill, per="element"
)
elif a.dtype.char == "U":
self._per_element_arrays[k] = _ensure_str_array_size(self._per_element_arrays[k], a)
self._per_element_arrays[k] = _ensure_str_array_size(
self._per_element_arrays[k], a
)
self._per_element_arrays[k][self.num_elements : combined_num_elements] = a[
0 : other.num_elements
]
Expand Down

0 comments on commit 4107558

Please sign in to comment.