Skip to content

Commit

Permalink
use n_cores // 2 when reading files from zip archives
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed May 18, 2023
1 parent c532ba8 commit 20659c2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions navis/io/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ def read_any_multi(
Whether to include subdirectories of a given
directory.
parallel : str | bool | int | None
"auto" or True for n_cores - 2, otherwise int for
"auto" or True for n_cores // 2, otherwise int for
number of jobs, or False for serial.
attrs : dict or None
Arbitrary attributes to include in each TreeNeuron
Expand Down Expand Up @@ -828,7 +828,7 @@ def parallel_read_zip(read_fn, fpath, file_ext,
limit : int, optional
Limit the number of files read from this directory.
parallel : str | bool | int
"auto" or True for n_cores - 2, otherwise int for number of
"auto" or True for n_cores // 2, otherwise int for number of
jobs, or false for serial.
ignore_hidden : bool
Archives zipped on OSX can end up containing a
Expand Down Expand Up @@ -882,7 +882,7 @@ def parallel_read_zip(read_fn, fpath, file_ext,
if parallel:
# Do not swap this as ``isinstance(True, int)`` returns ``True``
if isinstance(parallel, (bool, str)):
n_cores = max(1, os.cpu_count() - 2)
n_cores = max(1, os.cpu_count() // 2)
else:
n_cores = int(parallel)

Expand Down

0 comments on commit 20659c2

Please sign in to comment.