danielapai / bioverse

A simulation framework to assess the statistical power of future biosignature surveys
MIT License
7 stars 5 forks source link

test_hypothesis_grid: Interrupted, terminating remaining processes, ValueError: no formula defined #49

Open kevinkhu opened 5 months ago

kevinkhu commented 5 months ago

When running test_hypothesis_grid, it successfully gets through several iterations (in this case 10%), then crashes. The "Interrupted, terminating remaining processes" line is part of a try/except statement in the test_hypothesis_grid function. The formula for has_O2 is defined in my custom GroundImagingSurvey module. I wonder if we can get around this issue by somehow skipping and retrying this iteration with a different input set since it infrequently fails like this.

10%|████████████████ | 49/500 [6:29:29<59:44:55, 476.93s/it]

Interrupted, terminating remaining processes

multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/home/kevin/anaconda3/lib/python3.11/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/home/kevin/Python/bioverse/bioverse/analysis.py", line 110, in test_hypothesis_grid_iter
    results = h.fit(data, return_chains=return_chains, method=method, nlive=nlive, mw_alternative=mw_alternative)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kevin/Python/bioverse/bioverse/hypothesis.py", line 256, in fit
    X, Y, sigma = self.get_XY(data)
                  ^^^^^^^^^^^^^^^^^
  File "/home/kevin/Python/bioverse/bioverse/hypothesis.py", line 195, in get_XY
    data.compute(key)
  File "/home/kevin/Python/bioverse/bioverse/classes.py", line 313, in compute
    raise ValueError("no formula defined for {:s}".format(key))
ValueError: no formula defined for has_O2
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/kevin/Python/bioverse/bioverse/analysis.py", line 51, in test_hypothesis_grid
    res = procs[idx].get()
          ^^^^^^^^^^^^^^^^
  File "/home/kevin/anaconda3/lib/python3.11/multiprocessing/pool.py", line 774, in get
    raise self._value
ValueError: no formula defined for has_O2