Skip to content

Commit

Permalink
LookupNdBuilder: second try to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
schlegelp committed Jun 4, 2022
1 parent 895b918 commit 7175929
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions navis/nbl/smat.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,11 @@ def _get_pairs(self):
return matching_pairs, nonmatching_pairs

def _build(self, threads, cache=False) -> Tuple[List[Digitizer], np.ndarray]:
# Asking for more threads than available CPUs seems to crash on Github
# actions
if threads and threads >= cpu_count:
threads = cpu_count

if self.digitizers is None and self.bin_counts is None:
raise ValueError(
"Builder needs either digitizers or bin_counts; see with_* methods"
Expand Down Expand Up @@ -362,11 +367,6 @@ def build(self, threads=None, cache=False) -> LookupNd:
-------
LookupNd
"""
# Asking for more threads than available CPU seems so crash on Github
# actions
if threads and threads >= cpu_count:
threads = cpu_counts

dig, cells = self._build(threads, cache)
return LookupNd(dig, cells)

Expand Down

0 comments on commit 7175929

Please sign in to comment.