phoebe-project/phoebe1

requesting only a mesh (without an LC) from legacy backend fails

Closed this issue · 5 comments

import phoebe

b = phoebe.default_binary()

b.add_dataset('mesh', times=[0,0.25])

b.add_compute('legacy')
b.run_compute(kind='legacy')

throws the following error at run_compute:

the curve you are trying to compute is not initialized.
Traceback (most recent call last):
  File "test_58.py", line 8, in <module>
    b.run_compute(kind='legacy')
  File "/home/kyle/.local/lib/python2.7/site-packages/phoebe/parameters/parameters.py", line 203, in _send_if_client
    return fctn(self, *args, **kwargs)
  File "/home/kyle/.local/lib/python2.7/site-packages/phoebe/frontend/bundle.py", line 3172, in run_compute
    params = compute_class().run(self, compute, times=times, **kwargs)
  File "/home/kyle/.local/lib/python2.7/site-packages/phoebe/backend/backends.py", line 425, in run
    rpacketlists_per_worker = [self._run_chunk(**packet)]
  File "/home/kyle/.local/lib/python2.7/site-packages/phoebe/backend/backends.py", line 515, in _run_chunk
    packetlist = self._run_single_dataset(b, info, **worker_setup_kwargs)
  File "/home/kyle/.local/lib/python2.7/site-packages/phoebe/backend/backends.py", line 1345, in _run_single_dataset
    flux, mesh = phb1.lc((time,), 0, True)
SystemError: error return without exception set

If this isn't feasible to support for some reason, then we should at least provide an informative error message.

aprsa commented

Indeed, meshes in legacy are computed as part of the actual observable (lc, rv, lp, ...) and not by itself, so this is not a native operation that we can support out of the box. It should be relatively straight-forward for the wrapper to create a mock observable under the hood and deliver only the mesh. Alternatively I could implement that workaround in the legacy directly, but that is more complicated than in the wrapper. @bpablo, any thoughts?

This shouldn't be too difficult. If something is computed without times, then I suppose we could fill one in. What does phoebe 2.0 default to? Presumably we should use the same. How many people would we expect to ever use this feature?

As of 2.1, there are only mesh datasets, with times explicitly defined. So the wrapper just needs to fill the mesh (without any dataset columns) at those times by faking an observable if necessary. It would be nice to fill any non-dataset columns (teffs, loggs, etc) that are available from legacy, we'll just need to check to see if the column exists in the model PS or not, as these are now all optionally added according to the 'columns' Parameter in the dataset.

So maybe we could calculate RVs as they are less expensive? I believe they provide the necessary mesh elements. that being said I would have to look at how things are currently handled. I don't know how legacy treats mesh datasets , especially since it sounds like there is a difference with respect to previous versions.

aprsa commented