Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Daniel Scheffler
py_tools_ds
Commits
8795c815
Commit
8795c815
authored
Mar 22, 2019
by
Daniel Scheffler
Browse files
Also include unittest in mp_alg overriding.
parent
92636c0d
Pipeline
#3813
passed with stages
in 1 minute and 9 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
py_tools_ds/geo/raster/reproject.py
View file @
8795c815
...
...
@@ -874,9 +874,10 @@ class SensorMapGeometryTransformer3D(object):
self
.
opts
[
'nprocs'
]
=
opts
.
get
(
'nprocs'
,
multiprocessing
.
cpu_count
())
self
.
mp_alg
=
(
'bands'
if
self
.
lons
.
shape
[
2
]
>=
opts
[
'nprocs'
]
else
'tiles'
)
if
mp_alg
==
'auto'
else
mp_alg
# override self.mp_alg if SensorMapGeometryTransformer3D is called by nosetest
s
# override self.mp_alg if SensorMapGeometryTransformer3D is called by nosetest
or unittest
is_called_by_nose
=
any
(
x
[
0
].
f_globals
[
'__name__'
].
startswith
(
'nose.'
)
for
x
in
inspect
.
stack
())
if
self
.
opts
[
'nprocs'
]
>
1
and
self
.
mp_alg
==
'bands'
and
is_called_by_nose
:
is_called_by_unittest
=
any
(
x
[
0
].
f_globals
[
'__name__'
].
startswith
(
'unittest.'
)
for
x
in
inspect
.
stack
())
if
self
.
opts
[
'nprocs'
]
>
1
and
self
.
mp_alg
==
'bands'
and
(
is_called_by_nose
or
is_called_by_unittest
):
warnings
.
warn
(
"mp_alg='bands' causes deadlocks if SensorMapGeometryTransformer3D is called within a "
"nosetest. Using mp_alg='tiles'."
)
self
.
mp_alg
=
'tiles'
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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