Commit b1ee4c0b authored by Frederik Hennig's avatar Frederik Hennig
Browse files

now using f-strings!

parent 5c876796
Pipeline #26848 failed with stage
in 6 minutes and 4 seconds
......@@ -20,7 +20,7 @@ class AdvancedStreamingIndexing:
def proxy_fields(self):
q = len(self.stencil)
d = len(self.stencil[0])
return ps.fields('f_out({q}), f_in({q}): [{d}}]'.format(q=q, d=d))
return ps.fields(f"f_out({q}), f_in({q}): [{d}]")
def dir_symbol(self):
return TypedSymbol('dir', create_type(np.int64))
......@@ -84,13 +84,15 @@ class AdvancedStreamingIndexing:
def _index_array_symbol(self, f_dir, inverse, dir_symbol):
assert f_dir in ['in', 'out']
name = "f_{d}{inv}_dir_idx".format(d=f_dir, inv='_inv' if inverse else '')
inv = '_inv' if inverse else ''
name = f"f_{f_dir}{inv}_dir_idx"
self.required_arrays.add(name)
return sp.IndexedBase(name)[dir_symbol]
def _offset_array_symbols(self, f_dir, inverse, dir_symbol):
assert f_dir in ['in', 'out']
name_base = "f_{d}{inv}_offsets_".format(d=f_dir, inv='_inv' if inverse else '')
inv = '_inv' if inverse else ''
name_base = f"f_{f_dir}{inv}_offsets_"
names = [ name_base + d for d in self.directions ]
self.required_arrays |= set(names)
return [ sp.IndexedBase(n)[dir_symbol] for n in names ]
......
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