dynverse / ti_paga_tree

Other
0 stars 2 forks source link

more warnings from numba package #3

Open andynkili opened 2 years ago

andynkili commented 2 years ago

Hi,

Thank you for the dyno package with all those imbedded methods. I am trying to infer trajectory uising ti_paga_tree model <- infer_trajectory(dataset, ti_paga_tree(), give_priors = c('start_id','groups_id')) and ended up with that error:

Error: /usr/local/lib/python3.7/site-packages/umap/rp_tree.py:450: NumbaWarning: 
Compilation is falling back to object mode WITH looplifting enabled because Function "make_euclidean_tree" failed type inference due to: Cannot unify RandomProjectionTreeNode(array(int64, 1d, C), bool, none, none, none, none) and RandomProjectionTreeNode(none, bool, array(float32, 1d, C), float64, RandomProjectionTreeNode(array(int64, 1d, C), bool, none, none, none, none), RandomProjectionTreeNode(array(int64, 1d, C), bool, none, none, none, none)) for '$14.16', defined at /usr/local/lib/python3.7/site-packages/umap/rp_tree.py (457)

File "../../usr/local/lib/python3.7/site-packages/umap/rp_tree.py", line 457:
def make_euclidean_tree(data, indices, rng_state, leaf_size=30):
    <source elided>

        left_node = make_euclidean_tree(data, left_indices, rng_state, leaf_size)
        ^

[1] During: resolving callee type: recursive(type(CPUDispatcher(<function make_euclidean_tree at 0x7fc528d15f28>)))
[2] During: typing of call at /usr/local/lib/python3.7/site-packages/umap/rp_tree.py (457)

File "../../usr/local/lib/python3.7/site-packages/umap/rp_tree.py", line 457:
def make_euclidean_tree(data, indices, rng_state, leaf_size=30):
    <source elided>

        left_node = make_euclidean_tree(data, left_indices, rng_state, leaf_size)
        ^

  @numba.jit()
/usr/local/lib/python3.7/site-packages/numba/compiler.py:725: NumbaWarning: Function "make_euclidean_tree" was compiled in object mode without forceobj=True.

File "../../usr/local/lib/python3.7/site-packages/umap/rp_tree.py", line 451:
@numba.jit()
def make_euclidean_tree(data, indices, rng_state, leaf_size=30):
^

  self.func_ir.loc))
/usr/local/lib/python3.7/site-packages/umap/nndescent.py:92: NumbaPerformanceWarning: 
The keyword argument 'parallel=True' was specified but no transformation for parallel execution was possible.

To find out why, try turning on parallel diagnostics, see http://numba.pydata.org/numba-doc/latest/user/parallel.html#diagnostics for help.

File "../../usr/local/lib/python3.7/site-packages/umap/utils.py", line 409:
@numba.njit(parallel=True)
def build_candidates(current_graph, n_vertices, n_neighbors, max_candidates, rng_state):
^

  current_graph, n_vertices, n_neighbors, max_candidates, rng_state
/usr/local/lib/python3.7/site-packages/numba/compiler.py:588: NumbaPerformanceWarning: 
The keyword argument 'parallel=True' was specified but no transformation for parallel execution was possible.

To find out why, try turning on parallel diagnostics, see http://numba.pydata.org/numba-doc/latest/user/parallel.html#diagnostics for help.

File "../../usr/local/lib/python3.7/site-packages/umap/nndescent.py", line 47:
    @numba.njit(parallel=True)
    def nn_descent(
    ^

  self.func_ir.loc))
/usr/local/lib/python3.7/site-packages/umap/umap_.py:349: NumbaWarning: 
Compilation is falling back to object mode WITH looplifting enabled because Function "fuzzy_simplicial_set" failed type inference due to: Untyped global name 'nearest_neighbors': cannot determine Numba type of <class 'function'>

File "../../usr/local/lib/python3.7/site-packages/umap/umap_.py", line 467:
def fuzzy_simplicial_set(
    <source elided>
    if knn_indices is None or knn_dists is None:
        knn_indices, knn_dists, _ = nearest_neighbors(
        ^

  @numba.jit()
/usr/local/lib/python3.7/site-packages/numba/compiler.py:725: NumbaWarning: Function "fuzzy_simplicial_set" was compiled in object mode without forceobj=True.

File "../../usr/local/lib/python3.7/site-packages/umap/umap_.py", line 350:
@numba.jit()
def fuzzy_simplicial_set(
^

  self.func_ir.loc))
/usr/local/lib/python3.7/site-packages/rpy2/robjects/pandas2ri.py:62: UserWarning: Error while trying to convert the column "group_id". Fall back to string conversion. The error is: Converting pandas "Category" series to R factor is only possible when categories are strings.
  % (name, str(e)))
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/rpy2/robjects/pandas2ri.py", line 57, in py2rpy_pandasdataframe
    od[name] = conversion.py2rpy(values)
  File "/usr/local/lib/python3.7/functools.py", line 824, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/usr/local/lib/python3.7/site-packages/rpy2/robjects/pandas2ri.py", line 104, in py2rpy_pandasseries
    res = py2rpy_categoryseries(obj)
  File "/usr/local/lib/python3.7/site-packages/rpy2/robjects/pandas2ri.py", line 84, in py2rpy_categoryseries
    raise ValueError('Converting pandas "Category" series to '
ValueError: Converting pandas "Category" series to R factor is only possible when categories are strings.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/rpy2/rinterface_lib/sexp.py", line 361, in from_object
    mv = memoryview(obj)
TypeError: memoryview: a bytes-like object is required, not 'Series'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/code/run.py", line 157, in <module>
    branch_network = branch_network
  File "/usr/local/lib/python3.7/site-packages/dynclipy/dataset.py", line 19, in adder
    self.call_function_add(function, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/dynclipy/dataset.py", line 12, in call_function_add
    call_function(self.id, function, True, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/dynclipy/dataset.py", line 30, in call_function
    ro.globalenv["kwargs"] = ro.ListVector([[name, x] for name, x in kwargs.items()])
  File "/usr/local/lib/python3.7/site-packages/rpy2/robjects/vectors.py", line 630, in __init__
    kv = [(str(k), conversion.py2rpy(v)) for k, v in tlist]
  File "/usr/local/lib/python3.7/site-packages/rpy2/robjects/vectors.py", line 630, in <listcomp>
    kv = [(str(k), conversion.py2rpy(v)) for k, v in tlist]
  File "/usr/local/lib/python3.7/functools.py", line 824, in wrapper
    return dispatch(args[0].__class__)(*args, **kw)
  File "/usr/local/lib/python3.7/site-packages/rpy2/robjects/pandas2ri.py", line 63, in py2rpy_pandasdataframe
    od[name] = StrVector(values)
  File "/usr/local/lib/python3.7/site-packages/rpy2/robjects/vectors.py", line 379, in __init__
    super().__init__(obj)
  File "/usr/local/lib/python3.7/site-packages/rpy2/rinterface_lib/sexp.py", line 288, in __init__
    super().__init__(type(self).from_object(obj).__sexp__)
  File "/usr/local/lib/python3.7/site-packages/rpy2/rinterface_lib/sexp.py", line 365, in from_object
    res = cls.from_iterable(obj)
  File "/usr/local/lib/python3.7/site-packages/rpy2/rinterface_lib/conversion.py", line 28, in _
    cdata = function(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/rpy2/rinterface_lib/sexp.py", line 314, in from_iterable
    cast_in)
  File "/usr/local/lib/python3.7/site-packages/rpy2/rinterface_lib/sexp.py", line 239, in _populate_r_vector
    set_elt(r_vector, i, cast_value(v))
  File "/usr/local/lib/python3.7/site-packages/rpy2/rinterface_lib/sexp.py", line 424, in _as_charsxp_cdata
    return conversion._str_to_charsxp(x)
  File "/usr/local/lib/python3.7/site-packages/rpy2/rinterface_lib/conversion.py", line 120, in _str_to_charsxp
    cchar = _str_to_cchar(val)
  File "/usr/local/lib/python3.7/site-packages/rpy2/rinterface_lib/conversion.py", line 99, in _str_to_cchar
    b = s.encode(encoding)
AttributeError: 'int' object has no attribute 'encode'

The attribute error occured while catching the numba warnning, however I don't know how to fix it. Can someone help?

Best, Andy