Skip to content
Snippets Groups Projects
Commit 00c00c45 authored by Martin Bauer's avatar Martin Bauer
Browse files

Merge branch 'AssignmentCollection.__bool__' into 'master'

AssignmentCollection.__bool__

See merge request pycodegen/pystencils!108
parents 01cdfa64 fbf1ec12
No related branches found
No related tags found
1 merge request!108AssignmentCollection.__bool__
Pipeline #20566 passed
......@@ -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, ..."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment