graphnet icon indicating copy to clipboard operation
graphnet copied to clipboard

slow `predict_as_dataframe` function

Open sevmag opened this issue 5 months ago • 0 comments

The function:

https://github.com/graphnet-team/graphnet/blob/401f28b450e995cc567a70e83bb813757e9a4d63/src/graphnet/models/easy_model.py#L323

Can be really slow when querying for additional attributes, which is handled here:

https://github.com/graphnet-team/graphnet/blob/401f28b450e995cc567a70e83bb813757e9a4d63/src/graphnet/models/easy_model.py#L381-L397

In the prediction loop, we are already looping through the whole data. Can we think of a way to utilise that initial loop already to get additional attributes without looping through the dataloader again? I think the least we can do is put a progress bar in the second loop to let the user know that the program hasn't stalled (I was very confused at times, why does it take so long.?).

sevmag avatar Sep 15 '25 07:09 sevmag