dacapo.gp.dacapo_points_source ============================== .. py:module:: dacapo.gp.dacapo_points_source Classes ------- .. autoapisummary:: dacapo.gp.dacapo_points_source.GraphSource Module Contents --------------- .. py:class:: GraphSource(key: gunpowder.GraphKey, graph: gunpowder.Graph) A provider for serving graph data in gunpowder pipelines. The Graph Source loads a single graph to serve to the pipeline based on ROI requests it receives. .. attribute:: key The key of the graph to be served. :type: gp.GraphKey .. attribute:: graph The graph to be served. :type: gp.Graph .. method:: setup() Set up the provider. .. method:: provide(request) Provides the graph for the requested ROI. .. note:: This class is a subclass of gunpowder.BatchProvider and is used to serve graph data to gunpowder pipelines. .. py:attribute:: key .. py:attribute:: graph .. py:method:: setup() Set up the provider. This function sets the provider to provide the graph with the given key. :raises RuntimeError: If the key is already provided. .. rubric:: Examples >>> graph_source.setup() .. py:method:: provide(request) Provides the graph for the requested ROI. This method will be passively called by gunpowder to get a batch. Depending on the request we provide a subgraph of our data, or nothing at all. :param request: BatchRequest with the same ROI for :type request: gp.BatchRequest :param each requested array and graph.: :returns: The graph contained in a Batch. :rtype: outputs (gp.Batch) :raises KeyError: If the requested key is not in the request. .. rubric:: Examples >>> request = gp.BatchRequest() >>> request[gp.GraphKey("GRAPH")] = gp.GraphSpec(roi=gp.Roi((0, 0, 0), (1, 1, 1))) >>> graph_source.provide(request)