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

to satisfy the flake8 linter

parent 06aeddba
Pipeline #27124 passed with stage
in 17 minutes and 16 seconds
...@@ -44,14 +44,15 @@ def _fix_length_one_slices(slices): ...@@ -44,14 +44,15 @@ def _fix_length_one_slices(slices):
if slices.stop is not None and abs(slices.start - slices.stop) == 1: if slices.stop is not None and abs(slices.start - slices.stop) == 1:
return slices.start return slices.start
elif slices.stop is None and slices.start == -1: elif slices.stop is None and slices.start == -1:
return -1 # [-1:] also has length one return -1 # [-1:] also has length one
else: else:
return slices return slices
else: else:
return tuple(_fix_length_one_slices(s) for s in slices) return tuple(_fix_length_one_slices(s) for s in slices)
def get_communication_slices(stencil, comm_stencil=None, streaming_pattern='pull', after_timestep='both', ghost_layers=1): def get_communication_slices(
stencil, comm_stencil=None, streaming_pattern='pull', after_timestep='both', ghost_layers=1):
""" """
Return the source and destination slices for periodicity handling or communication between blocks. Return the source and destination slices for periodicity handling or communication between blocks.
...@@ -153,4 +154,4 @@ class PeriodicityHandling: ...@@ -153,4 +154,4 @@ class PeriodicityHandling:
arr[dst] = arr[src] arr[dst] = arr[src]
def _periodicity_handling_gpu(self, timestep): def _periodicity_handling_gpu(self, timestep):
raise NotImplementedError() raise NotImplementedError()
\ No newline at end of file
...@@ -39,11 +39,13 @@ def get_accessor(streaming_pattern, timestep) -> PdfFieldAccessor: ...@@ -39,11 +39,13 @@ def get_accessor(streaming_pattern, timestep) -> PdfFieldAccessor:
else: else:
return odd_accessors[streaming_pattern] return odd_accessors[streaming_pattern]
def is_inplace(streaming_pattern): def is_inplace(streaming_pattern):
if streaming_pattern not in streaming_patterns: if streaming_pattern not in streaming_patterns:
raise ValueError('Invalid streaming pattern', streaming_pattern) raise ValueError('Invalid streaming pattern', streaming_pattern)
return streaming_pattern in ['aa', 'esotwist'] return streaming_pattern in ['aa', 'esotwist']
def numeric_offsets(field_access: ps.Field.Access): def numeric_offsets(field_access: ps.Field.Access):
return tuple(int(o) for o in field_access.offsets) return tuple(int(o) for o in field_access.offsets)
......
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