Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Frederik Hennig
lbmpy
Commits
06124196
Commit
06124196
authored
Oct 07, 2020
by
Frederik Hennig
Browse files
to satisfy the flake8 linter
parent
06aeddba
Pipeline
#27124
passed with stage
in 17 minutes and 16 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lbmpy/advanced_streaming/communication.py
View file @
06124196
...
...
@@ -44,14 +44,15 @@ def _fix_length_one_slices(slices):
if
slices
.
stop
is
not
None
and
abs
(
slices
.
start
-
slices
.
stop
)
==
1
:
return
slices
.
start
elif
slices
.
stop
is
None
and
slices
.
start
==
-
1
:
return
-
1
#
[-1:] also has length one
return
-
1
#
[-1:] also has length one
else
:
return
slices
else
:
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.
...
...
@@ -153,4 +154,4 @@ class PeriodicityHandling:
arr
[
dst
]
=
arr
[
src
]
def
_periodicity_handling_gpu
(
self
,
timestep
):
raise
NotImplementedError
()
\ No newline at end of file
raise
NotImplementedError
()
lbmpy/advanced_streaming/utility.py
View file @
06124196
...
...
@@ -39,11 +39,13 @@ def get_accessor(streaming_pattern, timestep) -> PdfFieldAccessor:
else
:
return
odd_accessors
[
streaming_pattern
]
def
is_inplace
(
streaming_pattern
):
if
streaming_pattern
not
in
streaming_patterns
:
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
):
return
tuple
(
int
(
o
)
for
o
in
field_access
.
offsets
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment