Spherical mesh usage

I’m getting the following error when I try to assign a spherical mesh filter to the ‘tally.filters’ attribute.
‘TypeError: list indices must be integers or slices, not MeshFilter’

sphere_mesh_filter = openmc.MeshFilter(sphere_mesh)
sphere_mesh_tally = openmc.Tally(name=‘spherical-tally’)
sphere_mesh_tally.filters[sphere_mesh_filter]
sphere_mesh_tally.scores[‘total’]

Here’s the mesh creation code:
r_gen = np.arange(0,r3,1)
sphere_mesh = openmc.SphericalMesh(name=‘spherical-mesh’)
sphere_mesh.r_grid=r_gen

The mesh itself seems fine, its basically a numpy ndarray of indices.

Any suggestion would be much appreciated.

Looks close, perhaps try changing these parts

sphere_mesh_tally.filters[sphere_mesh_filter]
sphere_mesh_tally.scores['total']

to

sphere_mesh_tally.filters = [sphere_mesh_filter]
sphere_mesh_tally.scores = ['total']