agatha.construct.dask_process_global module

This util is intended to be a universal initializer for all process-specific helper data that is loaded at the start of the construction process. This is only intended for expensive complex structures that must be loaded at startup, and we don’t want to reload each function call.

class agatha.construct.dask_process_global.LocalMockWorker

Bases: object

class agatha.construct.dask_process_global.WorkerPreloader

Bases: object

clear(worker)
get(key, worker)
Return type

Any

register(key, init)

Adds a global object to the preloader

Return type

None

setup(worker)
teardown(worker)
agatha.construct.dask_process_global.add_global_preloader(preloader, client=None)
Return type

None

agatha.construct.dask_process_global.clear()

Deletes all preloaded data. To be called following a ckpt.

Return type

None

agatha.construct.dask_process_global.get(key)

Gets a value from the global preloader

Return type

Any

agatha.construct.dask_process_global.get_global_preloader()
agatha.construct.dask_process_global.get_worker_lock()
agatha.construct.dask_process_global.safe_get_worker()