I cannot remove member of a ListOfMembers()
in a group in an SBML file.
I try to remove some species of an sbml file. So I delet them, and store there IDs in a set removed_species
:
plugin = model.getPlugin("groups")
if plugin is not None:
for group in plugin.getListOfGroups():
for member in group.getListOfMembers():
if member.getIdRef() in removed_species:
group.removeMember(member.getIdRef())
Members are deleted in the last loop. I checked with print but when it come back at the group loop everything is like at the start.