I’m still thinking it’s just as expensive as making the PR chart for average power.
Finding the maximum k-second average of a function is O(N), The average-power PR chart for a single ride is the k-second average for every value k. I don’t know offhand if there’s a clever way of making that cheaper than O(N^2). Regardless, TrainerRoad has some algorithm that they use, make_ride_pr_chart, that computes the maximum-averages PR chart R(k) from the ride power function P(t).
Computing the NP PR chart is the same problem. It’s just applied to a different function, Q(t) = [ smooth_30_sec( P(t) ) ]^4. If you apply make_ride_pr_chart to Q(t) instead of P(t), you get the NP PR chart. (After you do x^0.25 on the result.)