To make the pastry put the flour, butter, almonds, sugar, baking powder and salt in a food processor and blitz briefly until the mixture resembles fine breadcrumbs. Add the egg yolk and pulse again until the mixture starts to come together. Press into a ball with your hands and flatten into a disc, then wrap in cling film and chill for 45 minutes.
Meanwhile, make the filling. Put the rhubarb in a saucepan with the sugar, vanilla paste and a splash of water. Simmer over a medium heat for 15 minutes, or until the rhubarb is tender. Drain the liquid reserving the rhubarb.
Roll out two-thirds of the pastry on a floured work surface to a circle around 25cm in diameter. Line the pie dish with the pastry, leaving a small rim around the edge, and trim away any excess. If the pastry cracks, simply patch up the gaps with another small piece of pastry. Chill for 25 minutes.
Pre-heat the oven to 200C (180C fan). Line the pastry case with a piece of greaseproof paper and fill with baking beans. Bake for 15 minutes, then remove the paper and beans and cook for another 5 minutes, until the pastry is golden and slightly dry. Remove from the oven and leave to cool for a few minutes (this helps prevent a soggy bottom!).
Mix the drained rhubarb with the cornflour and berries, if using. Pour into the pie dish. Roll out the remaining pastry into a circle around 23cm in diameter, then slice it into thin strips (around 1cm wide). Arrange these in a lattice pattern over the top of the pie. Lay one strip over the top, then another at a right angle to the first, pressing each strip down into the pastry rim at the ends. Continue until you have covered the pie, leaving a gap of around 2cm between each strip (they will expand when baked). Don’t worry if it’s not very neat, it will still look lovely when baked!
Bake for 20 minutes until the pastry is golden and the fruit is bubbling. Remove from the oven and leave to cool slightly, before serving with cream or ice cream.