2.82+: How to use fluid.bakeData() in python code Before Mantaflow (2.82+), we were able to bake smoke sims with custom python code like follows:

o = bpy.context.selected_objects[0]
c = {}
c['point_cache'] = o.modifiers['Smoke'].domain_settings.point_cache
bpy.ops.ptcache.bake(c, bake=True)


o in this case is the selected object (Smoke Domain), while c is a custom context supplied to the op. Now with Mantaflow, I've tried the following, which causes Blender to crash:

o = bpy.context.selected_objects[0]
c = {}
c['point_cache'] = o.modifiers['Fluid'].domain_settings.point_cache
bpy.ops.fluid.bake_data(c)


Resulting error isn't much help:

Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FF71D40835C
Module  : C:\Program Files\Blender Foundation\Blender 2.82\blender.exe


What is the correct way of calling fluid.bake_data() in custom python code?

Thanks for your help!
This works to an extent for me on an AWS GPU instance:
for scene in bpy.data.scenes:
for object in scene.objects:
    for modifier in object.modifiers:
        print(object.name, &quot; - modifier type: &quot;, modifier.type)
        if modifier.type == 'FLUID':
            print(object.name, &quot; - fuid_type: &quot;, modifier.fluid_type)
            if modifier.fluid_type == 'DOMAIN':
                print(&quot;Bake All: &quot;, object.name)
                bpy.ops.fluid.bake_all({'scene': scene, 'active_object': object})
                break

The problem I have is that I have three objects