probcomp / cgpm

Library of composable generative population models which serve as the modeling and inference backend of BayesDB.
Apache License 2.0
25 stars 11 forks source link

Capture zero division error when all column data is nan #226

Open fsaad opened 7 years ago

fsaad commented 7 years ago
RuntimeError: Subprocess failed: Traceback (most recent call last):
  File "/scratch/fsaad/cgpm/cgpm/utils/parallel_map.py", line 50, in process_input
    ok, fx = True, f(x)
  File "/scratch/fsaad/cgpm/cgpm/crosscat/engine.py", line 37, in _intialize
    state = State(X, rng=gu.gen_rng(seed), **kwargs)
  File "/scratch/fsaad/cgpm/cgpm/crosscat/state.py", line 92, in __init__
    self.crp.transition_hyper_grids([1]*self.n_cols())
  File "/scratch/fsaad/cgpm/cgpm/mixtures/dim.py", line 175, in transition_hyper_grids
    [x for x in X if not math.isnan(x)], n_grid=n_grid)
  File "/scratch/fsaad/cgpm/cgpm/primitives/crp.py", line 150, in construct_hyper_grids
    grids['alpha'] = gu.log_linspace(1./len(X), len(X), n_grid)
ZeroDivisionError: float division by zero