diff options
-rw-r--r-- | boltzgen/kernel/generator.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/boltzgen/kernel/generator.py b/boltzgen/kernel/generator.py index 5853561..42d0430 100644 --- a/boltzgen/kernel/generator.py +++ b/boltzgen/kernel/generator.py @@ -1,6 +1,7 @@ import sympy from mako.template import Template + from pathlib import Path class Generator: @@ -11,7 +12,11 @@ class Generator: self.boundary = boundary def kernel(self, target, precision, geometry): - return Template(filename = str(Path(__file__).parent/('template/basic.' + target + '.mako'))).render( + template_path = Path(__file__).parent/('template/basic.' + target + '.mako') + if not template_path.exists(): + raise Exception("Target '%s' not supported" % target) + + return Template(filename = str(template_path)).render( descriptor = self.descriptor, geometry = geometry, |