Skip to content
Snippets Groups Projects
Commit 1f5a6c6c authored by Theo Steininger's avatar Theo Steininger
Browse files

Fixed infer_dtype in Field

parent 6c70837a
No related branches found
No related tags found
1 merge request!78Multi power synth
Pipeline #
......@@ -90,9 +90,11 @@ class Field(Loggable, Versionable, object):
try:
dtype = val.dtype
except AttributeError:
if val is not None:
try:
if val is None:
raise TypeError
dtype = np.result_type(val)
else:
except(TypeError):
dtype = np.dtype(gc['default_field_dtype'])
else:
dtype = np.dtype(dtype)
......@@ -307,6 +309,9 @@ class Field(Loggable, Versionable, object):
# check if the `spaces` input is valid
spaces = utilities.cast_axis_to_tuple(spaces, len(self.domain))
if spaces is None:
spaces = range(len(self.domain))
for power_space_index in spaces:
power_space = self.domain[power_space_index]
if not isinstance(power_space, PowerSpace):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment