You can probably move this function to the script, and there perform multiple calls to `compute_manifold`.