Esempio n. 1
0
 def __init__(self, ops):
     Operator.__init__(self, ops)
     self.transacs = []
     self.uid = CSV.uid
     self.current = None
     self.length = 1
     CSV.uid += 1
Esempio n. 2
0
 def __init__(self, pin, n = "relay"):
     Producer.__init__(self, n, interval = 60000)
     Operator.__init__(self, n)
     self.__relay = Pin(pin ,Pin.OUT)
     self.add_sensor(n, self.get_state)
     self.__async_blinking = False
     self.add_command(self.__op, SET)
     self.add_command(self.__get, GET)
Esempio n. 3
0
 def __init__(self, ops, accumulate):
     global Do_Maths
     Operator.__init__(self, ops)
     self.doers = []
     
     for doer in self.get_doers():
         self.doers.append(doer)
     self.daily_val = defaultdict(lambda : 0)
     self.dumps = defaultdict(lambda : [])
     self.accumulate = accumulate
     self.dumped = True
Esempio n. 4
0
def main(config):
    config.device = torch.device(
        'cuda:{}'.format(config.gpu) if torch.cuda.is_available() else 'cpu')

    # load data_loader
    data_loader = get_dataloader(config)
    check_point = Checkpoint(config)
    operator = Operator(config, check_point)

    if config.is_train:
        operator.train(data_loader)
    else:
        operator.test(data_loader)
Esempio n. 5
0
def main(config):
    config.device = torch.device(
        'cuda:{}'.format(config.gpu) if torch.cuda.is_available() else 'cpu')

    # load data_loader
    check_point = Checkpoint(config)
    operator = Operator(config, check_point)

    if config.is_train:
        midi_data = MidiData(config)
        operator.train(midi_data)
    else:
        operator.test()
Esempio n. 6
0
 def addOp(self, id):
     operator = Operator(id)
     operator.status = 'available'
     self.operators.append(operator)
Esempio n. 7
0
 def __init__(self):
     Consumer.__init__(self)
     self.__name = 'sensors'
     Operator.__init__(self, 'sensors')
     self.add_command(self.__get, GET)
     self.__sensors = {}
Esempio n. 8
0
 def __init__(self, name, fn):
     self.__fn = fn
     self.__config = None
     Operator.__init__(self, name)
     self.add_command(self.__get, GET, 'config')
     self.add_command(self.__set, SET, 'config')