Intraday Pipeline?

Is there a way to incorporate intraday data into pipeline calculations? For example, consider the following hypothetical custom factor:

class ComputeWMA10(CustomFactor):
    inputs = [USEquityPricing.close, data.current]
    window_length = 9    
    def compute(self, today, assets, out, close, current):
        intraday_hist = np.append(close[0:], current) # Append last 9 days of history with current price to get len(10) array
        weights = np.arange(1,11) # Get weights 1-10
        wma10 = pd.Series(intraday_hist).rolling(10).apply(lambda prices: np.dot(prices, weights)/weights.sum(), raw=True).iloc[-1]
        out[:] = wma10

This takes data.current() and appends it to a window of last prices, with the idea being it could be run just prior to market close to get as close as possible to close-to-close performance. The first challenge here is that neither context nor data are passed to custom factors within the traditional zipline algorithm structure. The second is that there are other arguments passed to data.current() - e.g. "price".

For simple factors, the pipeline output can be appended with a new column - for example:

assets = pipe_results.index
pipe_results['current'] = data.current(assets, 'price')

The factor could then be backed into to include the current price. For a 20 Day SMA factor you would take the ((SMA20 * 19) + Current)/20. However, for more complex factors like the WMA factor above, this cannot be done.

Has anybody come up with a solution to incorporate pipeline results intraday?

Figured it out, and the solution is to bypass Pipeline altogether for any calculations that need to be made intraday, and calculate factors on the price dataframe.

    pipe_results = pipeline_output('pipeline')
    assets = pipe_results.index
    hist = data.history(assets, "close", 201, "1d").T
    current_hist = data.history(assets, "close", 1, "1m").T
    hist_all = pd.merge(hist, current_hist, left_index=True, right_index=True, how='left')

If there are any differences with how historical returns are handled between pipeline and data.hist(), or if I've overlooked something else, please let me know. Obviously this is slower, but it seems to work.