import hoomd.integrate


class Operations:
    def __init__(self, simulation=None):
        self.simulation = simulation
        self._compute = list()
        self._auto_schedule = False
        self._scheduled = False
        self._updaters = list()
        self._analyzers = list()

    def add(self, op):
        if isinstance(op, hoomd.integrate._integrator):
            self._integrator = op
        if isinstance(op, hoomd.meta._Updater):
            self._updaters.append(op)
        if isinstance(op, hoomd.meta._Analyzer):
            self._analyzers.append(op)
        else:
            raise ValueError("Operation is not of the correct type to add to"
                             " Operations.")
        if self._auto_schedule:
            self._schedule([op])

    @property
    def _operations(self):
        op = list()
        if hasattr(self, '_integrator'):
            op.append(self._integrator)
        op.extend(self._updaters)
        op.extend(self._analyzers)
        return op

    @property
    def _sys_init(self):
        if self.simulation is None or self.simulation.state is None:
            return False
        else:
            return True

    def schedule(self):
        self._schedule()

    def _schedule(self, ops=None):
        if not self._sys_init:
            raise RuntimeError("System not initialized yet")
        sim = self.simulation
        ops = self._operations if ops is None else ops
        for op in ops:
            new_objs = op.attach(sim)
            if isinstance(op, hoomd.integrate._integrator):
                sim._cpp_sys.setIntegrator(op._cpp_obj)
            if new_objs is not None:
                self._compute.extend(new_objs)
        self._scheduled = True
        self._auto_schedule = True

    def _store_reader(self, reader):
        # TODO
        pass

    @property
    def scheduled(self):
        return self._scheduled

    @property
    def integrator(self):
        try:
            return self._integrator
        except AttributeError:
            return None

    @property
    def updaters(self):
        return self._updaters

    @property
    def analyzers(self):
        return self._analyzers

@@ -392,32 +392,34 @@
 or = op%0A        
+el
 if isinstance(op
@@ -480,32 +480,34 @@
 end(op)%0A        
+el
 if isinstance(op

Fix bug where elif needed to be used not if