Can you comment on what result you expected and how the result you encountered is different?
If this is all in one script, and this is the entire contents, then I see several issues, which I will annotate below.
> s = gsd.hoomd.Snapshot()
> s.particles.N =2940
> s.particles.diameter = [150.0]
> s.configuration.box = [906.0,906.0,906.0,0,0,0]
> s.particles.typeid = [0]
> s.particles.position = np.linspace([2.0,2.0,2.0], [904.0,904.0,904.0], 2940)
>
>
You don't seem to do anything with the snapshot `s`, such as initializing a hoomd system from it.
> mc = hoomd.hpmc.integrate.sphere(seed=4552367,d=0.9,a=0)
> mc.shape_param.set ('A', diameter = 150, orientable = False)
>
The following line replaces the snapshot `s` with a file handle without having done anything with the previous `s`.
> s = gsd.hoomd.open(name='file_b.gsd', mode='wb')
Also, you open the file without ever explicitly closing it. Reassigning `s` should effectively accomplish closing the file, but it is better to close it explicitly. The best way to manage opening and closing a file is in a `with` block. See
https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-files for the pattern commonly used in Python.
You have already imported these. No need to import again.
>
> import gsd.hoomd
> import numpy as np
> import hoomd
> import hoomd.hpmc
>
The following line replaces `s`, closing the file without having written anything to it.
> s = gsd.hoomd.Snapshot()
> s.particles.N =2940
> s.particles.diameter = [150.0]
> s.configuration.box = [906.0,906.0,906.0,0,0,0]
> s.particles.typeid = [0]
> s.particles.position = np.linspace([2.0,2.0,2.0], [904.0,904.0,904.0], 2940)
>
Again, you haven't done anything with `s`, such as writing to a file or initializing a simulation from it.
I won't comment further, because this pattern basically repeats.
The GSD file you visualized has no content because you never wrote anything to the file.