Commit 4dbfec46 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

small tweaks

parent abd52d28
...@@ -616,9 +616,9 @@ class Field(object): ...@@ -616,9 +616,9 @@ class Field(object):
if np.isscalar(spaces): if np.isscalar(spaces):
return self.domain[spaces].scalar_weight() return self.domain[spaces].scalar_weight()
res = 1.
if spaces is None: if spaces is None:
spaces = range(len(self.domain)) spaces = range(len(self.domain))
res = 1.
for i in spaces: for i in spaces:
tmp = self.domain[i].scalar_weight() tmp = self.domain[i].scalar_weight()
if tmp is None: if tmp is None:
...@@ -723,7 +723,7 @@ class Field(object): ...@@ -723,7 +723,7 @@ class Field(object):
Returns Returns
------- -------
norm : scalar norm : float
The L2-norm of the field values. The L2-norm of the field values.
""" """
......
...@@ -99,12 +99,12 @@ def cast_axis_to_tuple(axis, length=None): ...@@ -99,12 +99,12 @@ def cast_axis_to_tuple(axis, length=None):
def parse_domain(domain): def parse_domain(domain):
from .domain_object import DomainObject from .domain_object import DomainObject
if domain is None: if domain is None:
domain = () return ()
elif isinstance(domain, DomainObject): if isinstance(domain, DomainObject):
domain = (domain,) return (domain,)
elif not isinstance(domain, tuple):
domain = tuple(domain)
if not isinstance(domain, tuple):
domain = tuple(domain)
for d in domain: for d in domain:
if not isinstance(d, DomainObject): if not isinstance(d, DomainObject):
raise TypeError( raise TypeError(
......
Markdown is supported
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