Skip to content
Snippets Groups Projects
Commit 245e8331 authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Add dtype to DataHandling.add_arrays

parent 99d4b9fc
No related merge requests found
......@@ -62,7 +62,7 @@ class DataHandling(ABC):
pystencils field, that can be used to formulate symbolic kernels
"""
def add_arrays(self, description: str) -> Tuple[Field]:
def add_arrays(self, description: str, dtype=np.float64) -> Tuple[Field]:
"""Adds multiple arrays using a string description similar to :func:`pystencils.fields`
......@@ -77,6 +77,7 @@ class DataHandling(ABC):
Args:
description (str): String description of the fields to add
dtype: data type of the array as numpy data type
Returns:
Fields representing the just created arrays
"""
......@@ -85,7 +86,7 @@ class DataHandling(ABC):
names = []
for name, indices in _parse_part1(description):
names.append(name)
self.add_array(name, values_per_cell=indices)
self.add_array(name, values_per_cell=indices, dtype=dtype)
return (self.fields[n] for n in names)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment