Skip to content

Commit

Permalink
Set locale so that numba will compile correctly in other locales. (fi…
Browse files Browse the repository at this point in the history
…x for issue #28)
  • Loading branch information
lmcinnes committed Nov 28, 2017
1 parent 8d305cd commit 34425ea
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions umap/sparse.py
Expand Up @@ -14,6 +14,9 @@
rejection_sample,
build_candidates)

import locale

locale.setlocale(locale.LC_NUMERIC, 'C')

# Just reproduce a simpler version of numpy unique (not numba supported yet)
@numba.njit()
Expand Down
6 changes: 4 additions & 2 deletions umap/umap_.py
Expand Up @@ -24,6 +24,10 @@
rejection_sample,
build_candidates)

import locale

locale.setlocale(locale.LC_NUMERIC, 'C')

INT32_MIN = np.iinfo(np.int32).min + 1
INT32_MAX = np.iinfo(np.int32).max - 1

Expand All @@ -32,8 +36,6 @@
NPY_INFINITY = np.inf




@numba.njit()
def random_projection_cosine_split(data, indices, rng_state):
"""Given a set of ``indices`` for data points from ``data``, create
Expand Down

0 comments on commit 34425ea

Please sign in to comment.