Commit 00c00c45 authored by Martin Bauer's avatar Martin Bauer
Browse files

Merge branch 'AssignmentCollection.__bool__' into 'master'

AssignmentCollection.__bool__

See merge request !108
parents 01cdfa64 fbf1ec12
Pipeline #20566 passed with stages
in 3 minutes and 30 seconds
......@@ -16,6 +16,7 @@ def create_cuda_kernel(assignments,
ghost_layers=None,
skip_independence_check=False,
use_textures_for_interpolation=True):
assert assignments, "Assignments must not be empty!"
fields_read, fields_written, assignments = add_types(assignments, type_info, not skip_independence_check)
all_fields = fields_read.union(fields_written)
read_only_fields = set([f.name for f in fields_read - fields_written])
......
from types import MappingProxyType
from itertools import combinations
from types import MappingProxyType
import sympy as sp
......@@ -74,6 +74,7 @@ def create_kernel(assignments,
[0., 0., 0., 0., 0.]])
"""
# ---- Normalizing parameters
assert assignments, "Assignments must not be empty!"
split_groups = ()
if isinstance(assignments, AssignmentCollection):
if 'split_groups' in assignments.simplification_hints:
......
......@@ -404,6 +404,9 @@ class AssignmentCollection:
def __eq__(self, other):
return set(self.all_assignments) == set(other.all_assignments)
def __bool__(self):
return bool(self.all_assignments)
class SymbolGen:
"""Default symbol generator producing number symbols ζ_0, ζ_1, ..."""
......
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