Unable to use 'read_from_msh'

I am trying to convert the following dolfin code to dolfinx

mesh = Mesh()
mvc_2d = MeshValueCollection("size_t", mesh, 2)
with XDMFFile("mesh_1.xdmf") as infile:
    infile.read(mesh)
    infile.read(mvc_2d, "name_to_read")
cell_markers = cpp.mesh.MeshFunctionSizet(mesh, mvc_2d)
boundary_markers = MeshFunction("size_t", mesh, mesh.topology().dim() - 1)
domains = MeshFunction("size_t", mesh, mesh.topology().dim())
dx = Measure("dx",domain=mesh, subdomain_data=cell_markers)
ds = Measure("ds",domain=mesh, subdomain_data=boundary_markers)

I am able to save and read the xdmf file

with dolfinx.io.XDMFFile(MPI.COMM_WORLD,'mesh_1.xdmf','r') as xdmf:
    msh = xdmf.read_mesh(name="Grid")
from dolfinx.io import gmshio
rve_mesh, cell_tags, facet_tags = gmshio.read_from_msh("/mnt/c/Users/ABC/sfepy/simplerve.msh", MPI.COMM_WORLD,gdim=2)

However when I try to execute the last 2 lines, I get

AttributeError: module ‘dolfinx.io.gmshio’ has no attribute ‘read_from_msh’

I was trying to follow the instructions given here

To use gmshio you need to have gmsh (and its python API) installed.
You can see this in the source code at: dolfinx/gmshio.py at main · FEniCS/dolfinx · GitHub

Yes, Thank You. I missed that part initially.

I have another query,
Is

rve_mesh, cell_tags, facet_tags = gmshio.read_from_msh("/mnt/c/Users/ABC/sfepy/simplerve.msh", MPI.COMM_WORLD,gdim=2)

the same as

cell_markers = cpp.mesh.MeshFunctionSizet(mesh, mvc_2d)

because 'read_from_msh 'doesn’t have an array attribute, but I want an array of physical tag of every cell, which is what cell_markers is doing in the dolfin code. But ‘read_from_msh’ does return the cell_markers associated with the physical tags, which is what I want

I had a look at ‘extract_topology_and_markers’, but that appears to accept only gmsh models, not .msh files

Thanks in advance

cell_tags is what cell_markers was (more or less, as it is closer to mvc_2d)

Then how do I get the array?
print(cell_markers.array() used to print an array of the physical tags, and plot(cell_markers) used to plot subdomains. How can I use cell_tags to do the same?
Printing cell_tags just gives, what I think is a memory location.

<dolfinx.cpp.mesh.MeshTags_int32 object at 0x7ff070e428f0>

print(meshio.read("path to file").cell_data_dict["gmsh:physical"]["triangle"])
does give me such an array, but I’m unsure of how to use it further

cell_tags is a dolfinx.fem.MeshTags<std::int32> object.
This object has several properties, including
cell_tags.indices and cell_tags.values, where indices gives you the list of entities (local to process) whose ith entry map to the ith entry in cell_tags.values.

For plotting see for instance:
https://jorgensd.github.io/dolfinx-tutorial/chapter3/em.html#meshing-a-complex-structure-with-subdomains
or dolfinx/demo_pyvista.py at main · FEniCS/dolfinx · GitHub