Skip to content

Commit

Permalink
pykron 0.12 integrated
Browse files Browse the repository at this point in the history
  • Loading branch information
ddetommaso committed Oct 29, 2020
1 parent 00eab79 commit 9e03b34
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ex7-periodictask.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def offset():
X2 = qnet.createPlace('X2', init_tokens=0)
X3 = qnet.createPlace('X3', init_tokens=0, target_task=offset)

t_onset = QTimed('onset', PERIOD_MS)
t_onset = QTimed('onset', TASK_PERIOD_MS)
t_offset = QTimed('offset', TASK_DURATION_MS)
qnet.addNet(t_onset)
qnet.addNet(t_offset)
Expand Down
9 changes: 7 additions & 2 deletions quantica/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@
import xmlrpc.client

import time
import pykron
from pykron.core import Task, AsyncRequest

pykron.core.LOGGING_LEVEL = logging.DEBUG
pykron.core.LOGGING_PATH = '.'
FORMAT = '%(asctime)s.%(msecs)03d %(levelname)-5s %(message)s'

class QNode:
Expand Down Expand Up @@ -93,8 +97,9 @@ def task(self):
if not self.__target_task__ is None:
with self.__working__:
logging.debug("[%s] executing task ..." % self.getLabel())
t0 = time.perf_counter()
self.__target_task__()
task = Task(target=self.__target_task__,args=())
AsyncRequest(task).wait_for_completed()
#self.__target_task__()
logging.debug("[%s] task executed task!" % self.getLabel())

class QTransition(QNode):
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@

setup(
name='quantica',
version='pre-rc1.0',
version='beta-rc1.0',
description='A Python framework implemeting Petri Networks',
url='https://github.com/s4hri/quantica',
download_url='https://github.com/s4hri/quantica/archive/pre-rc1.0.tar.gz',
download_url='https://github.com/s4hri/quantica/archive/beta-rc1.0.tar.gz',
author='Davide De Tommaso',
author_email='[email protected]',
keywords=['petri','networks','python3.8'],
packages=find_packages(),
install_requires=["pykron>=0.11"],
classifiers = [
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9'
Expand Down

0 comments on commit 9e03b34

Please sign in to comment.