Format flags and local directory for dask worker preload.
Convenience function that optionally accepts unformatted PyRosetta command
line flags as the `init_flags` option, and a working directory for dask
worker processes to output files as the `local_directory` option, which are
then formatted into a dask worker process extra commands list. If
`init_flags` is not specified, PyRosetta is initialized on the dask worker
process without command line flags. If `local_directory` is not specified,
the dask worker default directory ./dask-worker-space is used.
For example, to execute on a SLURM scheduler via dask_jobqueue:
from dask_jobqueue import SLURMCluster
import pyrosetta.distributed.dask
cluster = SLURMCluster(
cores=1,
processes=1,
memory="4GB",
extra=pyrosetta.distributed.dask.worker_extra(init_flags, local_directory)
)
References pyrosetta.distributed._normflags(), and pyrosetta.tests.distributed.test_dask.format.
Referenced by pyrosetta.tests.distributed.test_dask_worker.TestDaskArgs.test_worker_extra().