code: def purge_object(self, obj, deep=False):
          r
          if obj._isa() in ['physics', 'algorithm']:
              self._purge(obj)
          if obj._isa() == 'geometry':
              if deep:
                  physics = self.find_physics(geometry=obj)
                  for phys in physics:
                      self._purge(self.physics()[phys.name])
              self._purge(obj)
          if obj._isa() == 'phase':
              if deep:
                  physics = self.find_physics(phase=obj)
                  for phys in physics:
                      self._purge(self.physics()[phys.name])
              self._purge(obj)
          if obj._isa() == 'network':
              raise Exception('Cannot purge a network, just make a new project')
docs: r"""
          Remove an object from the Project.  This removes all references to
          the object from all other objects (i.e. removes labels)
  
          Parameters
          ----------
          obj : OpenPNM Object
              The object to purge
  
          deep : boolean
              A flag that indicates whether to remove associated objects.
              If ``True``, then removing a Geometry or Phase also removes
              the associated Physics objects.  If ``False`` (default) then
              only the given object is removed, along with its labels in all
              associated objects.  Removing a Physics always keeps associated
              Geometry and Phases since they might also be associated with other
              Physics objects.
  
          Raises
          ------
          An Exception is raised if the object is a Network.
  
          Notes
          -----
          For a clearer picture of this logic, type ``print(project.grid)`` at
          the console.  A deep purge of a Geometry is like removing a row, while
          a Phase is like removing a column.