Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ESPACE-DEV
pyrasta
Commits
763b7be1
Commit
763b7be1
authored
Jul 08, 2021
by
benjaminpillot
Browse files
Change Pool.map for Pool.imap (better with use of chunksize)
parent
35606f78
Changes
1
Hide whitespace changes
Inline
Side-by-side
pyrasta/tools/windows.py
View file @
763b7be1
...
...
@@ -55,11 +55,11 @@ def _windowing(raster, out_file, function, band, window_size,
int
(
len
(
window_generator
)
%
chunk_size
!=
0
),
desc
=
"Sliding window computation"
):
with
mp
.
Pool
(
processes
=
nb_processes
)
as
pool
:
output
=
np
.
asarray
(
list
(
pool
.
map
(
partial
(
_set_nan
,
function
=
function
,
no_data
=
raster
.
no_data
),
win_gen
,
chunksize
=
MP_CHUNK_SIZE
)))
output
=
np
.
asarray
(
list
(
pool
.
i
map
(
partial
(
_set_nan
,
function
=
function
,
no_data
=
raster
.
no_data
),
win_gen
,
chunksize
=
MP_CHUNK_SIZE
)))
output
[
np
.
isnan
(
output
)]
=
no_data
...
...
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