예제 #1
0
def main():
    settings.run()
    start = datetime.now()
    logger = logging.getLogger(__name__)

    logger.info('Preprocessing started at second: %.2f',
                (datetime.now() - start).total_seconds())

    # preprocessing
    (standarized_path, standarized_params, channel_index,
     whiten_filter) = preprocess.run(output_directory='profiling',
                                     if_file_exists='overwrite')

    logger.info('Preprocessing finished and detection started at second: %.2f',
                (datetime.now() - start).total_seconds())

    # detection
    (score, spike_index_clear,
     spike_index_all) = detect.run(standarized_path,
                                   standarized_params,
                                   channel_index,
                                   whiten_filter,
                                   output_directory='profiling',
                                   if_file_exists='overwrite',
                                   save_results=True)

    logger.info('Detection finished and clustering started at second: %.2f',
                (datetime.now() - start).total_seconds())

    # clustering
    spike_train_clear = cluster.run(score, spike_index_clear,
                                    output_directory='profiling',
                                    if_file_exists='overwrite',
                                    save_results=True)

    logger.info('Clustering finished and templates started at second: %.2f',
                (datetime.now() - start).total_seconds())

    # templates
    the_templates = templates.run(spike_train_clear,
                                  output_directory='profiling',
                                  if_file_exists='overwrite',
                                  save_results=True)

    logger.info('templates finished and deconvolution started at second: %.2f',
                (datetime.now() - start).total_seconds())

    # deconvolution
    deconvolute.run(spike_index_all, the_templates,
                    output_directory='profiling')

    logger.info('Deconvolution finished at second: %.2f',
                (datetime.now() - start).total_seconds())
예제 #2
0
 def run(self):
     """ Cyclic execution for polling on alarm, move and settings """
     loop_nb = 1
     while self.is_loop_enabled is True:
         #fct.log("DEBUG: Monitoring loop " + str(loop_nb))
         if loop_nb % 10 == 0:
             alarm.run()
             move.run()
             settings.run()
         loop_nb += 1
         if loop_nb >= 1000000:
             loop_nb = 0
         time.sleep(0.1)
예제 #3
0
def show_tray_icon(alarms):
    menu_def = ['', ['&Настройки', '&О программе', '&Выход']]
    tray = sGUI.SystemTray(menu=menu_def, filename=r'icon.png')
    while True:  # The event loop
        menu_item = tray.read()
        print(menu_item)
        if menu_item == 'Выход':
            break
        elif menu_item == 'Настройки':
            logging.info("Настройки")
            settings.run(alarms)
        elif menu_item == "О программе":
            logging.info("О программе")
            about.run()
예제 #4
0
    def giveOption(self):
        fightSceneOptions = {}
        attackOptions = {}
        itemOptions = {}

        for item in self.player.stats.inventory.items:
            if item.id == "weapon":
                attackOptions[item.name] = item.attack
            else:
                itemOptions[item.name] = item.effect

        for option in settings.fightOptions:
            if option == "Attack":
                fightSceneOptions[option] = attackOptions

            elif option == "Items":
                fightSceneOptions[option] = itemOptions

            elif option == "Run":
                fightSceneOptions[option] = settings.run()
            else:
                fightSceneOptions[option] = '??'

        self.options = opBox.optionBox(fightSceneOptions)

        self.options.setPos('bottomR')
예제 #5
0
def main():
    settings.run()
    start = datetime.now()
    logger = logging.getLogger(__name__)

    logger.info('Preprocessing started at second: %.2f',
                (datetime.now() - start).total_seconds())

    # preprocessing
    (standarized_path, standarized_params, channel_index,
     whiten_filter) = preprocess.run()

    logger.info('Preprocessing finished and detection started at second: %.2f',
                (datetime.now() - start).total_seconds())

    # detection
    (score, spike_index_clear,
     spike_index_all) = detect.run(standarized_path, standarized_params,
                                   channel_index, whiten_filter)

    logger.info('Detection finished and clustering started at second: %.2f',
                (datetime.now() - start).total_seconds())

    # clustering
    spike_train_clear = cluster.run(score, spike_index_clear)

    logger.info('Clustering finished and templates started at second: %.2f',
                (datetime.now() - start).total_seconds())

    # templates
    the_templates = templates.run(spike_train_clear)

    logger.info('templates finished and deconvolution started at second: %.2f',
                (datetime.now() - start).total_seconds())

    # deconvolution
    deconvolute.run(spike_index_all, the_templates)

    logger.info('Deconvolution finished at second: %.2f',
                (datetime.now() - start).total_seconds())
from pathlib import Path
import logging
from datetime import datetime
from memory_profiler import profile
import yass
from yass import deconvolute
import settings

if __name__ == '__main__':
    settings.run()
    start = datetime.now()
    logger = logging.getLogger(__name__)

    CONFIG = yass.read_config()

    logger.info('Deconvolution started at second: %.2f',
                (datetime.now() - start).total_seconds())

    DIRECTORY = Path(CONFIG.data.root_folder, 'profiling')

    spike_index_all = str(DIRECTORY / 'spike_index_all.npy')
    templates = str(DIRECTORY / 'templates.npy')

    profile(deconvolute.run)(spike_index_all,
                             templates,
                             output_directory='profiling')

    logger.info('Deconvolution finished at second: %.2f',
                (datetime.now() - start).total_seconds())
예제 #7
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
#     FileName: client.py
#         Desc: 2015-15/3/9:下午11:27
#       Author: 苦咖啡
#        Email: [email protected]
#     HomePage: http://blog.kukafei520.net
#      History: 
# =============================================================================

from settings import run

if __name__ == '__main__':
    run()
예제 #8
0
파일: service.py 프로젝트: sutarn/push_api
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
#     FileName: service.py
#         Desc: 2015-15/2/26:下午9:19
#       Author: 苦咖啡
#        Email: [email protected]
#     HomePage: http://blog.kukafei520.net
#      History: 
# =============================================================================
from settings import run

if __name__ == '__main__':
    run()

예제 #9
0
파일: clock.py 프로젝트: GuyCarver/raspi
 def startsettings(self):
     #    print("Starting settings server")
     settings.run(self)
예제 #10
0
 def settings():
     settings.run()